From 01f633289b4e38659a68d46669ff0b5386e8c067 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Fri, 15 Oct 2021 04:19:01 +0200 Subject: [PATCH] [d3d9] Use mapped slice when locking POOL_DEFAULT textures Fixes an issue where the game would end up using the wrong buffer slice if it previously mapped the same texture with DISCARD. Fixes #2329 --- src/d3d9/d3d9_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index f18d837f..6a27b1de 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4187,7 +4187,7 @@ namespace dxvk { } } else { - physSlice = mappedBuffer->getSliceHandle(); + physSlice = pResource->GetMappedSlice(Subresource); if (!alloced || wasWrittenByGPU) { if (unlikely(wasWrittenByGPU)) {