summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_to_ssa.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2014-12-12 20:37:04 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2015-01-15 07:20:21 -0800
commitb3fd098e7daa491637d66d03366b67c989937a1f (patch)
tree000f2453d4fe1d914008a484811c1c672589d3c8 /src/glsl/nir/nir_to_ssa.c
parent295faf9462cba88250d8581f65611996eba5e389 (diff)
nir: Make bcsel a fully vector operation
Previously, the condition was a scalar that applied to all components simultaneously. As of this commit, the condition is a vector and each component is switched seperately. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Diffstat (limited to 'src/glsl/nir/nir_to_ssa.c')
-rw-r--r--src/glsl/nir/nir_to_ssa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_to_ssa.c b/src/glsl/nir/nir_to_ssa.c
index 7fdae493887..6b6a0779a6d 100644
--- a/src/glsl/nir/nir_to_ssa.c
+++ b/src/glsl/nir/nir_to_ssa.c
@@ -235,6 +235,8 @@ rewrite_def_forwards(nir_dest *dest, void *_state)
csel->dest.dest.reg.reg = dest->reg.reg;
csel->dest.write_mask = (1 << dest->reg.reg->num_components) - 1;
csel->src[0].src = nir_src_copy(*state->predicate, state->mem_ctx);
+ /* Splat the condition to all channels */
+ memset(csel->src[0].swizzle, 0, sizeof csel->src[0].swizzle);
csel->src[2].src.is_ssa = true;
csel->src[2].src.ssa = get_ssa_src(dest->reg.reg, state);
}