OSDN Git Service

Add glsl_type::is_array and glsl_type::is_float queries
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Mar 2010 23:17:15 +0000 (16:17 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Mar 2010 23:17:15 +0000 (16:17 -0700)
glsl_types.h

index 68a32ef..bb2d6f6 100644 (file)
@@ -224,6 +224,14 @@ struct glsl_type {
    }
 
    /**
+    * Query whether or not a type is a float type
+    */
+   bool is_float() const
+   {
+      return base_type == GLSL_TYPE_FLOAT;
+   }
+
+   /**
     * Query whether or not a type is a non-array boolean type
     */
    bool is_boolean() const
@@ -240,6 +248,14 @@ struct glsl_type {
    }
 
    /**
+    * Query whether or not a type is an array
+    */
+   bool is_array() const
+   {
+      return base_type == GLSL_TYPE_ARRAY;
+   }
+
+   /**
     * Query whether or not a type is the void type singleton.
     */
    bool is_void() const