diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index fae0c53fc2d..1d131d51f7e 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -4674,6 +4674,16 @@ bi_lower_load_output(nir_builder *b, nir_instr *instr, UNUSED void *data) return true; } +bool +bifrost_nir_lower_load_output(nir_shader *nir) +{ + assert(nir->info.stage == MESA_SHADER_FRAGMENT); + + return nir_shader_instructions_pass( + nir, bi_lower_load_output, + nir_metadata_block_index | nir_metadata_dominance, NULL); +} + void bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id) { @@ -4730,8 +4740,7 @@ bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id) NIR_PASS_V(nir, nir_shader_instructions_pass, bi_lower_sample_mask_writes, nir_metadata_block_index | nir_metadata_dominance, NULL); - NIR_PASS_V(nir, nir_shader_instructions_pass, bi_lower_load_output, - nir_metadata_block_index | nir_metadata_dominance, NULL); + NIR_PASS_V(nir, bifrost_nir_lower_load_output); } else if (nir->info.stage == MESA_SHADER_VERTEX) { if (gpu_id >= 0x9000) { NIR_PASS_V(nir, nir_lower_mediump_io, nir_var_shader_out, diff --git a/src/panfrost/compiler/bifrost_nir.h b/src/panfrost/compiler/bifrost_nir.h index ba0208012b8..cf005826448 100644 --- a/src/panfrost/compiler/bifrost_nir.h +++ b/src/panfrost/compiler/bifrost_nir.h @@ -28,3 +28,4 @@ bool bifrost_nir_lower_algebraic_late(nir_shader *shader); bool bifrost_nir_lower_xfb(nir_shader *shader); bool bifrost_nir_opt_boolean_bitwise(nir_shader *shader); +bool bifrost_nir_lower_load_output(nir_shader *nir);