mesa: glsl: mark constructor params as const
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 23 Jul 2008 18:00:48 +0000 (12:00 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 29 Jul 2008 23:20:43 +0000 (17:20 -0600)
src/mesa/shader/slang/slang_codegen.c

index a98232e3085af7397c2bafe5754f34ecfa03b6b7..77ded1e4ab91e29f4cfa45f2609f5a7af72698ed 100644 (file)
@@ -1732,7 +1732,8 @@ _slang_make_constructor(slang_assemble_ctx *A, slang_struct *str)
          printf("Field %d: %s\n", i, (char*) str->fields->variables[i]->a_name);
          */
          slang_variable *p = slang_variable_scope_grow(fun->parameters);
-         *p = *str->fields->variables[i];
+         *p = *str->fields->variables[i]; /* copy the type */
+         p->type.qualifier = SLANG_QUAL_CONST;
       }
       fun->param_count = fun->parameters->num_variables;
    }