aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_symbol_table.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-16 11:30:08 +0200
committermarha <marha@users.sourceforge.net>2013-10-16 11:30:08 +0200
commit56e12b1310b1b52d00bc27e919d915255af5bf03 (patch)
tree19379a18fe9a678a109397837339820892101e4b /mesalib/src/glsl/glsl_symbol_table.cpp
parentc5883f8af060c0a300a29e732e8bb893bc8e0eca (diff)
parent9e23b44bfe1e6e85231b1c07d945cadf0c868648 (diff)
downloadvcxsrv-56e12b1310b1b52d00bc27e919d915255af5bf03.tar.gz
vcxsrv-56e12b1310b1b52d00bc27e919d915255af5bf03.tar.bz2
vcxsrv-56e12b1310b1b52d00bc27e919d915255af5bf03.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libxcb libxcb/xcb-proto xserver mesa pixman xkbcomp git update 16 oct 2013 Conflicts: mesalib/src/mesa/drivers/dri/common/drisw_util.c pixman/pixman/pixman-mmx.c
Diffstat (limited to 'mesalib/src/glsl/glsl_symbol_table.cpp')
-rwxr-xr-xmesalib/src/glsl/glsl_symbol_table.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/mesalib/src/glsl/glsl_symbol_table.cpp b/mesalib/src/glsl/glsl_symbol_table.cpp
index 0eabc23d8..6ec4f534b 100755
--- a/mesalib/src/glsl/glsl_symbol_table.cpp
+++ b/mesalib/src/glsl/glsl_symbol_table.cpp
@@ -260,3 +260,18 @@ symbol_table_entry *glsl_symbol_table::get_entry(const char *name)
return (symbol_table_entry *)
_mesa_symbol_table_find_symbol(table, -1, name);
}
+
+void
+glsl_symbol_table::disable_variable(const char *name)
+{
+ /* Ideally we would remove the variable's entry from the symbol table, but
+ * that would be difficult. Fortunately, since this is only used for
+ * built-in variables, it won't be possible for the shader to re-introduce
+ * the variable later, so all we really need to do is to make sure that
+ * further attempts to access it using get_variable() will return NULL.
+ */
+ symbol_table_entry *entry = get_entry(name);
+ if (entry != NULL) {
+ entry->v = NULL;
+ }
+}