[PATCH 2/5] wined3d: Do not allocate upload bufers for resources pinned to system memory.

Zebediah Figura zfigura at codeweavers.com
Thu Feb 17 23:01:36 CST 2022


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/wined3d/cs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 56abc146733..4a20f2ffe23 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -3094,6 +3094,12 @@ static bool wined3d_cs_map_upload_bo(struct wined3d_device_context *context, str
             return NULL;
         }
 
+        if (resource->pin_sysmem)
+        {
+            TRACE("Not allocating an upload buffer because system memory is pinned for this resource.\n");
+            return NULL;
+        }
+
         if (flags & WINED3D_MAP_DISCARD)
         {
             if (!device->adapter->adapter_ops->adapter_alloc_bo(device, resource, sub_resource_idx, &addr))
-- 
2.34.1




More information about the wine-devel mailing list