From 56300ff9b72eaf09f136886d0e8e1d0901c31274 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 7 Apr 2019 14:47:43 +0200 Subject: [PATCH] [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. --- src/d3d11/d3d11_texture.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index d07ab1a7e..bc30f37e5 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -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); }