summaryrefslogtreecommitdiffstats
path: root/src/broadcom/compiler/nir_to_vir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-11-21 16:32:33 -0800
committerEric Anholt <[email protected]>2017-11-22 10:56:31 -0800
commit6a78416dabdf0b7b80471dd0c636164c8f4012e0 (patch)
treedb95538b434d7e66e87588d42be86db1fdd5344a /src/broadcom/compiler/nir_to_vir.c
parentc55813c22e2099d59dbff81b9202b5ce70926e45 (diff)
broadcom/vc5: Fix BASE_LEVEL handling with txl.
The HW doesn't add the base level anywhere (the min/max lod clamping is what does base level), so we need to add it manually in this case. Fixes piglit tex-miplevel-selection *Lod 2D.
Diffstat (limited to 'src/broadcom/compiler/nir_to_vir.c')
-rw-r--r--src/broadcom/compiler/nir_to_vir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c
index 879704aeeed..7a31e242d11 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -380,9 +380,11 @@ ntq_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
p0_unpacked.bias_supplied = true;
break;
case nir_tex_src_lod:
- /* XXX: Needs base level addition */
coords[next_coord++] =
- ntq_get_src(c, instr->src[i].src, 0);
+ vir_FADD(c,
+ ntq_get_src(c, instr->src[i].src, 0),
+ vir_uniform(c, QUNIFORM_TEXTURE_FIRST_LEVEL,
+ unit));
if (instr->op != nir_texop_txf &&
instr->op != nir_texop_tg4) {