mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-01 16:24:12 +01:00
[d3d11] Improve per-context staging buffer handling
In D3D11, the staging buffer is only used for UpdateSubresource, which isn't always used much. Reducing the size and freeing the buffer after every submission avoids situations where system memory chunks are kept alive by a single unused 4MB allocation.
This commit is contained in:
parent
c614e537a9
commit
c27cae2f10
@ -72,7 +72,9 @@ namespace dxvk {
|
||||
template<typename T> friend class D3D11DeviceContextExt;
|
||||
template<typename T> friend class D3D11UserDefinedAnnotation;
|
||||
|
||||
constexpr static VkDeviceSize StagingBufferSize = 4ull << 20;
|
||||
// Use a local staging buffer to handle tiny uploads, most
|
||||
// of the time we're fine with hitting the global allocator
|
||||
constexpr static VkDeviceSize StagingBufferSize = 256ull << 10;
|
||||
public:
|
||||
|
||||
D3D11CommonContext(
|
||||
|
@ -992,6 +992,10 @@ namespace dxvk {
|
||||
// Vulkan queue submission is performed.
|
||||
if (synchronizeSubmission)
|
||||
m_device->waitForSubmission(&m_submitStatus);
|
||||
|
||||
// Free local staging buffer so that we don't
|
||||
// end up with a persistent allocation
|
||||
ResetStagingBuffer();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user