summaryrefslogtreecommitdiff
path: root/glsl_types.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-21 12:13:48 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-28 18:22:54 -0700
commit8bec5e92e09c56e893cea33a44b0fb5a2ba1b283 (patch)
treed5bec06944fbc33f8e1a600513ba76b8305d5843 /glsl_types.cpp
parentae000fcb2e47a88d507a616709ae42d4aefae7a0 (diff)
Support structures in glsl_type::generate_constructor_prototype
Diffstat (limited to 'glsl_types.cpp')
-rw-r--r--glsl_types.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/glsl_types.cpp b/glsl_types.cpp
index 71d7dd36f8..720dce79a1 100644
--- a/glsl_types.cpp
+++ b/glsl_types.cpp
@@ -135,9 +135,6 @@ const glsl_type *glsl_type::get_base_type() const
ir_function *
glsl_type::generate_constructor_prototype(glsl_symbol_table *symtab) const
{
- /* FINISHME: Add support for non-array types. */
- assert(base_type == GLSL_TYPE_ARRAY);
-
/* Generate the function name and add it to the symbol table.
*/
ir_function *const f = new ir_function(name);
@@ -153,7 +150,9 @@ glsl_type::generate_constructor_prototype(glsl_symbol_table *symtab) const
snprintf(param_name, 10, "p%08X", i);
- ir_variable *var = new ir_variable(fields.array, param_name);
+ ir_variable *var = (this->base_type == GLSL_TYPE_ARRAY)
+ ? new ir_variable(fields.array, param_name)
+ : new ir_variable(fields.structure[i].type, param_name);
var->mode = ir_var_in;
sig->parameters.push_tail(var);