From 68da75ebf9740b136149ba9f74e21e09321a447d 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: (cherry picked from commit 1ae09f3effd2f1353dc92f5b64428d479e1c9596) --- .pick_status.json | 2 +- src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index c6442eb6766..ff10adc9a90 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5704,7 +5704,7 @@ "description": "r600/sfn: fix cube to array lowering for LOD", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "79ca456b4837b3bc21cf9ef3c03c505c4b4909f6", "notes": null 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);