Skip to content

Commit

Permalink
[d3d9] Fix UP buffer allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
doitsujin committed Sep 27, 2024
1 parent 78f5136 commit 4ed50ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4370,15 +4370,16 @@ namespace dxvk {
info.stages = VK_PIPELINE_STAGE_VERTEX_INPUT_BIT;

Rc<DxvkBuffer> 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;
}
}
Expand Down

0 comments on commit 4ed50ec

Please sign in to comment.