From 74e1802f5dd8921750851abc6128e4073602d405 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 20 Jul 2010 01:06:33 -0700 Subject: glsl2: Extend ir_constant to store constant arrays, and generate them. Since GLSL permits arrays of structures, we need to store each element as an ir_constant*, not just ir_constant_data. Fixes parser tests const-array-01.frag, const-array-03.frag, const-array-04.frag, const-array-05.frag, though 03 and 04 generate the wrong code. --- src/glsl/ast_function.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/glsl/ast_function.cpp') diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index 1982c83a430..855f27f1756 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -358,9 +358,8 @@ process_array_constructor(exec_list *instructions, ir->replace_with(result); } - if (all_parameters_are_constant) { - /* FINISHME: Add support for generating constant arrays. */ - } + if (all_parameters_are_constant) + return new(ctx) ir_constant(constructor_type, &actual_parameters); ir_variable *var = new(ctx) ir_variable(constructor_type, "array_ctor", ir_var_temporary); -- cgit v1.2.3