From 0922a0dd50b06ffef0e501fef384d49cbf2e196a Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 21 Sep 2025 16:09:13 +0300 Subject: [PATCH] nir/lower_tex: remove unused options Signed-off-by: Lionel Landwerlin Reviewed-by: Alyssa Anne Rosenzweig Part-of: --- src/compiler/nir/nir.h | 24 ------------------------ src/compiler/nir/nir_lower_tex.c | 27 --------------------------- 2 files changed, 51 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index ed97aa6851e..3a3f1dc76aa 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5766,36 +5766,12 @@ typedef struct nir_lower_tex_options { */ bool lower_txb_shadow_clamp; - /** - * If true, lower nir_texop_txd on shadow samplers when it uses min_lod - * with nir_texop_txl. This includes cube maps. - */ - bool lower_txd_shadow_clamp; - - /** - * If true, lower nir_texop_txd on when it uses both offset and min_lod - * with nir_texop_txl. This includes cube maps. - */ - bool lower_txd_offset_clamp; - /** * A generic callback to nir_texop_txd. */ bool (*lower_txd_cb)(const nir_tex_instr *tex, const void *data); const void *lower_txd_data; - /** - * If true, lower nir_texop_txd with min_lod to a nir_texop_txl if the - * sampler is bindless. - */ - bool lower_txd_clamp_bindless_sampler; - - /** - * If true, lower nir_texop_txd with min_lod to a nir_texop_txl if the - * sampler index is not statically determinable to be less than 16. - */ - bool lower_txd_clamp_if_sampler_index_not_lt_16; - /** * If true, lower nir_texop_txs with a non-0-lod into nir_texop_txs with * 0-lod followed by a nir_ishr. diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index 48061326219..407c09758aa 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -1229,25 +1229,6 @@ lower_tex_packing(nir_builder *b, nir_tex_instr *tex, return true; } -static bool -sampler_index_lt(nir_tex_instr *tex, unsigned max) -{ - assert(nir_tex_instr_src_index(tex, nir_tex_src_sampler_deref) == -1); - - unsigned sampler_index = tex->sampler_index; - - int sampler_offset_idx = - nir_tex_instr_src_index(tex, nir_tex_src_sampler_offset); - if (sampler_offset_idx >= 0) { - if (!nir_src_is_const(tex->src[sampler_offset_idx].src)) - return false; - - sampler_index += nir_src_as_uint(tex->src[sampler_offset_idx].src); - } - - return sampler_index < max; -} - static bool lower_tg4_offsets(nir_builder *b, nir_tex_instr *tex) { @@ -1715,8 +1696,6 @@ nir_lower_tex_block(nir_block *block, nir_builder *b, const bool has_min_lod = nir_tex_instr_src_index(tex, nir_tex_src_min_lod) >= 0; - const bool has_offset = - nir_tex_instr_src_index(tex, nir_tex_src_offset) >= 0; if (tex->op == nir_texop_txb && tex->is_shadow && has_min_lod && options->lower_txb_shadow_clamp) { @@ -1742,12 +1721,6 @@ nir_lower_tex_block(nir_block *block, nir_builder *b, (options->lower_txd || (options->lower_txd_clamp && has_min_lod) || (options->lower_txd_shadow && tex->is_shadow) || - (options->lower_txd_shadow_clamp && tex->is_shadow && has_min_lod) || - (options->lower_txd_offset_clamp && has_offset && has_min_lod) || - (options->lower_txd_clamp_bindless_sampler && has_min_lod && - nir_tex_instr_src_index(tex, nir_tex_src_sampler_handle) != -1) || - (options->lower_txd_clamp_if_sampler_index_not_lt_16 && - has_min_lod && !sampler_index_lt(tex, 16)) || (options->lower_txd_cube_map && tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE) || (options->lower_txd_3d &&