[PATCH 1/3] wined3d: Do not request VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT for dynamic buffers.

Henri Verbeet hverbeet at codeweavers.com
Thu Dec 10 07:20:12 CST 2020


We don't typically need these to be in VRAM, and VRAM may not be mappable.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/buffer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6ff6a5b6cd0..dc32d97530a 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1390,8 +1390,11 @@ static BOOL wined3d_buffer_vk_create_buffer_object(struct wined3d_buffer_vk *buf
         usage |= VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
     if (bind_flags & (WINED3D_BIND_RENDER_TARGET | WINED3D_BIND_DEPTH_STENCIL))
         FIXME("Ignoring some bind flags %#x.\n", bind_flags);
-    memory_type = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
-            | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+
+    memory_type = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+    if (!(resource->usage & WINED3DUSAGE_DYNAMIC))
+        memory_type |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+
     if (!(wined3d_context_vk_create_bo(context_vk, resource->size, usage, memory_type, &buffer_vk->bo)))
     {
         WARN("Failed to create Vulkan buffer.\n");
-- 
2.20.1




More information about the wine-devel mailing list