r600g: check shaders presence in r600_draw_vbo
authorVadim Girlin <vadimgirlin@gmail.com>
Fri, 2 Dec 2011 09:44:29 +0000 (13:44 +0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Dec 2011 14:53:35 +0000 (09:53 -0500)
This patch should prevent the crashes when some shaders are absent,
see https://bugs.freedesktop.org/show_bug.cgi?id=43341

Note this is a candidate for the stable branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_state_common.c

index 9ecbc53522b12675d843a340637a274f05b3a3c1..d6ffda47c2cf4771a7b75e4369db07dbf08105e4 100644 (file)
@@ -534,6 +534,9 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
                return;
        }
 
+       if (!rctx->ps_shader || !rctx->vs_shader)
+               return;
+
        r600_update_derived_state(rctx);
 
        u_vbuf_draw_begin(rctx->vbuf_mgr, dinfo);