wined3d: Ignore WINED3D_MAP_DISCARD when used together with WINED3D_MAP_NOOVERWRITE.
This fixes a performance issue exposed by commit
afb2aa2512
.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4c8cb19708
commit
63ed42ac39
dlls/wined3d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue