glsl: Make a function to express a GLSL version ir human-readable form.
[mesa.git] / src / glsl / glsl_types.h
index 8f2a3ff38caad051df0068e820b7d1d943d222cf..cf954a256d391976c7372980322787f613afde5f 100644 (file)
@@ -152,6 +152,8 @@ struct glsl_type {
    static const glsl_type *const error_type;
    static const glsl_type *const void_type;
    static const glsl_type *const int_type;
+   static const glsl_type *const ivec2_type;
+   static const glsl_type *const ivec3_type;
    static const glsl_type *const ivec4_type;
    static const glsl_type *const uint_type;
    static const glsl_type *const uvec2_type;
@@ -162,6 +164,9 @@ struct glsl_type {
    static const glsl_type *const vec3_type;
    static const glsl_type *const vec4_type;
    static const glsl_type *const bool_type;
+   static const glsl_type *const bvec2_type;
+   static const glsl_type *const bvec3_type;
+   static const glsl_type *const bvec4_type;
    static const glsl_type *const mat2_type;
    static const glsl_type *const mat2x3_type;
    static const glsl_type *const mat2x4_type;
@@ -242,6 +247,19 @@ struct glsl_type {
     */
    unsigned component_slots() const;
 
+   /**
+    * Alignment in bytes of the start of this type in a std140 uniform
+    * block.
+    */
+   unsigned std140_base_alignment(bool row_major) const;
+
+   /** Size in bytes of this type in a std140 uniform block.
+    *
+    * Note that this is not GL_UNIFORM_SIZE (which is the number of
+    * elements in the array)
+    */
+   unsigned std140_size(bool row_major) const;
+
    /**
     * \brief Can this type be implicitly converted to another?
     *
@@ -503,6 +521,7 @@ private:
    static const glsl_type builtin_EXT_texture_array_types[];
    static const glsl_type builtin_EXT_texture_buffer_object_types[];
    static const glsl_type builtin_OES_EGL_image_external_types[];
+   static const glsl_type builtin_ARB_texture_cube_map_array_types[];
    /*@}*/
 
    /**
@@ -515,14 +534,15 @@ private:
     */
    /*@{*/
    static void generate_100ES_types(glsl_symbol_table *);
-   static void generate_110_types(glsl_symbol_table *);
-   static void generate_120_types(glsl_symbol_table *);
-   static void generate_130_types(glsl_symbol_table *);
+   static void generate_110_types(glsl_symbol_table *, bool add_deprecated);
+   static void generate_120_types(glsl_symbol_table *, bool add_deprecated);
+   static void generate_130_types(glsl_symbol_table *, bool add_deprecated);
    static void generate_140_types(glsl_symbol_table *);
    static void generate_ARB_texture_rectangle_types(glsl_symbol_table *, bool);
    static void generate_EXT_texture_array_types(glsl_symbol_table *, bool);
    static void generate_OES_texture_3D_types(glsl_symbol_table *, bool);
    static void generate_OES_EGL_image_external_types(glsl_symbol_table *, bool);
+   static void generate_ARB_texture_cube_map_array_types(glsl_symbol_table *, bool);
    /*@}*/
 
    /**