diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index f75334862fe..cf4d293f96a 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -536,7 +536,7 @@ static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource) { IDirect3DSurface8 *surface; - if (desc.resource_type != WINED3DRTYPE_SURFACE) + if (desc.resource_type != WINED3D_RTYPE_SURFACE) { WARN("Resource %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n", resource); return D3DERR_DEVICELOST; diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index 489fcfac0c8..0bb3b01c886 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -224,8 +224,8 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface, UINT A D3DFORMAT CheckFormat) { IDirect3D8Impl *This = impl_from_IDirect3D8(iface); + enum wined3d_resource_type wined3d_rtype; HRESULT hr; - WINED3DRESOURCETYPE WineD3DRType; TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n", iface, Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat); @@ -233,17 +233,17 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface, UINT A switch(RType) { case D3DRTYPE_VERTEXBUFFER: case D3DRTYPE_INDEXBUFFER: - WineD3DRType = WINED3DRTYPE_BUFFER; + wined3d_rtype = WINED3D_RTYPE_BUFFER; break; default: - WineD3DRType = RType; + wined3d_rtype = RType; break; } wined3d_mutex_lock(); hr = wined3d_check_device_format(This->WineD3D, Adapter, DeviceType, wined3dformat_from_d3dformat(AdapterFormat), - Usage, WineD3DRType, wined3dformat_from_d3dformat(CheckFormat), SURFACE_OPENGL); + Usage, wined3d_rtype, wined3dformat_from_d3dformat(CheckFormat), SURFACE_OPENGL); wined3d_mutex_unlock(); return hr; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index c46bd598ceb..afeb60d8b31 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -524,7 +524,7 @@ static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource) { IDirect3DSurface9 *surface; - if (desc.resource_type != WINED3DRTYPE_SURFACE) + if (desc.resource_type != WINED3D_RTYPE_SURFACE) { WARN("Resource %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n", resource); return D3DERR_INVALIDCALL; diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index 144cad5a246..218676ad72b 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -232,8 +232,8 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(IDirect3D9Ex *iface, UINT D3DFORMAT CheckFormat) { IDirect3D9Impl *This = impl_from_IDirect3D9Ex(iface); + enum wined3d_resource_type wined3d_rtype; HRESULT hr; - WINED3DRESOURCETYPE WineD3DRType; TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n", iface, Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat); @@ -241,17 +241,17 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(IDirect3D9Ex *iface, UINT switch(RType) { case D3DRTYPE_VERTEXBUFFER: case D3DRTYPE_INDEXBUFFER: - WineD3DRType = WINED3DRTYPE_BUFFER; + wined3d_rtype = WINED3D_RTYPE_BUFFER; break; default: - WineD3DRType = RType; + wined3d_rtype = RType; break; } wined3d_mutex_lock(); hr = wined3d_check_device_format(This->WineD3D, Adapter, DeviceType, wined3dformat_from_d3dformat(AdapterFormat), - Usage, WineD3DRType, wined3dformat_from_d3dformat(CheckFormat), SURFACE_OPENGL); + Usage, wined3d_rtype, wined3dformat_from_d3dformat(CheckFormat), SURFACE_OPENGL); wined3d_mutex_unlock(); return hr; diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index c3f5387333b..79f2b35e0c8 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -1541,7 +1541,7 @@ static HRESULT WINAPI ddraw7_GetFourCCCodes(IDirectDraw7 *iface, DWORD *NumCodes for (i = 0; i < (sizeof(formats) / sizeof(formats[0])); ++i) { hr = wined3d_check_device_format(This->wined3d, WINED3DADAPTER_DEFAULT, WINED3D_DEVICE_TYPE_HAL, - mode.format_id, 0, WINED3DRTYPE_SURFACE, formats[i], DefaultSurfaceType); + mode.format_id, 0, WINED3D_RTYPE_SURFACE, formats[i], DefaultSurfaceType); if (SUCCEEDED(hr)) { if (count < outsize) @@ -4685,7 +4685,7 @@ static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device for (i = 0; i < (sizeof(formats) / sizeof(*formats)); ++i) { hr = wined3d_check_device_format(This->wined3d, WINED3DADAPTER_DEFAULT, type, mode.format_id, - WINED3DUSAGE_DEPTHSTENCIL, WINED3DRTYPE_SURFACE, formats[i], SURFACE_OPENGL); + WINED3DUSAGE_DEPTHSTENCIL, WINED3D_RTYPE_SURFACE, formats[i], SURFACE_OPENGL); if (SUCCEEDED(hr)) { DDPIXELFORMAT pformat; @@ -4710,7 +4710,7 @@ static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device * pixel format, so we use dwZBufferBitDepth=32. Some games expect 24. Windows Vista and * newer enumerate both versions, so we do the same(bug 22434) */ hr = wined3d_check_device_format(This->wined3d, WINED3DADAPTER_DEFAULT, type, mode.format_id, - WINED3DUSAGE_DEPTHSTENCIL, WINED3DRTYPE_SURFACE, WINED3DFMT_X8D24_UNORM, SURFACE_OPENGL); + WINED3DUSAGE_DEPTHSTENCIL, WINED3D_RTYPE_SURFACE, WINED3DFMT_X8D24_UNORM, SURFACE_OPENGL); if (SUCCEEDED(hr)) { DDPIXELFORMAT x8d24 = diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index a056d9dbf1c..799992dfe72 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -1162,7 +1162,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i) { hr = wined3d_check_device_format(This->ddraw->wined3d, WINED3DADAPTER_DEFAULT, WINED3D_DEVICE_TYPE_HAL, - mode.format_id, 0, WINED3DRTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL); + mode.format_id, 0, WINED3D_RTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL); if (hr == D3D_OK) { DDPIXELFORMAT pformat; @@ -1186,7 +1186,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, { hr = wined3d_check_device_format(This->ddraw->wined3d, WINED3DADAPTER_DEFAULT, WINED3D_DEVICE_TYPE_HAL, mode.format_id, WINED3DUSAGE_QUERY_LEGACYBUMPMAP, - WINED3DRTYPE_TEXTURE, BumpFormatList[i], SURFACE_OPENGL); + WINED3D_RTYPE_TEXTURE, BumpFormatList[i], SURFACE_OPENGL); if (hr == D3D_OK) { DDPIXELFORMAT pformat; @@ -1299,7 +1299,7 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface, for (i = 0; i < sizeof(FormatList) / sizeof(*FormatList); ++i) { hr = wined3d_check_device_format(This->ddraw->wined3d, 0, WINED3D_DEVICE_TYPE_HAL, - mode.format_id, 0, WINED3DRTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL); + mode.format_id, 0, WINED3D_RTYPE_TEXTURE, FormatList[i], SURFACE_OPENGL); if (hr == D3D_OK) { DDSURFACEDESC sdesc; diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 9075700c98e..fc6f59c8399 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1196,7 +1196,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device return WINED3DERR_INVALIDCALL; } - hr = resource_init(&buffer->resource, device, WINED3DRTYPE_BUFFER, format, + hr = resource_init(&buffer->resource, device, WINED3D_RTYPE_BUFFER, format, WINED3D_MULTISAMPLE_NONE, 0, usage, pool, size, 1, 1, size, parent, parent_ops, &buffer_resource_ops); if (FAILED(hr)) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index e2419bd617a..fe26549179c 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -653,13 +653,13 @@ static void context_queue_fbo_entry_destruction(struct wined3d_context *context, } void context_resource_released(const struct wined3d_device *device, - struct wined3d_resource *resource, WINED3DRESOURCETYPE type) + struct wined3d_resource *resource, enum wined3d_resource_type type) { if (!device->d3d_initialized) return; switch (type) { - case WINED3DRTYPE_SURFACE: + case WINED3D_RTYPE_SURFACE: context_enum_surface_fbo_entries(device, surface_from_resource(resource), context_queue_fbo_entry_destruction); break; @@ -675,11 +675,11 @@ static void context_detach_fbo_entry(struct wined3d_context *context, struct fbo } void context_resource_unloaded(const struct wined3d_device *device, - struct wined3d_resource *resource, WINED3DRESOURCETYPE type) + struct wined3d_resource *resource, enum wined3d_resource_type type) { switch (type) { - case WINED3DRTYPE_SURFACE: + case WINED3D_RTYPE_SURFACE: context_enum_surface_fbo_entries(device, surface_from_resource(resource), context_detach_fbo_entry); break; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 84e0db0e8b4..8a83736eda2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -876,7 +876,7 @@ ULONG CDECL wined3d_device_decref(struct wined3d_device *device) LIST_FOR_EACH_ENTRY(resource, &device->resources, struct wined3d_resource, resource_list_entry) { FIXME("Leftover resource %p with type %s (%#x).\n", - resource, debug_d3dresourcetype(resource->resourceType), resource->resourceType); + resource, debug_d3dresourcetype(resource->type), resource->type); } } @@ -4338,8 +4338,8 @@ static HRESULT device_update_volume(struct wined3d_device *device, HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) { + enum wined3d_resource_type type; unsigned int level_count, i; - WINED3DRESOURCETYPE type; HRESULT hr; TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); @@ -4358,8 +4358,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, } /* Verify that the source and destination textures are the same type. */ - type = src_texture->resource.resourceType; - if (dst_texture->resource.resourceType != type) + type = src_texture->resource.type; + if (dst_texture->resource.type != type) { WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n"); return WINED3DERR_INVALIDCALL; @@ -4379,7 +4379,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, /* Update every surface level of the texture. */ switch (type) { - case WINED3DRTYPE_TEXTURE: + case WINED3D_RTYPE_TEXTURE: { struct wined3d_surface *src_surface; struct wined3d_surface *dst_surface; @@ -4398,7 +4398,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, break; } - case WINED3DRTYPE_CUBETEXTURE: + case WINED3D_RTYPE_CUBE_TEXTURE: { struct wined3d_surface *src_surface; struct wined3d_surface *dst_surface; @@ -4417,7 +4417,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, break; } - case WINED3DRTYPE_VOLUMETEXTURE: + case WINED3D_RTYPE_VOLUME_TEXTURE: { for (i = 0; i < level_count; ++i) { @@ -4799,7 +4799,7 @@ void CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, RECT rect; resource = rendertarget_view->resource; - if (resource->resourceType != WINED3DRTYPE_SURFACE) + if (resource->type != WINED3D_RTYPE_SURFACE) { FIXME("Only supported on surface resources\n"); return; @@ -5698,7 +5698,7 @@ static void device_resource_remove(struct wined3d_device *device, struct wined3d void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) { - WINED3DRESOURCETYPE type = resource->resourceType; + enum wined3d_resource_type type = resource->type; unsigned int i; TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -5707,7 +5707,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso switch (type) { - case WINED3DRTYPE_SURFACE: + case WINED3D_RTYPE_SURFACE: { struct wined3d_surface *surface = surface_from_resource(resource); @@ -5730,9 +5730,9 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso } break; - case WINED3DRTYPE_TEXTURE: - case WINED3DRTYPE_CUBETEXTURE: - case WINED3DRTYPE_VOLUMETEXTURE: + case WINED3D_RTYPE_TEXTURE: + case WINED3D_RTYPE_CUBE_TEXTURE: + case WINED3D_RTYPE_VOLUME_TEXTURE: for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) { struct wined3d_texture *texture = wined3d_texture_from_resource(resource); @@ -5754,7 +5754,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso } break; - case WINED3DRTYPE_BUFFER: + case WINED3D_RTYPE_BUFFER: { struct wined3d_buffer *buffer = buffer_from_resource(resource); @@ -5816,7 +5816,7 @@ HRESULT CDECL wined3d_device_get_surface_from_dc(const struct wined3d_device *de LIST_FOR_EACH_ENTRY(resource, &device->resources, struct wined3d_resource, resource_list_entry) { - if (resource->resourceType == WINED3DRTYPE_SURFACE) + if (resource->type == WINED3D_RTYPE_SURFACE) { struct wined3d_surface *s = surface_from_resource(resource); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 56cfa356f4d..b4be6635614 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -3794,7 +3794,7 @@ static BOOL CheckVertexTextureCapability(const struct wined3d_adapter *adapter, HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage, - WINED3DRESOURCETYPE resource_type, enum wined3d_format_id check_format_id, WINED3DSURFTYPE surface_type) + enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id, WINED3DSURFTYPE surface_type) { const struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx]; const struct wined3d_gl_info *gl_info = &adapter->gl_info; @@ -3813,7 +3813,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad switch (resource_type) { - case WINED3DRTYPE_CUBETEXTURE: + case WINED3D_RTYPE_CUBE_TEXTURE: /* Cubetexture allows: * - WINED3DUSAGE_AUTOGENMIPMAP * - WINED3DUSAGE_DEPTHSTENCIL @@ -3930,7 +3930,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad } break; - case WINED3DRTYPE_SURFACE: + case WINED3D_RTYPE_SURFACE: /* Surface allows: * - WINED3DUSAGE_DEPTHSTENCIL * - WINED3DUSAGE_NONSECURE (d3d9ex) @@ -3973,7 +3973,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad } break; - case WINED3DRTYPE_TEXTURE: + case WINED3D_RTYPE_TEXTURE: /* Texture allows: * - WINED3DUSAGE_AUTOGENMIPMAP * - WINED3DUSAGE_DEPTHSTENCIL @@ -4111,8 +4111,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad } break; - case WINED3DRTYPE_VOLUMETEXTURE: - case WINED3DRTYPE_VOLUME: + case WINED3D_RTYPE_VOLUME_TEXTURE: + case WINED3D_RTYPE_VOLUME: /* Volume is to VolumeTexture what Surface is to Texture, but its * usage caps are not documented. Most driver seem to offer * (nearly) the same on Volume and VolumeTexture, so do that too. @@ -4385,7 +4385,7 @@ HRESULT CDECL wined3d_check_device_type(const struct wined3d *wined3d, UINT adap /* Use CheckDeviceFormat to see if the backbuffer_format is usable with the given display_format */ hr = wined3d_check_device_format(wined3d, adapter_idx, device_type, display_format, - WINED3DUSAGE_RENDERTARGET, WINED3DRTYPE_SURFACE, backbuffer_format, SURFACE_OPENGL); + WINED3DUSAGE_RENDERTARGET, WINED3D_RTYPE_SURFACE, backbuffer_format, SURFACE_OPENGL); if (FAILED(hr)) TRACE_(d3d_caps)("Unsupported display/backbuffer format combination %s / %s.\n", debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); diff --git a/dlls/wined3d/palette.c b/dlls/wined3d/palette.c index 1fcc6ba1c9a..780c6a9e1f6 100644 --- a/dlls/wined3d/palette.c +++ b/dlls/wined3d/palette.c @@ -133,7 +133,7 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette, /* If the palette is attached to the render target, update all render targets */ LIST_FOR_EACH_ENTRY(resource, &palette->device->resources, struct wined3d_resource, resource_list_entry) { - if (resource->resourceType == WINED3DRTYPE_SURFACE) + if (resource->type == WINED3D_RTYPE_SURFACE) { struct wined3d_surface *surface = surface_from_resource(resource); if (surface->palette == palette) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 6f8fe9b3fcd..2569d755473 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -77,7 +77,7 @@ static void resource_check_usage(DWORD usage) } HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, - WINED3DRESOURCETYPE resource_type, const struct wined3d_format *format, + enum wined3d_resource_type type, const struct wined3d_format *format, enum wined3d_multisample_type multisample_type, UINT multisample_quality, DWORD usage, WINED3DPOOL pool, UINT width, UINT height, UINT depth, UINT size, void *parent, const struct wined3d_parent_ops *parent_ops, @@ -85,7 +85,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * { resource->ref = 1; resource->device = device; - resource->resourceType = resource_type; + resource->type = type; resource->format = format; resource->multisample_type = multisample_type; resource->multisample_quality = multisample_quality; @@ -172,7 +172,7 @@ void resource_cleanup(struct wined3d_resource *resource) void resource_unload(struct wined3d_resource *resource) { context_resource_unloaded(resource->device, - resource, resource->resourceType); + resource, resource->type); } static struct private_data *resource_find_private_data(const struct wined3d_resource *resource, REFGUID tag) @@ -318,7 +318,7 @@ void * CDECL wined3d_resource_get_parent(const struct wined3d_resource *resource void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc) { - desc->resource_type = resource->resourceType; + desc->resource_type = resource->type; desc->format = resource->format->id; desc->multisample_type = resource->multisample_type; desc->multisample_quality = resource->multisample_quality; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f0edb92186e..1c732ad7ee3 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -7257,7 +7257,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE sur return WINED3DERR_INVALIDCALL; } - hr = resource_init(&surface->resource, device, WINED3DRTYPE_SURFACE, format, + hr = resource_init(&surface->resource, device, WINED3D_RTYPE_SURFACE, format, multisample_type, multisample_quality, usage, pool, width, height, 1, resource_size, parent, parent_ops, &surface_resource_ops); if (FAILED(hr)) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 0dece3d60a7..6b461169538 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -461,7 +461,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R cursor.resource.device = swapchain->device; cursor.resource.pool = WINED3DPOOL_SCRATCH; cursor.resource.format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM); - cursor.resource.resourceType = WINED3DRTYPE_SURFACE; + cursor.resource.type = WINED3D_RTYPE_SURFACE; cursor.texture_name = swapchain->device->cursorTexture; cursor.texture_target = GL_TEXTURE_2D; cursor.texture_level = 0; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 3177df4e104..e00c387d4ae 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -26,7 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_texture_ops *texture_ops, - UINT layer_count, UINT level_count, WINED3DRESOURCETYPE resource_type, struct wined3d_device *device, + UINT layer_count, UINT level_count, enum wined3d_resource_type resource_type, struct wined3d_device *device, DWORD usage, const struct wined3d_format *format, WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) { @@ -806,7 +806,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_lengt } hr = wined3d_texture_init(texture, &texture2d_ops, 6, levels, - WINED3DRTYPE_CUBETEXTURE, device, usage, format, pool, + WINED3D_RTYPE_CUBE_TEXTURE, device, usage, format, pool, parent, parent_ops, &texture2d_resource_ops); if (FAILED(hr)) { @@ -943,7 +943,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT he } hr = wined3d_texture_init(texture, &texture2d_ops, 1, levels, - WINED3DRTYPE_TEXTURE, device, usage, format, pool, + WINED3D_RTYPE_TEXTURE, device, usage, format, pool, parent, parent_ops, &texture2d_resource_ops); if (FAILED(hr)) { @@ -1194,7 +1194,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, U } hr = wined3d_texture_init(texture, &texture3d_ops, 1, levels, - WINED3DRTYPE_VOLUMETEXTURE, device, usage, format, pool, + WINED3D_RTYPE_VOLUME_TEXTURE, device, usage, format, pool, parent, parent_ops, &texture3d_resource_ops); if (FAILED(hr)) { diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index b51a290649d..8fb15fd49ee 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1975,20 +1975,20 @@ const char* debug_d3ddeclusage(BYTE usage) { } } -const char *debug_d3dresourcetype(WINED3DRESOURCETYPE res) +const char *debug_d3dresourcetype(enum wined3d_resource_type resource_type) { - switch (res) + switch (resource_type) { #define RES_TO_STR(res) case res: return #res - RES_TO_STR(WINED3DRTYPE_SURFACE); - RES_TO_STR(WINED3DRTYPE_VOLUME); - RES_TO_STR(WINED3DRTYPE_TEXTURE); - RES_TO_STR(WINED3DRTYPE_VOLUMETEXTURE); - RES_TO_STR(WINED3DRTYPE_CUBETEXTURE); - RES_TO_STR(WINED3DRTYPE_BUFFER); + RES_TO_STR(WINED3D_RTYPE_SURFACE); + RES_TO_STR(WINED3D_RTYPE_VOLUME); + RES_TO_STR(WINED3D_RTYPE_TEXTURE); + RES_TO_STR(WINED3D_RTYPE_VOLUME_TEXTURE); + RES_TO_STR(WINED3D_RTYPE_CUBE_TEXTURE); + RES_TO_STR(WINED3D_RTYPE_BUFFER); #undef RES_TO_STR default: - FIXME("Unrecognized %u WINED3DRESOURCETYPE!\n", res); + FIXME("Unrecognized resource type %#x.\n", resource_type); return "unrecognized"; } } diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index fc71af5da9f..7d90fa7833e 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -279,7 +279,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_device return WINED3DERR_INVALIDCALL; } - hr = resource_init(&volume->resource, device, WINED3DRTYPE_VOLUME, format, + hr = resource_init(&volume->resource, device, WINED3D_RTYPE_VOLUME, format, WINED3D_MULTISAMPLE_NONE, 0, usage, pool, width, height, depth, width * height * depth * format->byte_count, parent, parent_ops, &volume_resource_ops); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8e5edc55692..30452c010b2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1257,9 +1257,9 @@ DWORD context_get_tls_idx(void) DECLSPEC_HIDDEN; void context_invalidate_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; void context_release(struct wined3d_context *context) DECLSPEC_HIDDEN; void context_resource_released(const struct wined3d_device *device, - struct wined3d_resource *resource, WINED3DRESOURCETYPE type) DECLSPEC_HIDDEN; + struct wined3d_resource *resource, enum wined3d_resource_type type) DECLSPEC_HIDDEN; void context_resource_unloaded(const struct wined3d_device *device, - struct wined3d_resource *resource, WINED3DRESOURCETYPE type) DECLSPEC_HIDDEN; + struct wined3d_resource *resource, enum wined3d_resource_type type) DECLSPEC_HIDDEN; BOOL context_set_current(struct wined3d_context *ctx) DECLSPEC_HIDDEN; void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer) DECLSPEC_HIDDEN; void context_set_tls_idx(DWORD idx) DECLSPEC_HIDDEN; @@ -1836,7 +1836,7 @@ struct wined3d_resource { LONG ref; struct wined3d_device *device; - WINED3DRESOURCETYPE resourceType; + enum wined3d_resource_type type; const struct wined3d_format *format; enum wined3d_multisample_type multisample_type; UINT multisample_quality; @@ -1861,7 +1861,7 @@ struct wined3d_resource void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD resource_get_priority(const struct wined3d_resource *resource) DECLSPEC_HIDDEN; HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, - WINED3DRESOURCETYPE resource_type, const struct wined3d_format *format, + enum wined3d_resource_type type, const struct wined3d_format *format, enum wined3d_multisample_type multisample_type, UINT multisample_quality, DWORD usage, WINED3DPOOL pool, UINT width, UINT height, UINT depth, UINT size, void *parent, const struct wined3d_parent_ops *parent_ops, @@ -2489,7 +2489,7 @@ void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPE /* Trace routines */ const char *debug_d3dformat(enum wined3d_format_id format_id) DECLSPEC_HIDDEN; const char *debug_d3ddevicetype(enum wined3d_device_type device_type) DECLSPEC_HIDDEN; -const char *debug_d3dresourcetype(WINED3DRESOURCETYPE res) DECLSPEC_HIDDEN; +const char *debug_d3dresourcetype(enum wined3d_resource_type resource_type) DECLSPEC_HIDDEN; const char *debug_d3dusage(DWORD usage) DECLSPEC_HIDDEN; const char *debug_d3dusagequery(DWORD usagequery) DECLSPEC_HIDDEN; const char *debug_d3ddeclmethod(WINED3DDECLMETHOD method) DECLSPEC_HIDDEN; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 2a9353f8733..f1ea2c6b6e4 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -670,17 +670,15 @@ enum wined3d_texture_filter_type WINED3D_TEXF_GAUSSIAN_QUAD = 7, }; -typedef enum _WINED3DRESOURCETYPE +enum wined3d_resource_type { - WINED3DRTYPE_SURFACE = 1, - WINED3DRTYPE_VOLUME = 2, - WINED3DRTYPE_TEXTURE = 3, - WINED3DRTYPE_VOLUMETEXTURE = 4, - WINED3DRTYPE_CUBETEXTURE = 5, - WINED3DRTYPE_BUFFER = 6, - WINED3DRTYPE_FORCE_DWORD = 0x7fffffff -} WINED3DRESOURCETYPE; -#define WINED3DRTYPECOUNT WINED3DRTYPE_BUFFER + WINED3D_RTYPE_SURFACE = 1, + WINED3D_RTYPE_VOLUME = 2, + WINED3D_RTYPE_TEXTURE = 3, + WINED3D_RTYPE_VOLUME_TEXTURE = 4, + WINED3D_RTYPE_CUBE_TEXTURE = 5, + WINED3D_RTYPE_BUFFER = 6, +}; typedef enum _WINED3DPOOL { @@ -1632,7 +1630,7 @@ struct wined3d_swapchain_desc struct wined3d_resource_desc { - WINED3DRESOURCETYPE resource_type; + enum wined3d_resource_type resource_type; enum wined3d_format_id format; enum wined3d_multisample_type multisample_type; UINT multisample_quality; @@ -2008,7 +2006,7 @@ HRESULT __cdecl wined3d_check_depth_stencil_match(const struct wined3d *wined3d, enum wined3d_format_id render_target_format_id, enum wined3d_format_id depth_stencil_format_id); HRESULT __cdecl wined3d_check_device_format(const struct wined3d *wined3d, UINT adaper_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage, - WINED3DRESOURCETYPE resource_type, enum wined3d_format_id check_format_id, + enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id, WINED3DSURFTYPE surface_type); HRESULT __cdecl wined3d_check_device_format_conversion(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id source_format_id,