From 67f01631fa141400644df4ea7c337b270fb65d33 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 11 Jun 2020 05:58:17 +0100 Subject: [PATCH] [d3d9] Clear dirty range when discarding buffers --- src/d3d9/d3d9_device.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 07f89c99..5eebd618 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4317,6 +4317,9 @@ namespace dxvk { ] (DxvkContext* ctx) { ctx->invalidateBuffer(cBuffer, cBufferSlice); }); + + pResource->SetReadLocked(false); + pResource->DirtyRange().Clear(); } else { // NOOVERWRITE promises that they will not write in a currently used area. @@ -4344,14 +4347,12 @@ namespace dxvk { }); } } else { - if (!(Flags & D3DLOCK_DONOTWAIT)) { - pResource->SetReadLocked(false); - pResource->DirtyRange().Clear(); - } - if (!WaitForResource(mappingBuffer, Flags)) return D3DERR_WASSTILLDRAWING; } + + pResource->SetReadLocked(false); + pResource->DirtyRange().Clear(); } // Use map pointer from previous map operation. This