mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 23:00:11 +01:00
glsl: Fix ir validation for bit logic ops
In ir_validate::visit_leave(), the cases for
- ir_binop_bit_and
- ir_binop_bit_xor
- ir_binop_bit_or
were incorrect. It was incorrectly asserted that both operands must be the
same type, when in fact one may be scalar and the other a vector. It was also
incorrectly asserted that the resultant type was the type of the left operand,
which in fact does not hold when the left operand is a scalar and the right
operand is a vector.
This commit is contained in:
parent
4761d0d22b
commit
e2c1fe3eb0
1 changed files with 9 additions and 5 deletions
|
|
@ -347,11 +347,15 @@ ir_validate::visit_leave(ir_expression *ir)
|
|||
case ir_binop_bit_and:
|
||||
case ir_binop_bit_xor:
|
||||
case ir_binop_bit_or:
|
||||
assert(ir->operands[0]->type == ir->operands[1]->type);
|
||||
assert(ir->type == ir->operands[0]->type);
|
||||
assert(ir->type->base_type == GLSL_TYPE_INT ||
|
||||
ir->type->base_type == GLSL_TYPE_UINT);
|
||||
break;
|
||||
assert(ir->operands[0]->type->base_type ==
|
||||
ir->operands[1]->type->base_type);
|
||||
assert(ir->type->is_integer());
|
||||
if (ir->operands[0]->type->is_vector() &&
|
||||
ir->operands[1]->type->is_vector()) {
|
||||
assert(ir->operands[0]->type->vector_elements ==
|
||||
ir->operands[1]->type->vector_elements);
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_binop_logic_and:
|
||||
case ir_binop_logic_xor:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue