glsl: Add basic ARB_gpu_shader_int64 types
[mesa.git] / src / mesa / program / symbol_table.c
index 23cb7ec26b1fcbd55972d5415c4d8ed36ebf6bca..37066c904cc91c42866c0af45f78732a8f76a8df 100644 (file)
@@ -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,