diff options
Diffstat (limited to 'src/compiler/spirv/vtn_alu.c')
-rw-r--r-- | src/compiler/spirv/vtn_alu.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c index fa8f259a006..6bc015a096d 100644 --- a/src/compiler/spirv/vtn_alu.c +++ b/src/compiler/spirv/vtn_alu.c @@ -636,6 +636,21 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode, break; } + case SpvOpSignBitSet: { + unsigned src_bit_size = glsl_get_bit_size(vtn_src[0]->type); + if (src[0]->num_components == 1) + val->ssa->def = + nir_ushr(&b->nb, src[0], nir_imm_int(&b->nb, src_bit_size - 1)); + else + val->ssa->def = + nir_ishr(&b->nb, src[0], nir_imm_int(&b->nb, src_bit_size - 1)); + + if (src_bit_size != 32) + val->ssa->def = nir_u2u32(&b->nb, val->ssa->def); + + break; + } + default: { bool swap; unsigned src_bit_size = glsl_get_bit_size(vtn_src[0]->type); |