summaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/midgard_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/panfrost/midgard/midgard_compile.c')
-rw-r--r--src/panfrost/midgard/midgard_compile.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 04d149f2b60..eaa5816cc7e 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -2294,13 +2294,6 @@ emit_block(compiler_context *ctx, nir_block *block)
midgard_opt_promote_fmov(ctx, ctx->current_block);
embedded_to_inline_constant(ctx);
- /* Append fragment shader epilogue (value writeout) */
- if (ctx->stage == MESA_SHADER_FRAGMENT) {
- if (block == nir_impl_last_block(ctx->func->impl)) {
- emit_fragment_epilogue(ctx);
- }
- }
-
/* Allow the next control flow to access us retroactively, for
* branching etc */
ctx->current_block = this_block;
@@ -2582,6 +2575,9 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga
struct midgard_block *end =
emit_block(ctx, func->impl->end_block);
+ if (ctx->stage == MESA_SHADER_FRAGMENT)
+ emit_fragment_epilogue(ctx);
+
midgard_block_add_successor(semi_end, end);
break; /* TODO: Multi-function shaders */