summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-10-16 11:45:54 +1000
committerDave Airlie <airlied@redhat.com>2015-10-16 11:45:54 +1000
commitdd4345b5af3e61757ca4516ba9319c0220fcc7d4 (patch)
treee15dbe62686b275804775d9b9299f2094071f9fd
parent438552093024b3220b72d601fe3b093a869a3f93 (diff)
renderer: bail if we don't have a program when we need it.
This is just avoiding a crash, it really shouldn't happen, but we don't want to crash if it does.
-rw-r--r--src/vrend_renderer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 4d72c82..c0cb3c1 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -2546,7 +2546,10 @@ void vrend_draw_vbo(struct vrend_context *ctx,
ctx->sub->prog = prog;
}
}
-
+ if (!ctx->sub->prog) {
+ fprintf(stderr,"dropping rendering due to missing shaders: %s\n", ctx->debug_name);
+ return;
+ }
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ctx->sub->fb_id);
vrend_use_program(ctx, ctx->sub->prog->id);