wined3d: Reference the indirect buffer bo in wined3d_context_gl_draw_indirect().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-12-01 20:38:03 +03:30 committed by Alexandre Julliard
parent 14ed6b1ce3
commit a381f0cae8
1 changed files with 3 additions and 2 deletions

View File

@ -4488,8 +4488,8 @@ static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_
const struct wined3d_indirect_draw_parameters *parameters, unsigned int idx_size)
{
GLenum gl_primitive_type = gl_primitive_type_from_d3d(state->primitive_type);
struct wined3d_buffer_gl *buffer_gl = wined3d_buffer_gl(parameters->buffer);
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
struct wined3d_buffer *buffer = parameters->buffer;
const void *offset;
if (!gl_info->supported[ARB_DRAW_INDIRECT])
@ -4498,7 +4498,7 @@ static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_
return;
}
GL_EXTCALL(glBindBuffer(GL_DRAW_INDIRECT_BUFFER, wined3d_buffer_gl(buffer)->bo.id));
GL_EXTCALL(glBindBuffer(GL_DRAW_INDIRECT_BUFFER, buffer_gl->bo.id));
offset = (void *)(GLintptr)parameters->offset;
if (idx_size)
@ -4514,6 +4514,7 @@ static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_
}
GL_EXTCALL(glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0));
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
checkGLcall("draw indirect");
}