summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/symbol_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program/symbol_table.c')
-rw-r--r--src/mesa/program/symbol_table.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c
index 23cb7ec26b1..37066c904cc 100644
--- a/src/mesa/program/symbol_table.c
+++ b/src/mesa/program/symbol_table.c
@@ -211,6 +211,20 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table,
return 0;
}
+int
+_mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table,
+ const char *name,
+ void *declaration)
+{
+ struct symbol *sym = find_symbol(table, name);
+
+ /* If the symbol doesn't exist, it cannot be replaced. */
+ if (sym == NULL)
+ return -1;
+
+ sym->data = declaration;
+ return 0;
+}
int
_mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table,