mirror of
https://github.com/reactos/wine.git
synced 2024-11-28 22:20:26 +00:00
wined3d: Enforce texturing capability format restrictions on resource creation.
This commit is contained in:
parent
b464067313
commit
80638b6d2f
@ -1197,6 +1197,7 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device,
|
||||
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
desc.multisample_quality = 0;
|
||||
desc.usage = usage & WINED3DUSAGE_MASK;
|
||||
desc.usage |= WINED3DUSAGE_TEXTURE;
|
||||
desc.pool = pool;
|
||||
desc.width = width;
|
||||
desc.height = height;
|
||||
@ -1237,6 +1238,7 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic
|
||||
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
desc.multisample_quality = 0;
|
||||
desc.usage = usage & WINED3DUSAGE_MASK;
|
||||
desc.usage |= WINED3DUSAGE_TEXTURE;
|
||||
desc.pool = pool;
|
||||
desc.width = edge_length;
|
||||
desc.height = edge_length;
|
||||
@ -1276,6 +1278,7 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev
|
||||
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
desc.multisample_quality = 0;
|
||||
desc.usage = usage & WINED3DUSAGE_MASK;
|
||||
desc.usage |= WINED3DUSAGE_TEXTURE;
|
||||
desc.pool = pool;
|
||||
desc.width = width;
|
||||
desc.height = height;
|
||||
|
@ -1321,6 +1321,7 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device,
|
||||
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
desc.multisample_quality = 0;
|
||||
desc.usage = usage & WINED3DUSAGE_MASK;
|
||||
desc.usage |= WINED3DUSAGE_TEXTURE;
|
||||
desc.pool = pool;
|
||||
desc.width = width;
|
||||
desc.height = height;
|
||||
@ -1361,6 +1362,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic
|
||||
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
desc.multisample_quality = 0;
|
||||
desc.usage = usage & WINED3DUSAGE_MASK;
|
||||
desc.usage |= WINED3DUSAGE_TEXTURE;
|
||||
desc.pool = pool;
|
||||
desc.width = edge_length;
|
||||
desc.height = edge_length;
|
||||
@ -1400,6 +1402,7 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev
|
||||
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
desc.multisample_quality = 0;
|
||||
desc.usage = usage & WINED3DUSAGE_MASK;
|
||||
desc.usage |= WINED3DUSAGE_TEXTURE;
|
||||
desc.pool = pool;
|
||||
desc.width = width;
|
||||
desc.height = height;
|
||||
|
@ -5608,16 +5608,27 @@ HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface, DWORD surfac
|
||||
layers = 1;
|
||||
|
||||
if (desc->ddsCaps.dwCaps2 & DDSCAPS2_TEXTUREMANAGE)
|
||||
{
|
||||
wined3d_desc.usage = WINED3DUSAGE_TEXTURE;
|
||||
pool = WINED3D_POOL_MANAGED;
|
||||
}
|
||||
else if (desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY)
|
||||
{
|
||||
/* ddraw does not enforce format support restrictions on system memory
|
||||
* textures. Don't set the texture flag, the texture can't be used for
|
||||
* texturing anyway. */
|
||||
wined3d_desc.usage = 0;
|
||||
pool = WINED3D_POOL_SYSTEM_MEM;
|
||||
}
|
||||
else
|
||||
{
|
||||
wined3d_desc.usage = WINED3DUSAGE_TEXTURE;
|
||||
pool = WINED3D_POOL_DEFAULT;
|
||||
}
|
||||
|
||||
wined3d_desc.format = wined3dformat_from_ddrawformat(&surface->surface_desc.u4.ddpfPixelFormat);
|
||||
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
wined3d_desc.multisample_quality = 0;
|
||||
wined3d_desc.usage = 0;
|
||||
wined3d_desc.pool = pool;
|
||||
wined3d_desc.width = desc->dwWidth;
|
||||
wined3d_desc.height = desc->dwHeight;
|
||||
|
@ -70,7 +70,8 @@ static void resource_check_usage(DWORD usage)
|
||||
| WINED3DUSAGE_DYNAMIC
|
||||
| WINED3DUSAGE_AUTOGENMIPMAP
|
||||
| WINED3DUSAGE_STATICDECL
|
||||
| WINED3DUSAGE_OVERLAY;
|
||||
| WINED3DUSAGE_OVERLAY
|
||||
| WINED3DUSAGE_TEXTURE;
|
||||
|
||||
if (usage & ~handled)
|
||||
FIXME("Unhandled usage flags %#x.\n", usage & ~handled);
|
||||
@ -92,6 +93,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
if ((usage & WINED3DUSAGE_DEPTHSTENCIL) && !(format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
if ((usage & WINED3DUSAGE_TEXTURE) && !(format->flags & WINED3DFMT_FLAG_TEXTURE))
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
resource->ref = 1;
|
||||
|
@ -824,6 +824,7 @@ enum wined3d_display_rotation
|
||||
#define WINED3DUSAGE_AUTOGENMIPMAP 0x00000400
|
||||
#define WINED3DUSAGE_DMAP 0x00004000
|
||||
#define WINED3DUSAGE_MASK 0x00004fff
|
||||
#define WINED3DUSAGE_TEXTURE 0x10000000
|
||||
#define WINED3DUSAGE_OWNDC 0x20000000
|
||||
#define WINED3DUSAGE_STATICDECL 0x40000000
|
||||
#define WINED3DUSAGE_OVERLAY 0x80000000
|
||||
|
Loading…
Reference in New Issue
Block a user