diff options
author | Kenneth Graunke <[email protected]> | 2016-01-07 16:01:51 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2016-01-13 10:35:12 -0800 |
commit | 84d6130c21a8a570efefe54aa723f549b34c3256 (patch) | |
tree | cdbcc4a92e22d368064449a48066d652c20c0270 /src/glsl/nir | |
parent | b4e198f47f8423dfb101395cd6cb5a11fa12954e (diff) |
glsl, nir: Make ir_triop_bitfield_extract a vectorized operation.
We would like to be able to combine
result.x = bitfieldExtract(src0.x, src1.x, src2.x);
result.y = bitfieldExtract(src0.y, src1.y, src2.y);
result.z = bitfieldExtract(src0.z, src1.z, src2.z);
result.w = bitfieldExtract(src0.w, src1.w, src2.w);
into a single ivec4 bitfieldInsert operation. This should be possible
with most drivers.
This patch changes the offset and bits parameters from scalar ints
to ivecN or uvecN. The type of all three operands will be the same,
for simplicity.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/glsl/nir')
-rw-r--r-- | src/glsl/nir/nir_opcodes.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py index 3780628d1ea..855095f1f35 100644 --- a/src/glsl/nir/nir_opcodes.py +++ b/src/glsl/nir/nir_opcodes.py @@ -570,9 +570,9 @@ if (mask == 0) { """) opcode("ubitfield_extract", 0, tuint, - [0, 1, 1], [tuint, tint, tint], "", """ + [0, 0, 0], [tuint, tint, tint], "", """ unsigned base = src0; -int offset = src1.x, bits = src2.x; +int offset = src1, bits = src2; if (bits == 0) { dst = 0; } else if (bits < 0 || offset < 0 || offset + bits > 32) { @@ -582,9 +582,9 @@ if (bits == 0) { } """) opcode("ibitfield_extract", 0, tint, - [0, 1, 1], [tint, tint, tint], "", """ + [0, 0, 0], [tint, tint, tint], "", """ int base = src0; -int offset = src1.x, bits = src2.x; +int offset = src1, bits = src2; if (bits == 0) { dst = 0; } else if (offset < 0 || bits < 0 || offset + bits > 32) { |