[PATCH 4/5] wined3d: Respect the BO memory offset for uniform buffers.

Zebediah Figura zfigura at codeweavers.com
Wed Nov 17 18:09:31 CST 2021


From: Henri Verbeet <hverbeet at codeweavers.com>

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

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 25733bbb50c..d291bc15757 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4577,6 +4577,7 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
     enum wined3d_shader_type shader_type;
     struct wined3d_buffer *buffer;
     unsigned int i, base, count;
+    struct wined3d_bo_gl *bo_gl;
 
     TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
 
@@ -4597,8 +4598,9 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
         }
 
         buffer = buffer_state->buffer;
+        bo_gl = wined3d_bo_gl(buffer->buffer_object);
         GL_EXTCALL(glBindBufferRange(GL_UNIFORM_BUFFER, base + i,
-                wined3d_bo_gl(buffer->buffer_object)->id, buffer_state->offset, buffer_state->size));
+                bo_gl->id, bo_gl->b.memory_offset + buffer_state->offset, buffer_state->size));
         buffer->bo_user.valid = true;
     }
     checkGLcall("bind constant buffers");
-- 
2.33.0




More information about the wine-devel mailing list