Mesa (glsl2): glsl_type: Vector, matrix, and sampler type constructors are private

Ian Romanick idr at kemper.freedesktop.org
Tue Jun 29 11:54:42 PDT 2010


Module: Mesa
Branch: glsl2
Commit: 31bcce04b1f9c8c5e33370e26a3a9d6e60049aa8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=31bcce04b1f9c8c5e33370e26a3a9d6e60049aa8

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Jun 28 11:09:40 2010 -0700

glsl_type: Vector, matrix, and sampler type constructors are private

---

 src/glsl/glsl_types.cpp |   31 +++++++++++++++++++++++++++++++
 src/glsl/glsl_types.h   |   45 +++++++++++----------------------------------
 2 files changed, 42 insertions(+), 34 deletions(-)

diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 69bed33..158659c 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -33,6 +33,37 @@ extern "C" {
 
 hash_table *glsl_type::array_types = NULL;
 
+glsl_type::glsl_type(GLenum gl_type,
+		     unsigned base_type, unsigned vector_elements,
+		     unsigned matrix_columns, const char *name) :
+   gl_type(gl_type),
+   base_type(base_type),
+   sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
+   sampler_type(0),
+   vector_elements(vector_elements), matrix_columns(matrix_columns),
+   name(name),
+   length(0)
+{
+   /* Neither dimension is zero or both dimensions are zero.
+    */
+   assert((vector_elements == 0) == (matrix_columns == 0));
+   memset(& fields, 0, sizeof(fields));
+}
+
+glsl_type::glsl_type(GLenum gl_type,
+		     enum glsl_sampler_dim dim, bool shadow, bool array,
+		     unsigned type, const char *name) :
+   gl_type(gl_type),
+   base_type(GLSL_TYPE_SAMPLER),
+   sampler_dimensionality(dim), sampler_shadow(shadow),
+   sampler_array(array), sampler_type(type),
+   vector_elements(0), matrix_columns(0),
+   name(name),
+   length(0)
+{
+   memset(& fields, 0, sizeof(fields));
+}
+
 static void
 add_types_to_symbol_table(glsl_symbol_table *symtab,
 			  const struct glsl_type *types,
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index c62d290..e1bfd34 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -158,37 +158,6 @@ struct glsl_type {
    /*@}*/
 
 
-   glsl_type(GLenum gl_type,
-	     unsigned base_type, unsigned vector_elements,
-	     unsigned matrix_columns, const char *name) :
-      gl_type(gl_type),
-      base_type(base_type), 
-      sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
-      sampler_type(0),
-      vector_elements(vector_elements), matrix_columns(matrix_columns),
-      name(name),
-      length(0)
-   {
-      /* Neither dimension is zero or both dimensions are zero.
-       */
-      assert((vector_elements == 0) == (matrix_columns == 0));
-      memset(& fields, 0, sizeof(fields));
-   }
-
-   glsl_type(GLenum gl_type,
-	     enum glsl_sampler_dim dim, bool shadow, bool array,
-	     unsigned type, const char *name) :
-      gl_type(gl_type),
-      base_type(GLSL_TYPE_SAMPLER),
-      sampler_dimensionality(dim), sampler_shadow(shadow),
-      sampler_array(array), sampler_type(type),
-      vector_elements(0), matrix_columns(0),
-      name(name),
-      length(0)
-   {
-      memset(& fields, 0, sizeof(fields));
-   }
-
    glsl_type(const glsl_struct_field *fields, unsigned num_fields,
 	     const char *name) :
       base_type(GLSL_TYPE_STRUCT),
@@ -419,9 +388,17 @@ struct glsl_type {
    }
 
 private:
-   /**
-    * Constructor for array types
-    */
+   /** Constructor for vector and matrix types */
+   glsl_type(GLenum gl_type,
+	     unsigned base_type, unsigned vector_elements,
+	     unsigned matrix_columns, const char *name);
+
+   /** Constructor for sampler types */
+   glsl_type(GLenum gl_type,
+	     enum glsl_sampler_dim dim, bool shadow, bool array,
+	     unsigned type, const char *name);
+
+   /** Constructor for array types */
    glsl_type(void *ctx, const glsl_type *array, unsigned length);
 
    /** Hash table containing the known array types. */



More information about the mesa-commit mailing list