[Mesa-dev] [PATCH] r600g: check shaders presence in r600_draw_vbo

Vadim Girlin vadimgirlin at gmail.com
Fri Dec 2 01:44:29 PST 2011


This patch should prevent the crashes when some shaders are absent,
see https://bugs.freedesktop.org/show_bug.cgi?id=43341

Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
---

This is not the best solution for the mentioned bug, but probably it's
better to prevent crashes until we have something else.

 src/gallium/drivers/r600/r600_state_common.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 9ecbc53..d6ffda4 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -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);
-- 
1.7.7.3



More information about the mesa-dev mailing list