[PATCH 4/5] wined3d: Set a valid map pointer in wined3d_device_gl_create_bo() if possible.

Zebediah Figura zfigura at codeweavers.com
Thu Feb 17 00:13:53 CST 2022


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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f163e77fcf1..b4948fa50ac 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1175,6 +1175,18 @@ bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, struct win
     bo->b.map_ptr = NULL;
     bo->b.client_map_count = 0;
 
+    if (memory)
+    {
+        struct wined3d_allocator_chunk_gl *chunk = wined3d_allocator_chunk_gl(memory->chunk);
+
+        wined3d_allocator_chunk_gl_lock(chunk);
+
+        if ((bo->b.map_ptr = chunk->c.map_ptr))
+            ++chunk->c.map_count;
+
+        wined3d_allocator_chunk_gl_unlock(chunk);
+    }
+
     return true;
 }
 
-- 
2.34.1




More information about the wine-devel mailing list