diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c index 30c07aef57f..885d4a5ead6 100644 --- a/src/freedreno/ir3/ir3_nir.c +++ b/src/freedreno/ir3/ir3_nir.c @@ -503,11 +503,6 @@ ir3_nir_lower_subgroup_id_cs(nir_shader *shader) lower_subgroup_id, NULL); } -static const nir_lower_idiv_options idiv_options = { - .imprecise_32bit_lowering = true, - .allow_fp16 = true, -}; - /** * Late passes that need to be done after pscreen->finalize_nir() */ @@ -561,11 +556,16 @@ ir3_nir_post_finalize(struct ir3_compiler *compiler, nir_shader *s) */ OPT_V(s, ir3_nir_apply_trig_workarounds); - nir_lower_image_options lower_image_opts = { + const nir_lower_image_options lower_image_opts = { .lower_cube_size = true, }; NIR_PASS_V(s, nir_lower_image, &lower_image_opts); - NIR_PASS_V(s, nir_lower_idiv, &idiv_options); /* idiv generated by cube lowering */ + + const nir_lower_idiv_options lower_idiv_options = { + .imprecise_32bit_lowering = true, + .allow_fp16 = true, + }; + NIR_PASS_V(s, nir_lower_idiv, &lower_idiv_options); /* idiv generated by cube lowering */ if (compiler->gen >= 6) OPT_V(s, ir3_nir_lower_ssbo_size, compiler->storage_16bit);