diff options
author | Connor Abbott <[email protected]> | 2015-08-04 14:04:34 -0700 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2015-11-19 09:16:18 +0100 |
commit | 7820b2c071ec974d824c9b6dc3a0dd0ad1b77444 (patch) | |
tree | b433a42f625808592893a576a86e511ca6203991 | |
parent | 1cfffb95ebf49a8342d4799e68ecc0009300cb2f (diff) |
nir: fix constant folding of bfi
Reviewed-by: Edward O'Callaghan <[email protected]>
-rw-r--r-- | src/glsl/nir/nir_opcodes.py | 4 |
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); } """) |