From 1ae09f3effd2f1353dc92f5b64428d479e1c9596 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sat, 6 May 2023 09:24:42 +0200 Subject: [PATCH] r600/sfn: fix cube to array lowering for LOD Makes piglits related to texturequerylod and samplercubearray pass. Fixes: 79ca456b4837 ("r600/sfn: rewrite NIR backend") Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c9ca3468852..daddf926a3d 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp @@ -274,7 +274,7 @@ r600_nir_lower_cube_to_2darray_impl(nir_builder *b, nir_instr *instr, void *_opt nir_imm_float(b, 1.5)); nir_ssa_def *z = nir_channel(b, cubed, 3); - if (tex->is_array) { + if (tex->is_array && tex->op != nir_texop_lod) { auto slice = nir_fround_even(b, nir_channel(b, tex->src[coord_idx].src.ssa, 3)); z = nir_fmad(b, nir_fmax(b, slice, nir_imm_float(b, 0.0)), nir_imm_float(b, 8.0), z);