From 374dd5bae8150f62c0f58cae4ad0c2958fa7f169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 17 Feb 2016 21:56:38 +0100 Subject: [PATCH] Fix i965 crash with bin/gl-3.1-vao-broken-attrib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/vrend_renderer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index b195e47..2bb3423 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -2759,6 +2759,16 @@ void vrend_draw_vbo(struct vrend_context *ctx, else 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) { struct vrend_resource *res = (struct vrend_resource *)ctx->sub->ib.buffer; glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, res->id);