[PATCH 2/6] wined3d: Do not add the BO address offset when calling glFlushMappedBufferRange().

Zebediah Figura zfigura at codeweavers.com
Tue Nov 23 21:17:08 CST 2021


From: Henri Verbeet <hverbeet at codeweavers.com>

Fixes: c2f0ae50b4dd70aa9d364ec6a7dd728e65370d8b
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/wined3d/context_gl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index 3c57bcbe249..0b0d594b4b1 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -2759,8 +2759,9 @@ static void flush_bo_ranges(struct wined3d_context_gl *context_gl, const struct
     {
         for (i = 0; i < range_count; ++i)
         {
-            GL_EXTCALL(glFlushMappedBufferRange(bo->binding,
-                    (UINT_PTR)data->addr + ranges[i].offset, ranges[i].size));
+            /* The offset passed to glFlushMappedBufferRange() is relative to
+             * the mapped range, so don't add data->addr in this case. */
+            GL_EXTCALL(glFlushMappedBufferRange(bo->binding, ranges[i].offset, ranges[i].size));
         }
     }
     else if (gl_info->supported[APPLE_FLUSH_BUFFER_RANGE])
-- 
2.33.0




More information about the wine-devel mailing list