Henri Verbeet : wined3d: Request VK_MEMORY_PROPERTY_HOST_CACHED_BIT for WINED3D_RESOURCE_ACCESS_MAP_R buffers.

Alexandre Julliard julliard at winehq.org
Thu Dec 10 16:05:29 CST 2020


Module: wine
Branch: master
Commit: ff0aa5a8da870cca49d1d39b01cb20ba8517e062
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ff0aa5a8da870cca49d1d39b01cb20ba8517e062

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Dec 10 17:08:13 2020 +0330

wined3d: Request VK_MEMORY_PROPERTY_HOST_CACHED_BIT for WINED3D_RESOURCE_ACCESS_MAP_R buffers.

Unsurprisingly, reading for uncached memory may be very slow.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/buffer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index dc32d97530a..11974467984 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1394,6 +1394,8 @@ static BOOL wined3d_buffer_vk_create_buffer_object(struct wined3d_buffer_vk *buf
     memory_type = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
     if (!(resource->usage & WINED3DUSAGE_DYNAMIC))
         memory_type |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+    if (resource->access & WINED3D_RESOURCE_ACCESS_MAP_R)
+        memory_type |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
 
     if (!(wined3d_context_vk_create_bo(context_vk, resource->size, usage, memory_type, &buffer_vk->bo)))
     {




More information about the wine-cvs mailing list