From 1c00172eec8e6c1d37821720cee63fed727718ad Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Mon, 16 Feb 2026 13:23:07 +0100 Subject: [PATCH] r600: update r600 nir for sample_lz and sample_c_lz This change enables the generation of the opcodes. Signed-off-by: Patrick Lerda Part-of: --- src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp b/src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp index 53d4730eec7..65ff403e055 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp @@ -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);