diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-02-17 21:56:38 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-02-18 09:59:17 +1000 |
commit | 374dd5bae8150f62c0f58cae4ad0c2958fa7f169 (patch) | |
tree | 152404653c51cff4f738a3dbf42c422a4e85d8b8 | |
parent | 0f97c41da2e78f768fd7a6854c4ddad2525a9ffd (diff) |
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>
-rw-r--r-- | src/vrend_renderer.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |