From 9de7ea875d54cd38da37285bd0107fa6079c92ba Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 14 Apr 2025 13:22:31 -0400 Subject: [PATCH] nir: handle mismatched bias/lod bitsizes the sampler lod bias lowering uses fp16 for perf on AGX. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_lower_tex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index 3913d45c3c8..ecdb20e3c25 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -322,7 +322,7 @@ lower_lod(nir_builder *b, nir_tex_instr *tex, nir_def *lod) /* If we have a bias, add it in */ nir_def *bias = nir_steal_tex_src(tex, nir_tex_src_bias); if (bias) - lod = nir_fadd(b, lod, bias); + lod = nir_fadd(b, lod, nir_f2fN(b, bias, lod->bit_size)); /* If we have a minimum LOD, clamp LOD accordingly */ nir_def *min_lod = nir_steal_tex_src(tex, nir_tex_src_min_lod);