From 3057929d5473ca9b4416fb9ece5a66623d9b8325 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 18 Nov 2021 21:06:19 -0600 Subject: [PATCH] wined3d: Allow OpenGL transform feedback buffer objects to be suballocated from a larger buffer. Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 21b5ba1d032..adbaa50a349 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4651,6 +4651,7 @@ static void state_so(struct wined3d_context *context, const struct wined3d_state const struct wined3d_gl_info *gl_info = context_gl->gl_info; struct wined3d_buffer *buffer; unsigned int offset, size, i; + struct wined3d_bo_gl *bo_gl; TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); @@ -4666,6 +4667,7 @@ static void state_so(struct wined3d_context *context, const struct wined3d_state buffer = state->stream_output[i].buffer; offset = state->stream_output[i].offset; + bo_gl = wined3d_bo_gl(buffer->buffer_object); if (offset == ~0u) { FIXME("Appending to stream output buffers not implemented.\n"); @@ -4673,7 +4675,7 @@ static void state_so(struct wined3d_context *context, const struct wined3d_state } size = buffer->resource.size - offset; GL_EXTCALL(glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, i, - wined3d_bo_gl(buffer->buffer_object)->id, offset, size)); + bo_gl->id, bo_gl->buffer_offset + offset, size)); buffer->bo_user.valid = true; } checkGLcall("bind transform feedback buffers");