summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-03-07 03:24:25 +0000
committerDave Airlie <airlied@redhat.com>2018-03-07 03:34:59 +0000
commitfb077b072823ecb193f4494daeceddf0f21aede2 (patch)
treef925876aea03d8c0d2962ca12158305e903e2d43
parent38e91e2b81104795283d41a6694568138d575540 (diff)
ac/nir: don't put lod into args if it's zero.
If it's zero but put it in args we still end up consuming a register for it. This fixes some spilling in the NIR paths in Dirt Rally that isn't seen with TGSI. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/amd/common/ac_nir_to_llvm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index ea51c3a54a9..cca796de71b 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -5070,8 +5070,7 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
}
/* Pack LOD */
- if (lod && ((instr->op == nir_texop_txl && !lod_is_zero) ||
- instr->op == nir_texop_txf)) {
+ if (lod && ((instr->op == nir_texop_txl || instr->op == nir_texop_txf) && !lod_is_zero)) {
address[count++] = lod;
} else if (instr->op == nir_texop_txf_ms && sample_index) {
address[count++] = sample_index;