summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-05-23 14:57:49 -0600
committerBrian Paul <[email protected]>2014-05-28 15:06:07 -0600
commita7aca3919ba29ccdac01136fa9ba79f571bc797d (patch)
treeb928201cc61db62c36225acf129df4bed3754415 /src/glsl/ir.h
parentf9cecca7a6e3d9ff231075381b88d179e153a5a4 (diff)
glsl: replace strncmp("gl_") calls with new is_gl_identifier() helper
Makes things a little easier to read. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index ef4a12d60ef..80609829ebc 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -2342,6 +2342,15 @@ prototype_string(const glsl_type *return_type, const char *name,
const char *
mode_string(const ir_variable *var);
+/**
+ * Built-in / reserved GL variables names start with "gl_"
+ */
+static inline bool
+is_gl_identifier(const char *s)
+{
+ return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
+}
+
extern "C" {
#endif /* __cplusplus */