From ad11f38db92b425e8df84dc4f7ea58366b73e32a Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 27 Jan 2016 00:06:25 +0100 Subject: [PATCH] wined3d: Rename the texture creation flags to WINED3D_TEXTURE_CREATE_*. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d8/device.c | 10 +++++----- dlls/d3d8/texture.c | 12 ++++++------ dlls/d3d9/device.c | 14 +++++++------- dlls/d3d9/texture.c | 12 ++++++------ dlls/ddraw/ddraw.c | 2 +- dlls/ddraw/surface.c | 7 ++++--- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/surface.c | 7 ++++--- dlls/wined3d/texture.c | 8 ++++---- include/wine/wined3d.h | 8 ++++---- 10 files changed, 43 insertions(+), 41 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index fe1a425088f..94cb7e789c3 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -995,7 +995,7 @@ static HRESULT WINAPI d3d8_device_CreateRenderTarget(IDirect3DDevice8 *iface, UI *surface = NULL; if (lockable) - flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; return d3d8_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, 0); @@ -1013,7 +1013,7 @@ static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *if *surface = NULL; /* TODO: Verify that Discard is false */ - return d3d8_device_create_surface(device, width, height, format, WINED3D_SURFACE_MAPPABLE, + return d3d8_device_create_surface(device, width, height, format, WINED3D_TEXTURE_CREATE_MAPPABLE, surface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, 0); } @@ -1028,7 +1028,7 @@ static HRESULT WINAPI d3d8_device_CreateImageSurface(IDirect3DDevice8 *iface, UI *surface = NULL; - return d3d8_device_create_surface(device, width, height, format, WINED3D_SURFACE_MAPPABLE, + return d3d8_device_create_surface(device, width, height, format, WINED3D_TEXTURE_CREATE_MAPPABLE, surface, 0, D3DPOOL_SYSTEMMEM, D3DMULTISAMPLE_NONE, 0); } @@ -3039,8 +3039,8 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic TRACE("device_parent %p, container_parent %p, desc %p, texture %p.\n", device_parent, container_parent, desc, texture); - if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, &device->IDirect3DDevice8_iface, &d3d8_null_wined3d_parent_ops, texture))) + if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, + NULL, &device->IDirect3DDevice8_iface, &d3d8_null_wined3d_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index 96a34dcb57a..f64604b8360 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -1150,7 +1150,7 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DTexture8_Vtbl; @@ -1170,13 +1170,13 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) levels = wined3d_log2i(max(width, height)) + 1; wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) @@ -1195,7 +1195,7 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DCubeTexture8_Vtbl; @@ -1215,13 +1215,13 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) levels = wined3d_log2i(edge_length) + 1; wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 76c5ac6fba7..6047a2c19bd 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1182,7 +1182,7 @@ static HRESULT WINAPI d3d9_device_CreateRenderTarget(IDirect3DDevice9Ex *iface, } if (lockable) - flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; return d3d9_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL); @@ -1193,7 +1193,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex * BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - DWORD flags = WINED3D_SURFACE_MAPPABLE; + DWORD flags = WINED3D_TEXTURE_CREATE_MAPPABLE; TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u.\n" "discard %#x, surface %p, shared_handle %p.\n", @@ -1213,7 +1213,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex * } if (discard) - flags |= WINED3D_SURFACE_DISCARD; + flags |= WINED3D_TEXTURE_CREATE_DISCARD; return d3d9_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL); @@ -1465,7 +1465,7 @@ static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurface(IDirect3DDevice9Ex * regardless of the pool they're created in. Should we set dynamic usage * here? */ return d3d9_device_create_surface(device, width, height, format, - WINED3D_SURFACE_MAPPABLE, surface, 0, pool, D3DMULTISAMPLE_NONE, 0, user_mem); + WINED3D_TEXTURE_CREATE_MAPPABLE, surface, 0, pool, D3DMULTISAMPLE_NONE, 0, user_mem); } static HRESULT WINAPI d3d9_device_SetRenderTarget(IDirect3DDevice9Ex *iface, DWORD idx, IDirect3DSurface9 *surface) @@ -3353,7 +3353,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - DWORD flags = WINED3D_SURFACE_MAPPABLE; + DWORD flags = WINED3D_TEXTURE_CREATE_MAPPABLE; TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, " "discard %#x, surface %p, shared_handle %p, usage %#x.\n", @@ -3370,7 +3370,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle); if (discard) - flags |= WINED3D_SURFACE_DISCARD; + flags |= WINED3D_TEXTURE_CREATE_DISCARD; return d3d9_device_create_surface(device, width, height, format, flags, surface, D3DUSAGE_DEPTHSTENCIL | usage, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL); @@ -3642,7 +3642,7 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic container_parent = &device->IDirect3DDevice9Ex_iface; if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, container_parent, &d3d9_null_wined3d_parent_ops, texture))) + WINED3D_TEXTURE_CREATE_MAPPABLE, NULL, container_parent, &d3d9_null_wined3d_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 878a4ae67da..be6fd9f0bbd 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -1280,7 +1280,7 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_2d_vtbl; @@ -1300,7 +1300,7 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device, desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) { @@ -1311,7 +1311,7 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device, } wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) @@ -1330,7 +1330,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) { struct wined3d_resource_desc desc; - DWORD surface_flags = 0; + DWORD flags = 0; HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_cube_vtbl; @@ -1350,7 +1350,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic desc.size = 0; if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) - surface_flags |= WINED3D_SURFACE_MAPPABLE; + flags |= WINED3D_TEXTURE_CREATE_MAPPABLE; if (!levels) { @@ -1361,7 +1361,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic } wined3d_mutex_lock(); - hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, + hr = wined3d_texture_create(device->wined3d_device, &desc, levels, flags, NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture); wined3d_mutex_unlock(); if (FAILED(hr)) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 6c3ba3440bb..f17bb64b26f 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -4816,7 +4816,7 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic } if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, ddraw, &ddraw_frontbuffer_parent_ops, texture))) + WINED3D_TEXTURE_CREATE_MAPPABLE, NULL, ddraw, &ddraw_frontbuffer_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index f842efec9d4..b4fa5dee0f9 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -6074,9 +6074,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ * the surface isn't mapped, and that updates done this way will be * visible on the screen. The game Nox is such an application, * Commandos: Behind Enemy Lines is another. We set - * WINED3D_SURFACE_PIN_SYSMEM because of this. */ + * WINED3D_TEXTURE_CREATE_PIN_SYSMEM because of this. */ if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, &wined3d_desc, levels, - WINED3D_SURFACE_PIN_SYSMEM, NULL, texture, &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) + WINED3D_TEXTURE_CREATE_PIN_SYSMEM, NULL, texture, &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) { WARN("Failed to create wined3d texture, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, texture); @@ -6188,7 +6188,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ desc->u5.dwBackBufferCount = 0; if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, &wined3d_desc, 1, - WINED3D_SURFACE_PIN_SYSMEM, NULL, texture, &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) + WINED3D_TEXTURE_CREATE_PIN_SYSMEM, NULL, texture, + &ddraw_texture_wined3d_parent_ops, &wined3d_texture))) { HeapFree(GetProcessHeap(), 0, texture); hr = hr_ddraw_from_wined3d(hr); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index bb910b3225b..581d1191469 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -633,7 +633,7 @@ static void device_load_logo(struct wined3d_device *device, const char *filename desc.height = bm.bmHeight; desc.depth = 1; desc.size = 0; - if (FAILED(hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, + if (FAILED(hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, NULL, NULL, &wined3d_null_parent_ops, &device->logo_texture))) { ERR("Wine logo requested, but failed to create texture, hr %#x.\n", hr); @@ -4284,7 +4284,7 @@ static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined desc.depth = 1; desc.size = 0; - hr = wined3d_texture_create(device, &desc, 1, WINED3D_SURFACE_MAPPABLE, + hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, &data, NULL, &wined3d_null_parent_ops, &texture); wined3d_surface_unmap(cursor_image); if (FAILED(hr)) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index bdf681be9de..715b4ac19fe 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2345,7 +2345,8 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *so desc.usage = 0; desc.pool = WINED3D_POOL_SCRATCH; if (FAILED(wined3d_texture_create(source->resource.device, &desc, 1, - WINED3D_SURFACE_MAPPABLE | WINED3D_SURFACE_DISCARD, NULL, NULL, &wined3d_null_parent_ops, &ret))) + WINED3D_TEXTURE_CREATE_MAPPABLE | WINED3D_TEXTURE_CREATE_DISCARD, + NULL, NULL, &wined3d_null_parent_ops, &ret))) { ERR("Failed to create a destination surface for conversion.\n"); return NULL; @@ -5351,8 +5352,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text struct wined3d_device *device = container->resource.device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_format *format = wined3d_get_format(gl_info, desc->format); + BOOL lockable = flags & WINED3D_TEXTURE_CREATE_MAPPABLE; UINT multisample_quality = desc->multisample_quality; - BOOL lockable = flags & WINED3D_SURFACE_MAPPABLE; unsigned int resource_size; HRESULT hr; @@ -5410,7 +5411,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text list_init(&surface->overlays); /* Flags */ - if (flags & WINED3D_SURFACE_DISCARD) + if (flags & WINED3D_TEXTURE_CREATE_DISCARD) surface->flags |= SFLAG_DISCARD; if (lockable || desc->format == WINED3DFMT_D16_LOCKABLE) surface->resource.access_flags |= WINED3D_RESOURCE_ACCESS_CPU; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 12d57b86f43..3f9c1d9dddb 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); WINE_DECLARE_DEBUG_CHANNEL(winediag); static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_texture_ops *texture_ops, - UINT layer_count, UINT level_count, const struct wined3d_resource_desc *desc, DWORD surface_flags, + UINT layer_count, UINT level_count, const struct wined3d_resource_desc *desc, DWORD flags, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) { @@ -37,11 +37,11 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc TRACE("texture %p, texture_ops %p, layer_count %u, level_count %u, resource_type %s, format %s, " "multisample_type %#x, multisample_quality %#x, usage %s, pool %s, width %u, height %u, depth %u, " - "surface_flags %#x, device %p, parent %p, parent_ops %p, resource_ops %p.\n", + "flags %#x, device %p, parent %p, parent_ops %p, resource_ops %p.\n", texture, texture_ops, layer_count, level_count, debug_d3dresourcetype(desc->resource_type), debug_d3dformat(desc->format), desc->multisample_type, desc->multisample_quality, debug_d3dusage(desc->usage), debug_d3dpool(desc->pool), desc->width, desc->height, desc->depth, - surface_flags, device, parent, parent_ops, resource_ops); + flags, device, parent, parent_ops, resource_ops); if (FAILED(hr = resource_init(&texture->resource, device, desc->resource_type, format, desc->multisample_type, desc->multisample_quality, desc->usage, desc->pool, @@ -76,7 +76,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->filter_type = (desc->usage & WINED3DUSAGE_AUTOGENMIPMAP) ? WINED3D_TEXF_LINEAR : WINED3D_TEXF_NONE; texture->lod = 0; texture->flags = WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS; - if (surface_flags & WINED3D_SURFACE_PIN_SYSMEM) + if (flags & WINED3D_TEXTURE_CREATE_PIN_SYSMEM) texture->flags |= WINED3D_TEXTURE_PIN_SYSMEM; return WINED3D_OK; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 79db043354c..08cbf508ec1 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1472,9 +1472,9 @@ enum wined3d_display_rotation #define WINED3D_PALETTE_ALLOW_256 0x00000002 #define WINED3D_PALETTE_ALPHA 0x00000004 -#define WINED3D_SURFACE_MAPPABLE 0x00000001 -#define WINED3D_SURFACE_DISCARD 0x00000002 -#define WINED3D_SURFACE_PIN_SYSMEM 0x00000004 +#define WINED3D_TEXTURE_CREATE_MAPPABLE 0x00000001 +#define WINED3D_TEXTURE_CREATE_DISCARD 0x00000002 +#define WINED3D_TEXTURE_CREATE_PIN_SYSMEM 0x00000004 #define WINED3D_APPEND_ALIGNED_ELEMENT 0xffffffff @@ -2529,7 +2529,7 @@ HRESULT __cdecl wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigne struct wined3d_texture *src_texture, unsigned int src_idx, const RECT *src_rect_in, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter); HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, - UINT level_count, DWORD surface_flags, const struct wined3d_sub_resource_data *data, void *parent, + UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture); ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture); void __cdecl wined3d_texture_generate_mipmaps(struct wined3d_texture *texture);