[Mesa-dev] [PATCH 2/3] radeonsi: don't crash on compute shader compiler failure

Marek Olšák maraeo at gmail.com
Fri Mar 24 00:00:22 UTC 2017


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

---
 src/gallium/drivers/radeonsi/si_compute.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 19a9189..46476b6 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -739,23 +739,27 @@ static void si_launch_grid(
 	bool cs_regalloc_hang =
 		(sctx->b.chip_class == SI ||
 		 sctx->b.family == CHIP_BONAIRE ||
 		 sctx->b.family == CHIP_KABINI) &&
 		info->block[0] * info->block[1] * info->block[2] > 256;
 
 	if (cs_regalloc_hang)
 		sctx->b.flags |= SI_CONTEXT_PS_PARTIAL_FLUSH |
 				 SI_CONTEXT_CS_PARTIAL_FLUSH;
 
-	if (program->ir_type == PIPE_SHADER_IR_TGSI)
+	if (program->ir_type == PIPE_SHADER_IR_TGSI) {
 		util_queue_fence_wait(&program->ready);
 
+		if (program->shader.compilation_failed)
+			return;
+	}
+
 	si_decompress_compute_textures(sctx);
 
 	/* Add buffer sizes for memory checking in need_cs_space. */
 	r600_context_add_resource_size(ctx, &program->shader.bo->b.b);
 	/* TODO: add the scratch buffer */
 
 	if (info->indirect) {
 		r600_context_add_resource_size(ctx, info->indirect);
 
 		/* The hw doesn't read the indirect buffer via TC L2. */
-- 
2.7.4



More information about the mesa-dev mailing list