summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/tests
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-01-13 11:08:37 -0800
committerMatt Turner <[email protected]>2016-01-14 09:27:52 -0800
commit15640ee77ae601cba33cbbc72256e55e03a363e5 (patch)
treef161a4234ea165daa59f97e8e7bde9373086bbd1 /src/glsl/nir/tests
parent6470435190ffd9b82ab53da7e857186b9b322516 (diff)
nir: Handle <bits>=32 case in bitfield_insert lowering.
The OpenGL specifications for bitfieldInsert() says: The result will be undefined if <offset> or <bits> is negative, or if the sum of <offset> and <bits> is greater than the number of bits used to store the operand. Therefore passing bits=32, offset=0 is legal and defined in GLSL. But the earlier SM5 bfi opcode is specified to accept a bitfield width ranging from 0-31. As such, Intel and AMD instructions read only the low 5 bits of the width operand, making them not able to implement the GLSL-specified behavior directly. This commit fixes the lowering of bitfield_insert to handle the trivial case of <bits> = 32 as bitfieldInsert: bits > 31 ? insert : bfi(bfm(bits, offset), insert, base) Fixes: ES31-CTS.shader_bitfield_operation.bitfieldInsert.uint_2 ES31-CTS.shader_bitfield_operation.bitfieldInsert.uvec4_3 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92595 Reviewed-by: Connor Abbott <[email protected]> Tested-by: Marta Lofstedt <[email protected]>
Diffstat (limited to 'src/glsl/nir/tests')
0 files changed, 0 insertions, 0 deletions