Fix i965 crash with bin/gl-3.1-vao-broken-attrib

It's unfortunate, but the i965 driver deliberately crash on such simple test
case. Fortunately, it seems fairly straightforward to avoid it in virgl.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 0f97c41da2
commit 374dd5bae8
  1. 10
      src/vrend_renderer.c

@ -2759,6 +2759,16 @@ void vrend_draw_vbo(struct vrend_context *ctx,
else else
vrend_draw_bind_vertex_legacy(ctx, ctx->sub->ve); vrend_draw_bind_vertex_legacy(ctx, ctx->sub->ve);
for (i = 0 ; i < ctx->sub->prog->ss[PIPE_SHADER_VERTEX]->sel->sinfo.num_inputs; i++) {
struct vrend_vertex_element_array *va = ctx->sub->ve;
struct vrend_vertex_element *ve = &va->elements[i];
int vbo_index = ve->base.vertex_buffer_index;
if (!ctx->sub->vbo[vbo_index].buffer) {
fprintf(stderr, "VBO missing vertex buffer\n");
return;
}
}
if (info->indexed) { if (info->indexed) {
struct vrend_resource *res = (struct vrend_resource *)ctx->sub->ib.buffer; struct vrend_resource *res = (struct vrend_resource *)ctx->sub->ib.buffer;
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, res->id); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, res->id);

Loading…
Cancel
Save