[Mesa-dev] [PATCH 11/17] radeonsi: handle fixed-func TCS shader create failure

Marek Olšák maraeo at gmail.com
Thu Sep 10 10:56:34 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

Cc: 11.0 <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeonsi/si_state_shaders.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 74e1136..43d2e88 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1351,7 +1351,6 @@ static void si_generate_fixed_func_tcs(struct si_context *sctx)
 
 	sctx->fixed_func_tcs_shader =
 		ureg_create_shader_and_destroy(ureg, &sctx->b.b);
-	assert(sctx->fixed_func_tcs_shader);
 }
 
 static void si_update_vgt_shader_config(struct si_context *sctx)
@@ -1420,8 +1419,12 @@ bool si_update_shaders(struct si_context *sctx)
 			si_shader_select(ctx, sctx->tcs_shader);
 			si_pm4_bind_state(sctx, hs, sctx->tcs_shader->current->pm4);
 		} else {
-			if (!sctx->fixed_func_tcs_shader)
+			if (!sctx->fixed_func_tcs_shader) {
 				si_generate_fixed_func_tcs(sctx);
+				if (!sctx->fixed_func_tcs_shader)
+					return false;
+			}
+
 			si_shader_select(ctx, sctx->fixed_func_tcs_shader);
 			si_pm4_bind_state(sctx, hs,
 					  sctx->fixed_func_tcs_shader->current->pm4);
-- 
2.1.4



More information about the mesa-dev mailing list