Module: Mesa
Branch: master
Commit: 26c9514155bfcd1cf2cfeb2cfdb5d4b78a8072b0
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=26c9514155bfcd1cf2cfeb2cfdb5d4b78a8072b0

Author: Kenneth Graunke <kenn...@whitecape.org>
Date:   Thu Aug  7 22:38:50 2014 -0700

mesa: Replace string comparisons with SYSTEM_VALUE enum checks.

This is more efficient.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>

---

 src/mesa/main/shader_query.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 4267743..4871d09 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -92,8 +92,8 @@ is_active_attrib(const ir_variable *var)
        * are enumerated, including the special built-in inputs gl_VertexID
        * and gl_InstanceID."
        */
-      return !strcmp(var->name, "gl_VertexID") ||
-             !strcmp(var->name, "gl_InstanceID");
+      return var->data.location == SYSTEM_VALUE_VERTEX_ID ||
+             var->data.location == SYSTEM_VALUE_INSTANCE_ID;
 
    default:
       return false;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to