wined3d: Reject managed/scratch textures with dynamic usage in texture_init().

For consistency with volumetexture_init().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-03-15 11:38:41 +03:30 committed by Alexandre Julliard
parent 543a199dc3
commit 4d4fc7ae34
1 changed files with 8 additions and 2 deletions

View File

@ -2198,8 +2198,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
if (desc->usage & WINED3DUSAGE_DYNAMIC && wined3d_resource_access_is_managed(desc->access)) if (desc->usage & WINED3DUSAGE_DYNAMIC && (wined3d_resource_access_is_managed(desc->access)
FIXME("Trying to create a managed texture with dynamic usage.\n"); || desc->usage & WINED3DUSAGE_SCRATCH))
{
WARN("Attempted to create a dynamic texture with access %s and usage %s.\n",
wined3d_debug_resource_access(desc->access), debug_d3dusage(desc->usage));
return WINED3DERR_INVALIDCALL;
}
if (!(desc->usage & (WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL)) if (!(desc->usage & (WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL))
&& (flags & WINED3D_TEXTURE_CREATE_MAPPABLE)) && (flags & WINED3D_TEXTURE_CREATE_MAPPABLE))
WARN("Creating a mappable texture that doesn't specify dynamic usage.\n"); WARN("Creating a mappable texture that doesn't specify dynamic usage.\n");