Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d8/buffer.c | 2 -- dlls/d3d8/device.c | 2 -- dlls/d3d8/texture.c | 6 ------ dlls/d3d9/buffer.c | 2 -- dlls/d3d9/device.c | 2 -- dlls/d3d9/texture.c | 6 ------ dlls/wined3d/device.c | 6 ++---- dlls/wined3d/resource.c | 7 +++---- dlls/wined3d/surface.c | 2 +- dlls/wined3d/texture.c | 4 ++-- include/wine/wined3d.h | 1 - 11 files changed, 8 insertions(+), 32 deletions(-)
diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c index 93917d4fdcf..da9d5317b22 100644 --- a/dlls/d3d8/buffer.c +++ b/dlls/d3d8/buffer.c @@ -577,8 +577,6 @@ HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *de
desc.byte_width = size; desc.usage = (usage & WINED3DUSAGE_MASK) | WINED3DUSAGE_STATICDECL; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.bind_flags = WINED3D_BIND_INDEX_BUFFER; diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index cf158daab17..a9a71d62363 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1163,8 +1163,6 @@ static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width desc.multisample_type = multisample_type; desc.multisample_quality = multisample_quality; desc.usage = usage & WINED3DUSAGE_MASK; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage) diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index f7e8fd36b9f..5fe83d65f7b 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -1108,8 +1108,6 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, desc.multisample_quality = 0; desc.usage = usage & WINED3DUSAGE_MASK; desc.usage |= WINED3DUSAGE_TEXTURE; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage) @@ -1158,8 +1156,6 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic desc.multisample_quality = 0; desc.usage = usage & WINED3DUSAGE_MASK; desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage) @@ -1207,8 +1203,6 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev desc.multisample_quality = 0; desc.usage = usage & WINED3DUSAGE_MASK; desc.usage |= WINED3DUSAGE_TEXTURE; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage); diff --git a/dlls/d3d9/buffer.c b/dlls/d3d9/buffer.c index b12167eb8be..c854556e723 100644 --- a/dlls/d3d9/buffer.c +++ b/dlls/d3d9/buffer.c @@ -576,8 +576,6 @@ HRESULT indexbuffer_init(struct d3d9_indexbuffer *buffer, struct d3d9_device *de
desc.byte_width = size; desc.usage = (usage & WINED3DUSAGE_MASK) | WINED3DUSAGE_STATICDECL; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.bind_flags = WINED3D_BIND_INDEX_BUFFER; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 39281330aa1..3e549c956b8 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1390,8 +1390,6 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width desc.multisample_type = multisample_type; desc.multisample_quality = multisample_quality; desc.usage = usage & WINED3DUSAGE_MASK; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage) diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 52cefbf9e28..609b5e7def7 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -1312,8 +1312,6 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device, desc.multisample_quality = 0; desc.usage = wined3dusage_from_d3dusage(usage); desc.usage |= WINED3DUSAGE_TEXTURE; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage) @@ -1399,8 +1397,6 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic desc.multisample_quality = 0; desc.usage = wined3dusage_from_d3dusage(usage); desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage) @@ -1472,8 +1468,6 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev desc.multisample_quality = 0; desc.usage = wined3dusage_from_d3dusage(usage); desc.usage |= WINED3DUSAGE_TEXTURE; - if (pool == D3DPOOL_SCRATCH) - desc.usage |= WINED3DUSAGE_SCRATCH; if (pool == D3DPOOL_MANAGED) desc.usage |= WINED3DUSAGE_MANAGED; desc.access = wined3daccess_from_d3dpool(pool, usage); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f98c02d99c0..d402bb01518 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3466,7 +3466,7 @@ HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device, return WINED3D_OK; }
- if (texture && texture->resource.usage & WINED3DUSAGE_SCRATCH) + if (texture && ~texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU) { WARN("Rejecting attempt to set scratch texture.\n"); return WINED3DERR_INVALIDCALL; @@ -3805,9 +3805,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; }
- if ((src_texture->resource.access & (WINED3D_RESOURCE_ACCESS_GPU | WINED3D_RESOURCE_ACCESS_CPU)) - == WINED3D_RESOURCE_ACCESS_GPU - || src_texture->resource.usage & WINED3DUSAGE_SCRATCH + if (~src_texture->resource.access & (WINED3D_RESOURCE_ACCESS_GPU | WINED3D_RESOURCE_ACCESS_CPU) || src_texture->resource.usage & WINED3DUSAGE_MANAGED) { WARN("Source resource doesn't allow both CPU and GPU access or is a managed resource.\n"); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 8669100f138..eef8e9f9f7a 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -36,7 +36,6 @@ static void resource_check_usage(DWORD usage) | WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_STATICDECL | WINED3DUSAGE_OVERLAY - | WINED3DUSAGE_SCRATCH | WINED3DUSAGE_MANAGED | WINED3DUSAGE_PRIVATE | WINED3DUSAGE_LEGACY_CUBEMAP @@ -88,9 +87,9 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource_check_usage(usage);
- if (usage & WINED3DUSAGE_SCRATCH && access & WINED3D_RESOURCE_ACCESS_GPU) + if (usage & WINED3DUSAGE_MANAGED && ~access & (WINED3D_RESOURCE_ACCESS_GPU | WINED3D_RESOURCE_ACCESS_CPU)) { - ERR("Trying to create a scratch resource with access flags %s.\n", + ERR("Trying to create a managed resource with access flags %s.\n", wined3d_debug_resource_access(access)); return WINED3DERR_INVALIDCALL; } @@ -151,7 +150,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * * Use 2D textures, the texture code will pad to a power of 2 size. */ gl_type = WINED3D_GL_RES_TYPE_TEX_2D; } - else if (usage & WINED3DUSAGE_SCRATCH) + else if (~access & WINED3D_RESOURCE_ACCESS_GPU) { /* Needed for proper format information. */ gl_type = base_type; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 71693adc589..131132797e5 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -633,7 +633,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr desc.format = dst_format->id; desc.multisample_type = WINED3D_MULTISAMPLE_NONE; desc.multisample_quality = 0; - desc.usage = WINED3DUSAGE_SCRATCH | WINED3DUSAGE_PRIVATE; + desc.usage = WINED3DUSAGE_PRIVATE; desc.access = WINED3D_RESOURCE_ACCESS_CPU | WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W; desc.width = wined3d_texture_get_level_width(src_texture, texture_level); desc.height = wined3d_texture_get_level_height(src_texture, texture_level); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 283f35cd525..7dcac1352cf 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2899,7 +2899,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc format = wined3d_get_format(device->adapter, desc->format, desc->usage);
if (desc->usage & WINED3DUSAGE_DYNAMIC && (desc->usage & WINED3DUSAGE_MANAGED - || desc->usage & WINED3DUSAGE_SCRATCH)) + || ~desc->access & WINED3D_RESOURCE_ACCESS_GPU)) { WARN("Attempted to create a dynamic texture with access %s and usage %s.\n", wined3d_debug_resource_access(desc->access), debug_d3dusage(desc->usage)); @@ -2920,7 +2920,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc /* level_count == 0 returns an error as well. */ if (level_count != 1 || layer_count != 1 || desc->resource_type == WINED3D_RTYPE_TEXTURE_3D) { - if (!(desc->usage & WINED3DUSAGE_SCRATCH)) + if (desc->access & WINED3D_RESOURCE_ACCESS_GPU) { WARN("Attempted to create a mipmapped/cube/array/volume NPOT " "texture without unconditional NPOT support.\n"); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d8322ef017e..d4088e3cf81 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -930,7 +930,6 @@ enum wined3d_shader_type #define WINED3DUSAGE_TEXTAPI 0x10000000 #define WINED3DUSAGE_MASK 0x10007bfb
-#define WINED3DUSAGE_SCRATCH 0x00200000 #define WINED3DUSAGE_MANAGED 0x00000004 #define WINED3DUSAGE_PRIVATE 0x00400000 #define WINED3DUSAGE_LEGACY_CUBEMAP 0x00800000