From: Kenneth Graunke Date: Sun, 14 Jul 2013 02:20:37 +0000 (-0700) Subject: glsl: Add a new ast_type_qualifier::has_auxiliary_storage() method. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b719df14dcde947f3d9c43282866a65cf3a3fd2;p=mesa.git glsl: Add a new ast_type_qualifier::has_auxiliary_storage() method. "Auxiliary storage qualifiers" is the new term given to "centroid", "patch", and "sample" by GLSL 4.20/GL_ARB_shading_language_420pack. Even though we only support "centroid", it's useful to add this now so that all auxiliary storage qualifiers get handled in the right places once they're eventually supported. Signed-off-by: Kenneth Graunke Reviewed-by: Matt Turner --- diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 78d24ae069d..816d5fccbbc 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -467,6 +467,11 @@ struct ast_type_qualifier { */ bool has_storage() const; + /** + * Return whether an auxiliary storage qualifier is present. + */ + bool has_auxiliary_storage() const; + /** * \brief Return string representation of interpolation qualifier. * diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp index 2e55b76762b..4cbb835ee1e 100644 --- a/src/glsl/ast_type.cpp +++ b/src/glsl/ast_type.cpp @@ -85,6 +85,12 @@ ast_type_qualifier::has_storage() const || this->flags.q.uniform; } +bool +ast_type_qualifier::has_auxiliary_storage() const +{ + return this->flags.q.centroid; +} + const char* ast_type_qualifier::interpolation_string() const {