[virglrenderer-devel] [PATCH virglrenderer] Fix i965 crash with bin/gl-3.1-vao-broken-attrib
marcandre.lureau at redhat.com
marcandre.lureau at redhat.com
Wed Feb 17 20:56:38 UTC 2016
From: Marc-André Lureau <marcandre.lureau at redhat.com>
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 at redhat.com>
---
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);
--
2.5.0
More information about the virglrenderer-devel
mailing list