summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-05-17 23:16:14 -0700
committerKenneth Graunke <[email protected]>2016-05-20 14:29:04 -0700
commit287f099db170132518b75142de8580fd252fde45 (patch)
treeb8bb08a56b1587cd0c815087ce7b05a7adec8531 /src/compiler
parent7fe9a19302b8953cb267f3a1876543ad6aef8177 (diff)
nir: Fix fddy swizzles in nir_lower_wpos_ytransform().
The original value might have been swizzled. That's taken care of in the fmul source - we don't want to reswizzle it again. Fixes validation failures in glsl-derivs-varyings on a branch of mine which uses this pass in i965. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_wpos_ytransform.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c b/src/compiler/nir/nir_lower_wpos_ytransform.c
index 5546788f9fd..41f85544246 100644
--- a/src/compiler/nir/nir_lower_wpos_ytransform.c
+++ b/src/compiler/nir/nir_lower_wpos_ytransform.c
@@ -252,6 +252,9 @@ lower_fddy(lower_wpos_ytransform_state *state, nir_alu_instr *fddy)
nir_instr_rewrite_src(&fddy->instr,
&fddy->src[0].src,
nir_src_for_ssa(pt));
+
+ for (unsigned i = 0; i < 4; i++)
+ fddy->src[0].swizzle[i] = MIN2(i, pt->num_components - 1);
}
static bool