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: 05a066c921 ("pan/nir: Add bifrost support to pan_nir_lower_tex()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41513>
This commit is contained in:
Faith Ekstrand 2026-05-12 10:20:34 -04:00 committed by Marge Bot
parent 804ff19a5a
commit e3d5d13d6d

View file

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