freedreno/ir3: Move lower_idiv_options
authorRob Clark <robdclark@chromium.org>
Sun, 22 Aug 2021 15:27:54 +0000 (08:27 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 Oct 2021 18:59:57 +0000 (18:59 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>

src/freedreno/ir3/ir3_nir.c

index 30c07ae..885d4a5 100644 (file)
@@ -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);