Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/resource.c | 6 ++++++ dlls/wined3d/texture.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index e318888..3b07e0c 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -346,6 +346,12 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n", resource, sub_resource_idx, map_desc, debug_box(box), flags);
+ if (!(resource->access & WINED3D_RESOURCE_ACCESS_MAP)) + { + WARN("Resource is not mappable.\n"); + return WINED3DERR_INVALIDCALL; + } + flags = wined3d_resource_sanitise_map_flags(resource, flags); wined3d_resource_wait_idle(resource);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index c9210cb..dd6a2dd 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1897,12 +1897,6 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3DERR_INVALIDCALL; }
- if (!(resource->access & WINED3D_RESOURCE_ACCESS_MAP)) - { - WARN("Trying to map unmappable texture.\n"); - return WINED3DERR_INVALIDCALL; - } - if (texture->flags & WINED3D_TEXTURE_DC_IN_USE) { WARN("DC is in use.\n");