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

[d3d11] Allocate mapped buffers for staging images on cached memory

These will most likely be used for reading, so we should put them
on a memory type which allows reading.
This commit is contained in:
Philip Rebohle 2019-04-07 14:47:43 +02:00
parent 51f229530b
commit 56300ff9b7
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -424,9 +424,13 @@ namespace dxvk {
info.access = VK_ACCESS_TRANSFER_READ_BIT
| VK_ACCESS_TRANSFER_WRITE_BIT;
return m_device->GetDXVKDevice()->createBuffer(info,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
VkMemoryPropertyFlags memType = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
| VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
if (m_desc.Usage == D3D11_USAGE_STAGING)
memType |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
return m_device->GetDXVKDevice()->createBuffer(info, memType);
}