wined3d: Allow OpenGL transform feedback buffer objects to be suballocated from a larger buffer.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-11-18 21:06:19 -06:00 committed by Alexandre Julliard
parent 6c6fcff96e
commit 3057929d54
1 changed files with 3 additions and 1 deletions

View File

@ -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; const struct wined3d_gl_info *gl_info = context_gl->gl_info;
struct wined3d_buffer *buffer; struct wined3d_buffer *buffer;
unsigned int offset, size, i; unsigned int offset, size, i;
struct wined3d_bo_gl *bo_gl;
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); 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; buffer = state->stream_output[i].buffer;
offset = state->stream_output[i].offset; offset = state->stream_output[i].offset;
bo_gl = wined3d_bo_gl(buffer->buffer_object);
if (offset == ~0u) if (offset == ~0u)
{ {
FIXME("Appending to stream output buffers not implemented.\n"); 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; size = buffer->resource.size - offset;
GL_EXTCALL(glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, i, 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; buffer->bo_user.valid = true;
} }
checkGLcall("bind transform feedback buffers"); checkGLcall("bind transform feedback buffers");