glsl2: Don't generate constructor functions for structures
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 1 Sep 2010 21:08:08 +0000 (14:08 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 2 Sep 2010 03:39:09 +0000 (20:39 -0700)
src/glsl/ast_to_hir.cpp
src/glsl/glsl_symbol_table.cpp

index 84aa6501c554a725990ec85d7e73e4997b108fc9..970ac0818e8933c2c68bbc81ee7f8a35b328ed4a 100644 (file)
@@ -2730,8 +2730,7 @@ ast_struct_specifier::hir(exec_list *instructions,
       glsl_type::get_record_instance(fields, decl_count, name);
 
    YYLTYPE loc = this->get_location();
-   ir_function *ctor = t->generate_constructor();
-   if (!state->symbols->add_type(name, t, ctor)) {
+   if (!state->symbols->add_type(name, t)) {
       _mesa_glsl_error(& loc, state, "struct `%s' previously defined", name);
    } else {
 
index ed71244cbf84a679cdcfb0f6e71e6bcb7148d9f4..c71f3f830c34da19a39dc897108a03b5cf7af189 100644 (file)
@@ -127,7 +127,7 @@ bool glsl_symbol_table::add_function(const char *name, ir_function *f)
    if (this->language_version == 110 && name_declared_this_scope(name)) {
       /* In 1.10, functions and variables have separate namespaces. */
       symbol_table_entry *existing = get_entry(name);
-      if (existing->f == NULL) {
+      if ((existing->f == NULL) && (existing->t == NULL)) {
         existing->f = f;
         return true;
       }