glsl: Fix ir_quadop_vector validation

Some glcts tests have failed due to incorrect processing of `ir_quadop_vector` in
`ir_validation`. e.g:
`GLES31.functional.shaders.builtin_functions.integer.imulextended.int_highp_geometry`

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6461
Fixes: 23cde71b ("glsl: Stop lowering ir_quadop_vector.")

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16420>
This commit is contained in:
Michael Skorokhodov 2022-05-10 10:48:53 +03:00 committed by Marge Bot
parent 96a240e176
commit fd75be7986
1 changed files with 7 additions and 1 deletions

View File

@ -942,8 +942,14 @@ ir_validate::visit_leave(ir_expression *ir)
* - Number of operands must matche the size of the resulting vector.
* - Base type of the operands must match the base type of the result.
*/
assert(ir->type->is_vector());
switch (ir->type->vector_elements) {
case 1:
assert(ir->operands[0]->type->is_scalar());
assert(ir->operands[0]->type->base_type == ir->type->base_type);
assert(ir->operands[1] == NULL);
assert(ir->operands[2] == NULL);
assert(ir->operands[3] == NULL);
break;
case 2:
assert(ir->operands[0]->type->is_scalar());
assert(ir->operands[0]->type->base_type == ir->type->base_type);