glsl: use the is_gl_identifier() helper in a couple more places
authorBrian Paul <brianp@vmware.com>
Fri, 2 Jan 2015 23:19:48 +0000 (16:19 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 5 Jan 2015 20:50:54 +0000 (13:50 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/ir_validate.cpp
src/glsl/opt_dead_builtin_variables.cpp

index 5a6f8bbf5ee4ac585b55b6b010298f0e8bc64681..6d5633916ba2fe40d6805d0971c96b2ec863ede9 100644 (file)
@@ -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();
index 85c75d6f21f740b2973cd4a954f5d832a441fef1..0d4e3a8f00a2d2278d6e80fc0b31d13cc45e9cd7 100644 (file)
@@ -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