nir/fold_16bit_tex_image: Default to only_fold_all.

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>
This commit is contained in:
Georg Lehmann 2022-07-26 20:14:34 +02:00 committed by Marge Bot
parent dd3e9be413
commit df4b5914cd
5 changed files with 3 additions and 9 deletions

View 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 = {

View 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 {

View 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) {

View 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,

View 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 = {