From 4ed50ec6be6010370bb4d9da15f8fe1eea848ac1 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 27 Sep 2024 12:54:46 +0200 Subject: [PATCH] [d3d9] Fix UP buffer allocation --- src/d3d9/d3d9_device.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 24e1e96c642..4fa7b8c9854 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4370,15 +4370,16 @@ namespace dxvk { info.stages = VK_PIPELINE_STAGE_VERTEX_INPUT_BIT; Rc buffer = m_dxvkDevice->createBuffer(info, memoryFlags); + void* mapPtr = buffer->mapPtr(0); if (size <= UPBufferSize) { m_upBuffer = std::move(buffer); - m_upBufferMapPtr = m_upBuffer->mapPtr(0); + m_upBufferMapPtr = mapPtr; } else { // Temporary buffer D3D9BufferSlice result; result.slice = DxvkBufferSlice(std::move(buffer), 0, size); - result.mapPtr = buffer->mapPtr(0); + result.mapPtr = mapPtr; return result; } }