From 9a6d40fbfb679f01412c1fcc9d767c20a22246d8 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 20 Jul 2010 03:08:32 -0700 Subject: ir_constant_expression: Add support for array == and !=. Piglit parser tests const-array-03.frag and const-array-04.frag now generate the correct code. --- src/glsl/ir.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/glsl/ir.cpp') diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index d3f7302b54..5054ec725c 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -430,9 +430,14 @@ ir_constant::has_value(const ir_constant *c) const if (this->type != c->type) return false; - /* FINISHME: This will probably also handle constant arrays as soon as those - * FINISHME: are supported. - */ + if (this->type->is_array()) { + for (unsigned i = 0; i < this->type->length; i++) { + if (this->array_elements[i]->has_value(c->array_elements[i])) + return false; + } + return true; + } + if (this->type->base_type == GLSL_TYPE_STRUCT) { const exec_node *a_node = this->components.head; const exec_node *b_node = c->components.head; -- cgit v1.2.3