wined3d: Simply use surface_modify_location() in IWineD3DSurfaceImpl_Map() with WINED3DLOCK_DISCARD.

The call to surface_add_dirty_rect() would have taken care of evicting the
other locations anyway, but we really shouldn't be touching the location flags
directly.
This commit is contained in:
Henri Verbeet 2010-11-11 12:39:19 +01:00 committed by Alexandre Julliard
parent d3fd7b247b
commit 78abb8ae07
1 changed files with 5 additions and 5 deletions

View File

@ -1655,11 +1655,11 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Map(IWineD3DSurface *iface,
TRACE("Warning: trying to lock unlockable surf@%p\n", This);
}
if (Flags & WINED3DLOCK_DISCARD) {
/* Set SFLAG_INSYSMEM, so we'll never try to download the data from the texture. */
TRACE("WINED3DLOCK_DISCARD flag passed, marking local copy as up to date\n");
surface_prepare_system_memory(This); /* Makes sure memory is allocated */
This->Flags |= SFLAG_INSYSMEM;
if (Flags & WINED3DLOCK_DISCARD)
{
TRACE("WINED3DLOCK_DISCARD flag passed, marking SYSMEM as up to date.\n");
surface_prepare_system_memory(This);
surface_modify_location(This, SFLAG_INSYSMEM, TRUE);
goto lock_end;
}