summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2019-12-11 16:01:15 +0100
committerKarol Herbst <[email protected]>2019-12-21 11:00:16 +0000
commitc83b1a4560284153e78bbd836556340356dc30fb (patch)
tree641c33b7621e30e04159ca39012e191ef433a579
parente6b2af56cb037e3174d049478e0ad7c7715780e4 (diff)
nir/serialize: cast swizzle before shifting
fixes undefined behaviour with enabled vec16 Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r--src/compiler/nir/nir_serialize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c
index 49a353d4e10..b991b1d02e2 100644
--- a/src/compiler/nir/nir_serialize.c
+++ b/src/compiler/nir/nir_serialize.c
@@ -879,7 +879,7 @@ write_alu(write_ctx *ctx, const nir_alu_instr *alu)
unsigned value = 0;
for (unsigned j = 0; j < 8 && o + j < src_channels; j++) {
- value |= alu->src[i].swizzle[o + j] <<
+ value |= (uint32_t)alu->src[i].swizzle[o + j] <<
(4 * j); /* 4 bits per swizzle */
}