nir/fold_16bit_tex_image: Default to only_fold_all.
authorGeorg Lehmann <dadschoorse@gmail.com>
Tue, 26 Jul 2022 18:14:34 +0000 (20:14 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 27 Jul 2022 18:57:12 +0000 (18:57 +0000)
No driver doesn't use this option.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17757>

src/amd/vulkan/radv_pipeline.c
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_mediump.c
src/freedreno/ir3/ir3_nir.c
src/gallium/drivers/radeonsi/si_shader_nir.c

index f3a8d0c..5be524e 100644 (file)
@@ -4896,12 +4896,10 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout
                                (1 << nir_tex_src_bias) | (1 << nir_tex_src_min_lod) |
                                (1 << nir_tex_src_ms_index) |
                                (separate_g16 ? 0 : (1 << nir_tex_src_ddx) | (1 << nir_tex_src_ddy)),
-                  .only_fold_all = true,
                },
                {
                   .sampler_dims = ~BITFIELD_BIT(GLSL_SAMPLER_DIM_CUBE),
                   .src_types = (1 << nir_tex_src_ddx) | (1 << nir_tex_src_ddy),
-                  .only_fold_all = true,
                },
             };
             struct nir_fold_16bit_tex_image_options fold_16bit_options = {
index 6ebad48..d07b2b1 100644 (file)
@@ -5350,7 +5350,6 @@ bool nir_unpack_16bit_varying_slots(nir_shader *nir, nir_variable_mode modes);
 struct nir_fold_tex_srcs_options {
    unsigned sampler_dims;
    unsigned src_types;
-   bool only_fold_all; /* Only fold sources if all of them can be folded. */
 };
 
 struct nir_fold_16bit_tex_image_options {
index 7a89827..cd6ca19 100644 (file)
@@ -707,10 +707,10 @@ fold_16bit_tex_srcs(nir_builder *b, nir_tex_instr *tex,
        * because it's out of bounds and the higher bits don't
        * matter.
        */
-      if (can_fold_16bit_src(src->ssa, src_type, false))
-         fold_srcs |= (1 << i);
-      else if (options->only_fold_all)
+      if (!can_fold_16bit_src(src->ssa, src_type, false))
          return false;
+
+      fold_srcs |= (1 << i);
    }
 
    u_foreach_bit(i, fold_srcs) {
index c7f5b48..98d516f 100644 (file)
@@ -782,7 +782,6 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
                          (1 << nir_tex_src_ms_index) |
                          (1 << nir_tex_src_ddx) |
                          (1 << nir_tex_src_ddy),
-            .only_fold_all = true,
          };
          struct nir_fold_16bit_tex_image_options fold_16bit_options = {
             .rounding_mode = nir_rounding_mode_rtz,
index 6776bff..a04614a 100644 (file)
@@ -179,12 +179,10 @@ static void si_late_optimize_16bit_samplers(struct si_screen *sscreen, nir_shade
                       (1 << nir_tex_src_bias) | (1 << nir_tex_src_min_lod) |
                       (1 << nir_tex_src_ms_index) |
                       (has_g16 ? 0 : (1 << nir_tex_src_ddx) | (1 << nir_tex_src_ddy)),
-         .only_fold_all = true,
       },
       {
          .sampler_dims = ~BITFIELD_BIT(GLSL_SAMPLER_DIM_CUBE),
          .src_types = (1 << nir_tex_src_ddx) | (1 << nir_tex_src_ddy),
-         .only_fold_all = true,
       },
    };
    struct nir_fold_16bit_tex_image_options fold_16bit_options = {