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 90d46da07213ac28e1fee5a4f56600638c048386..c15bb30afe58edfd34be0e6b5e9a0d13009c8cba 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 0ad217f841c977f924f6f86f5ed21a101938a494..95937d4ee871f8ca694e1c35f0bf6f568b4efef0 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