wined3d: Use the resource access flags in texture_resource_sub_resource_map().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-02-02 20:28:52 +03:30 committed by Alexandre Julliard
parent 2420d37a9d
commit def8363476
1 changed files with 1 additions and 1 deletions

View File

@ -1872,7 +1872,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
if (box && FAILED(wined3d_texture_check_box_dimensions(texture, texture_level, box)))
{
WARN("Map box is invalid.\n");
if (((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && resource->pool == WINED3D_POOL_DEFAULT)
if (((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !(resource->access & WINED3D_RESOURCE_ACCESS_CPU))
|| resource->type != WINED3D_RTYPE_TEXTURE_2D)
return WINED3DERR_INVALIDCALL;
}