mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
glsl: Perform type checking on "^^" operands.
We were letting any old operand through, which generally resulted in
assertion failures later.
Fixes array-logical-xor.vert.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 756c262756)
This commit is contained in:
parent
1d779672fa
commit
e78908d152
1 changed files with 10 additions and 3 deletions
|
|
@ -1192,9 +1192,16 @@ ast_expression::hir(exec_list *instructions,
|
|||
}
|
||||
|
||||
case ast_logic_xor:
|
||||
op[0] = this->subexpressions[0]->hir(instructions, state);
|
||||
op[1] = this->subexpressions[1]->hir(instructions, state);
|
||||
|
||||
/* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec:
|
||||
*
|
||||
* "The logical binary operators and (&&), or ( | | ), and
|
||||
* exclusive or (^^). They operate only on two Boolean
|
||||
* expressions and result in a Boolean expression."
|
||||
*/
|
||||
op[0] = get_scalar_boolean_operand(instructions, state, this, 0, "LHS",
|
||||
&error_emitted);
|
||||
op[1] = get_scalar_boolean_operand(instructions, state, this, 1, "RHS",
|
||||
&error_emitted);
|
||||
|
||||
result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type,
|
||||
op[0], op[1]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue