From a096fa747611472965cf0f953bfe2757fc80383c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 20 Jul 2010 01:31:29 -0700 Subject: ir_constant_expression: Add support for constant arrays. Fixes piglit test const-array-02.frag. --- src/glsl/ir_constant_expression.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index acfbb864597..d72a57c66ab 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -712,7 +712,8 @@ ir_dereference_array::constant_expression_value() return new(ctx) ir_constant(array, component); } else { - /* FINISHME: Handle access of constant arrays. */ + const unsigned index = idx->value.u[0]; + return array->get_array_element(index)->clone(NULL); } } return NULL; -- cgit v1.2.3