[Mesa-dev] [PATCH 17/32] glsl: Add new uniform_field_visitor::visit_field variant

Ian Romanick idr at freedesktop.org
Tue Jan 22 00:52:08 PST 2013


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

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/link_uniforms.cpp |  7 +++++++
 src/glsl/linker.h          | 10 ++++++++++
 2 files changed, 17 insertions(+)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 4b8dc42..bb0cd60 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -108,6 +108,13 @@ uniform_field_visitor::recursion(const glsl_type *t, char **name,
    }
 }
 
+void
+uniform_field_visitor::visit_field(const glsl_struct_field *field)
+{
+   (void) field;
+   /* empty */
+}
+
 /**
  * Class to help calculate the storage requirements for a set of uniforms
  *
diff --git a/src/glsl/linker.h b/src/glsl/linker.h
index f394bfe..856b263 100644
--- a/src/glsl/linker.h
+++ b/src/glsl/linker.h
@@ -89,6 +89,16 @@ protected:
    virtual void visit_field(const glsl_type *type, const char *name,
                             bool row_major) = 0;
 
+   /**
+    * Visit a record before visiting its fields
+    *
+    * For structures-of-structures or interfaces-of-structures, this visits
+    * the inner structure before visiting its fields.
+    *
+    * The default implementation does nothing.
+    */
+   virtual void visit_field(const glsl_struct_field *field);
+
 private:
    /**
     * \param name_length  Length of the current name \b not including the
-- 
1.7.11.7



More information about the mesa-dev mailing list