Mesa (master): glsl: use the is_gl_identifier() helper in a couple more places
Brian Paul
brianp at kemper.freedesktop.org
Mon Jan 5 20:55:01 UTC 2015
Module: Mesa
Branch: master
Commit: a6822e31355b46be1cdf956f58bd2c7a4cd387f2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a6822e31355b46be1cdf956f58bd2c7a4cd387f2
Author: Brian Paul <brianp at vmware.com>
Date: Fri Jan 2 16:19:48 2015 -0700
glsl: use the is_gl_identifier() helper in a couple more places
Reviewed-by: Eric Anholt <eric at anholt.net>
---
src/glsl/ir_validate.cpp | 2 +-
src/glsl/opt_dead_builtin_variables.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 5a6f8bb..6d56339 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -706,7 +706,7 @@ ir_validate::visit(ir_variable *ir)
}
if (ir->data.mode == ir_var_uniform
- && strncmp(ir->name, "gl_", 3) == 0
+ && is_gl_identifier(ir->name)
&& ir->get_state_slots() == NULL) {
printf("built-in uniform has no state\n");
ir->print();
diff --git a/src/glsl/opt_dead_builtin_variables.cpp b/src/glsl/opt_dead_builtin_variables.cpp
index 85c75d6..0d4e3a8 100644
--- a/src/glsl/opt_dead_builtin_variables.cpp
+++ b/src/glsl/opt_dead_builtin_variables.cpp
@@ -52,7 +52,7 @@ optimize_dead_builtin_variables(exec_list *instructions,
&& var->data.how_declared != ir_var_declared_implicitly)
continue;
- if (strncmp(var->name, "gl_", 3) != 0)
+ if (!is_gl_identifier(var->name))
continue;
/* gl_ModelViewProjectionMatrix and gl_Vertex are special because they
More information about the mesa-commit
mailing list