summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index bc9521aa9ed..4ea8834de2b 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -1731,6 +1731,11 @@ midgard_opt_cull_dead_branch(compiler_context *ctx, midgard_block *block)
* just generally special */
if (ins->prepacked_branch) continue;
+ /* Discards are similarly special and may not correspond to the
+ * end of a block */
+
+ if (ins->branch.target_type == TARGET_DISCARD) continue;
+
if (branched) {
/* We already branched, so this is dead */
mir_remove_instruction(ins);