Mesa (main): glsl: Fix ir_quadop_vector validation
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed May 11 01:29:16 UTC 2022
Module: Mesa
Branch: main
Commit: fd75be798627df9a647205994a11a3cdf1d718b9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd75be798627df9a647205994a11a3cdf1d718b9
Author: Michael Skorokhodov <mykhailo.skorokhodov at globallogic.com>
Date: Tue May 10 10:48:53 2022 +0300
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 at anholt.net>
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov at globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16420>
---
src/compiler/glsl/ir_validate.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/ir_validate.cpp b/src/compiler/glsl/ir_validate.cpp
index c60c36cd260..89feaa7fcb5 100644
--- a/src/compiler/glsl/ir_validate.cpp
+++ b/src/compiler/glsl/ir_validate.cpp
@@ -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);
More information about the mesa-commit
mailing list