diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 40890cc99e8..dcaa0727075 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -335,17 +335,19 @@ static DWORD wined3d_resource_sanitise_map_flags(const struct wined3d_resource * return 0; } } - else if ((flags & (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) - == (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) + else if (flags & (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) { - WARN("WINED3D_MAP_DISCARD and WINED3D_MAP_NOOVERWRITE used together, ignoring.\n"); - return 0; - } - else if (flags & (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE) - && !(resource->usage & WINED3DUSAGE_DYNAMIC)) - { - WARN("DISCARD or NOOVERWRITE map on non-dynamic buffer, ignoring.\n"); - return 0; + if (!(resource->usage & WINED3DUSAGE_DYNAMIC)) + { + WARN("DISCARD or NOOVERWRITE map on non-dynamic buffer, ignoring.\n"); + return 0; + } + if ((flags & (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) + == (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) + { + WARN("WINED3D_MAP_NOOVERWRITE used with WINED3D_MAP_DISCARD, ignoring WINED3D_MAP_DISCARD.\n"); + flags &= ~WINED3D_MAP_DISCARD; + } } return flags;