1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Don't suballocate large staging buffer allocations

Otherwise we'll risk wasting almost half the staging buffer memory.
Creating a temporary buffer is cheap enough, so just do that.
This commit is contained in:
Philip Rebohle 2022-02-14 01:00:48 +01:00
parent b9201db554
commit 08ecd49c66
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -31,7 +31,7 @@ namespace dxvk {
VkDeviceSize alignedSize = dxvk::align(size, align); VkDeviceSize alignedSize = dxvk::align(size, align);
VkDeviceSize alignedOffset = dxvk::align(m_offset, align); VkDeviceSize alignedOffset = dxvk::align(m_offset, align);
if (alignedSize >= m_size) { if (2 * alignedSize > m_size) {
return DxvkBufferSlice(m_device->createBuffer(info, return DxvkBufferSlice(m_device->createBuffer(info,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)); VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT));
} }