1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxvk] Free existing staging buffer before creating a new one

This commit is contained in:
Philip Rebohle 2022-02-18 18:13:28 +01:00
parent 17a1b0ad44
commit 146fbd492f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -39,6 +39,9 @@ namespace dxvk {
if (alignedOffset + alignedSize > m_size || m_buffer == nullptr) {
info.size = m_size;
// Free resources first if possible, in some rare
// situations this may help avoid a memory allocation.
m_buffer = nullptr;
m_buffer = m_device->createBuffer(info,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
alignedOffset = 0;