diff options
-rw-r--r-- | src/compiler/glsl/glsl_symbol_table.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/glsl/glsl_symbol_table.cpp b/src/compiler/glsl/glsl_symbol_table.cpp index 3162bb685df..15e819eacc6 100644 --- a/src/compiler/glsl/glsl_symbol_table.cpp +++ b/src/compiler/glsl/glsl_symbol_table.cpp @@ -213,7 +213,10 @@ bool glsl_symbol_table::add_default_precision_qualifier(const char *type_name, symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(default_specifier); - return _mesa_symbol_table_add_symbol(table, name, entry) == 0; + if (!get_entry(name)) + return _mesa_symbol_table_add_symbol(table, name, entry) == 0; + + return _mesa_symbol_table_replace_symbol(table, name, entry) == 0; } void glsl_symbol_table::add_global_function(ir_function *f) |