vrend: cache GL_DRAW_INDIRECT_BUFFER binding

This is only updated from one place, and it's usually going to stay
zero. So let's cache it to prevent excessive state emission.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 056328c868
commit 523796808a
  1. 11
      src/vrend_renderer.c

@ -538,6 +538,8 @@ struct vrend_sub_context {
GLuint program_id;
int last_shader_idx;
GLint draw_indirect_buffer;
struct pipe_rasterizer_state hw_rs_state;
struct pipe_blend_state hw_blend_state;
@ -4044,10 +4046,11 @@ int vrend_draw_vbo(struct vrend_context *ctx,
}
if (has_feature(feat_indirect_draw)) {
if (indirect_res)
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, indirect_res->id);
else
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0);
GLint buf = indirect_res ? indirect_res->id : 0;
if (ctx->sub->draw_indirect_buffer != buf) {
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, buf);
ctx->sub->draw_indirect_buffer = buf;
}
}
if (info->vertices_per_patch && has_feature(feat_tessellation))

Loading…
Cancel
Save