r600: update r600 nir for sample_lz and sample_c_lz

This change enables the generation of the opcodes.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39915>
This commit is contained in:
Patrick Lerda 2026-02-16 13:23:07 +01:00 committed by Marge Bot
parent 19a22b9382
commit 1c00172eec

View file

@ -138,6 +138,12 @@ lower_txl_txf_array_or_cube(nir_builder *b, nir_tex_instr *tex)
int min_lod_idx = nir_tex_instr_src_index(tex, nir_tex_src_min_lod);
assert(lod_idx >= 0 || bias_idx >= 0);
/* Check if sample_lz or sample_c_lz could handle this */
if (unlikely(lod_idx >= 0 && bias_idx < 0 && min_lod_idx < 0 &&
nir_src_is_const(tex->src[lod_idx].src) &&
nir_src_as_uint(tex->src[lod_idx].src) == 0))
return false;
nir_def *size = nir_i2f32(b, nir_get_texture_size(b, tex));
nir_def *lod = (lod_idx >= 0) ? tex->src[lod_idx].src.ssa
: nir_get_texture_lod(b, tex);