From 19408f0ebede526a1aad2a594b3b25619d1737e5 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 17 Sep 2018 07:45:05 +0200 Subject: [PATCH] [d3d11] Fix reported RowPitch/DepthPitch for mapped buffers Some games rely on this being the exact buffer size. --- src/d3d11/d3d11_context_imm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 304b9ab1..e9af28bb 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -355,11 +355,11 @@ namespace dxvk { // Use map pointer from previous map operation. This // way we don't have to synchronize with the CS thread // if the map mode is D3D11_MAP_WRITE_NO_OVERWRITE. - const DxvkPhysicalBufferSlice physicalSlice = pResource->GetMappedSlice(); + DxvkPhysicalBufferSlice physicalSlice = pResource->GetMappedSlice(); pMappedResource->pData = physicalSlice.mapPtr(0); - pMappedResource->RowPitch = physicalSlice.length(); - pMappedResource->DepthPitch = physicalSlice.length(); + pMappedResource->RowPitch = pResource->GetSize(); + pMappedResource->DepthPitch = pResource->GetSize(); return S_OK; }