From: Kenneth Graunke Date: Tue, 20 Jul 2010 08:31:29 +0000 (-0700) Subject: ir_constant_expression: Add support for constant arrays. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a096fa747611472965cf0f953bfe2757fc80383c;p=mesa.git ir_constant_expression: Add support for constant arrays. Fixes piglit test const-array-02.frag. --- 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;