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/ir.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/glsl/ir.h') diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 3a643fc580..c73bf4ce8b 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -1268,6 +1268,8 @@ public: unsigned get_uint_component(unsigned i) const; /*@}*/ + ir_constant *get_array_element(unsigned i) const; + ir_constant *get_record_field(const char *name); /** @@ -1284,6 +1286,10 @@ public: */ union ir_constant_data value; + /* Array elements */ + ir_constant **array_elements; + + /* Structure fields */ exec_list components; private: -- cgit v1.2.3