glsl: Add new uniform_field_visitor::visit_field variant
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 22 Jan 2013 03:49:39 +0000 (22:49 -0500)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 25 Jan 2013 14:07:34 +0000 (09:07 -0500)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/link_uniforms.cpp
src/glsl/linker.h

index 90d46da..c15bb30 100644 (file)
@@ -113,6 +113,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
  *
index 0ad217f..95937d4 100644 (file)
@@ -95,6 +95,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