r600/sfn: fix cube to array lowering for LOD

Makes piglits related to texturequerylod and samplercubearray pass.

Fixes: 79ca456b48 ("r600/sfn: rewrite NIR backend")
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22883>
(cherry picked from commit 1ae09f3eff)
This commit is contained in:
Gert Wollny 2023-05-06 09:24:42 +02:00 committed by Dylan Baker
parent cdbd62c4a1
commit 68da75ebf9
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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);