[Mesa-dev] [PATCH 08/32] glsl: Add row_major field to glsl_struct_field

Ian Romanick idr at freedesktop.org
Tue Jan 22 00:51:59 PST 2013


From: Ian Romanick <ian.d.romanick at intel.com>

For now, this will always be false.  In the near future, an "interface"
type will be added that shares a lot of infrastructure with structures.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/builtin_types.h | 74 ++++++++++++++++++++++++------------------------
 src/glsl/glsl_types.cpp  |  1 +
 src/glsl/glsl_types.h    |  1 +
 3 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/src/glsl/builtin_types.h b/src/glsl/builtin_types.h
index a4c995f..c78c2d2 100644
--- a/src/glsl/builtin_types.h
+++ b/src/glsl/builtin_types.h
@@ -89,9 +89,9 @@ const glsl_type *const glsl_type::mat4_type = & builtin_core_types[14];
 /*@{*/
 
 static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = {
-   { glsl_type::float_type, "near" },
-   { glsl_type::float_type, "far" },
-   { glsl_type::float_type, "diff" },
+   { glsl_type::float_type, "near", false },
+   { glsl_type::float_type, "far", false },
+   { glsl_type::float_type, "diff", false },
 };
 
 const glsl_type glsl_type::builtin_structure_types[] = {
@@ -106,58 +106,58 @@ const glsl_type glsl_type::builtin_structure_types[] = {
 /*@{*/
 
 static const struct glsl_struct_field gl_PointParameters_fields[] = {
-   { glsl_type::float_type, "size" },
-   { glsl_type::float_type, "sizeMin" },
-   { glsl_type::float_type, "sizeMax" },
-   { glsl_type::float_type, "fadeThresholdSize" },
-   { glsl_type::float_type, "distanceConstantAttenuation" },
-   { glsl_type::float_type, "distanceLinearAttenuation" },
-   { glsl_type::float_type, "distanceQuadraticAttenuation" },
+   { glsl_type::float_type, "size", false },
+   { glsl_type::float_type, "sizeMin", false },
+   { glsl_type::float_type, "sizeMax", false },
+   { glsl_type::float_type, "fadeThresholdSize", false },
+   { glsl_type::float_type, "distanceConstantAttenuation", false },
+   { glsl_type::float_type, "distanceLinearAttenuation", false },
+   { glsl_type::float_type, "distanceQuadraticAttenuation", false },
 };
 
 static const struct glsl_struct_field gl_MaterialParameters_fields[] = {
-   { glsl_type::vec4_type, "emission" },
-   { glsl_type::vec4_type, "ambient" },
-   { glsl_type::vec4_type, "diffuse" },
-   { glsl_type::vec4_type, "specular" },
-   { glsl_type::float_type, "shininess" },
+   { glsl_type::vec4_type, "emission", false },
+   { glsl_type::vec4_type, "ambient", false },
+   { glsl_type::vec4_type, "diffuse", false },
+   { glsl_type::vec4_type, "specular", false },
+   { glsl_type::float_type, "shininess", false },
 };
 
 static const struct glsl_struct_field gl_LightSourceParameters_fields[] = {
-   { glsl_type::vec4_type, "ambient" },
-   { glsl_type::vec4_type, "diffuse" },
-   { glsl_type::vec4_type, "specular" },
-   { glsl_type::vec4_type, "position" },
-   { glsl_type::vec4_type, "halfVector" },
-   { glsl_type::vec3_type, "spotDirection" },
-   { glsl_type::float_type, "spotExponent" },
-   { glsl_type::float_type, "spotCutoff" },
-   { glsl_type::float_type, "spotCosCutoff" },
-   { glsl_type::float_type, "constantAttenuation" },
-   { glsl_type::float_type, "linearAttenuation" },
-   { glsl_type::float_type, "quadraticAttenuation" },
+   { glsl_type::vec4_type, "ambient", false },
+   { glsl_type::vec4_type, "diffuse", false },
+   { glsl_type::vec4_type, "specular", false },
+   { glsl_type::vec4_type, "position", false },
+   { glsl_type::vec4_type, "halfVector", false },
+   { glsl_type::vec3_type, "spotDirection", false },
+   { glsl_type::float_type, "spotExponent", false },
+   { glsl_type::float_type, "spotCutoff", false },
+   { glsl_type::float_type, "spotCosCutoff", false },
+   { glsl_type::float_type, "constantAttenuation", false },
+   { glsl_type::float_type, "linearAttenuation", false },
+   { glsl_type::float_type, "quadraticAttenuation", false },
 };
 
 static const struct glsl_struct_field gl_LightModelParameters_fields[] = {
-   { glsl_type::vec4_type, "ambient" },
+   { glsl_type::vec4_type, "ambient", false },
 };
 
 static const struct glsl_struct_field gl_LightModelProducts_fields[] = {
-   { glsl_type::vec4_type, "sceneColor" },
+   { glsl_type::vec4_type, "sceneColor", false },
 };
 
 static const struct glsl_struct_field gl_LightProducts_fields[] = {
-   { glsl_type::vec4_type, "ambient" },
-   { glsl_type::vec4_type, "diffuse" },
-   { glsl_type::vec4_type, "specular" },
+   { glsl_type::vec4_type, "ambient", false },
+   { glsl_type::vec4_type, "diffuse", false },
+   { glsl_type::vec4_type, "specular", false },
 };
 
 static const struct glsl_struct_field gl_FogParameters_fields[] = {
-   { glsl_type::vec4_type, "color" },
-   { glsl_type::float_type, "density" },
-   { glsl_type::float_type, "start" },
-   { glsl_type::float_type, "end" },
-   { glsl_type::float_type, "scale" },
+   { glsl_type::vec4_type, "color", false },
+   { glsl_type::float_type, "density", false },
+   { glsl_type::float_type, "start", false },
+   { glsl_type::float_type, "end", false },
+   { glsl_type::float_type, "scale", false },
 };
 
 const glsl_type glsl_type::builtin_110_deprecated_structure_types[] = {
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 7386760..46cc96e 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -96,6 +96,7 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
       this->fields.structure[i].type = fields[i].type;
       this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
 						     fields[i].name);
+      this->fields.structure[i].row_major = fields[i].row_major;
    }
 }
 
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index d6f5c10..24ad844 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -566,6 +566,7 @@ private:
 struct glsl_struct_field {
    const struct glsl_type *type;
    const char *name;
+   bool row_major;
 };
 
 #endif /* __cplusplus */
-- 
1.7.11.7



More information about the mesa-dev mailing list