aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2015-08-04 14:04:34 -0700
committerIago Toral Quiroga <[email protected]>2015-11-19 09:16:18 +0100
commit7820b2c071ec974d824c9b6dc3a0dd0ad1b77444 (patch)
treeb433a42f625808592893a576a86e511ca6203991 /src/glsl
parent1cfffb95ebf49a8342d4799e68ecc0009300cb2f (diff)
nir: fix constant folding of bfi
Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/nir_opcodes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
index 3c0f1da94af..729f695cf9c 100644
--- a/src/glsl/nir/nir_opcodes.py
+++ b/src/glsl/nir/nir_opcodes.py
@@ -563,7 +563,7 @@ opcode("bcsel", 0, tunsigned, [0, 0, 0],
[tbool, tunsigned, tunsigned], "", "src0 ? src1 : src2")
triop("bfi", tunsigned, """
-unsigned mask = src0, insert = src1 & mask, base = src2;
+unsigned mask = src0, insert = src1, base = src2;
if (mask == 0) {
dst = base;
} else {
@@ -572,7 +572,7 @@ if (mask == 0) {
tmp >>= 1;
insert <<= 1;
}
- dst = (base & ~mask) | insert;
+ dst = (base & ~mask) | (insert & mask);
}
""")