diff options
author | Ian Romanick <[email protected]> | 2014-07-16 15:37:10 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-08-04 14:40:06 -0700 |
commit | 47c6fc5b04774737404b55b01cbab5c3baf1c183 (patch) | |
tree | 35fb28a683f79f0d476e0fa04f9a3a95cfbf95eb /src/glsl/linker.h | |
parent | 46356c46ea9c09cc2eb8dfe753d3b066e698003b (diff) |
linker: Add a last_field parameter to various program_resource_visitor methods
I also considered renaming visit_field(const glsl_struct_field *) to
entry_record and adding an exit_record method. This would be more
similar to the hierarchical visitor.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/linker.h')
-rw-r--r-- | src/glsl/linker.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/glsl/linker.h b/src/glsl/linker.h index 130915db412..8851da6c8b4 100644 --- a/src/glsl/linker.h +++ b/src/glsl/linker.h @@ -138,11 +138,15 @@ protected: * \param name Fully qualified name of the field. * \param row_major For a matrix type, is it stored row-major. * \param record_type Type of the record containing the field. + * \param last_field Set if \c name is the last field of the structure + * containing it. This will always be false for items + * not contained in a structure or interface block. * * The default implementation just calls the other \c visit_field method. */ virtual void visit_field(const glsl_type *type, const char *name, - bool row_major, const glsl_type *record_type); + bool row_major, const glsl_type *record_type, + bool last_field); /** * Method invoked for each leaf of the variable @@ -168,9 +172,13 @@ private: /** * \param name_length Length of the current name \b not including the * terminating \c NUL character. + * \param last_field Set if \c name is the last field of the structure + * containing it. This will always be false for items + * not contained in a structure or interface block. */ void recursion(const glsl_type *t, char **name, size_t name_length, - bool row_major, const glsl_type *record_type); + bool row_major, const glsl_type *record_type, + bool last_field); }; void |