From e3d5d13d6d642c5eba81f9848237b1cb08ae97da Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 12 May 2026 10:20:34 -0400 Subject: [PATCH] pan/bi: Use LOD_MODE_EXPLICIT for the 2nd half of textureGrad() on Bifrost textureGrad() has to be split into two halves on Mali: Computing the gradient/LOD and doing the actual texture operation. On Valhal, we do this with LOD_MODE_GRDESC but on Bifrost, we use LOD_MOD_EXPLICIT. When converting to NIR, I missed this. Fixes: 05a066c921e8 ("pan/nir: Add bifrost support to pan_nir_lower_tex()") Part-of: --- src/panfrost/compiler/pan_nir_lower_tex.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/panfrost/compiler/pan_nir_lower_tex.c b/src/panfrost/compiler/pan_nir_lower_tex.c index 0921795269e..c349ec86241 100644 --- a/src/panfrost/compiler/pan_nir_lower_tex.c +++ b/src/panfrost/compiler/pan_nir_lower_tex.c @@ -565,12 +565,11 @@ bi_lower_tex(nir_builder *b, nir_tex_instr *tex, uint64_t gpu_id) desc.lod_or_fetch = BIFROST_LOD_MODE_BIAS; sr[BI_TEX_SR_LOD] = build_lod_bias_clamp(b, srcs.bias, srcs.min_lod); } else if (srcs.ddx || srcs.ddy) { - desc.lod_or_fetch = BIFROST_LOD_MODE_GRDESC; + desc.lod_or_fetch = BIFROST_LOD_MODE_EXPLICIT; nir_def *grdesc = build_bi_gradient_desc(b, srcs.tex_h, srcs.samp_h, tex->sampler_dim, srcs.ddx, srcs.ddy); - sr[BI_TEX_SR_GRDESC0] = nir_channel(b, grdesc, 0); - sr[BI_TEX_SR_GRDESC1] = nir_channel(b, grdesc, 1); + sr[BI_TEX_SR_LOD] = nir_channel(b, grdesc, 0); } else { desc.lod_or_fetch = BIFROST_LOD_MODE_COMPUTE; }