[Mesa-dev] [PATCH] glsl: Disallow auxiliary storage qualifiers on FS outputs.

Matt Turner mattst88 at gmail.com
Fri Jul 26 22:06:30 PDT 2013


On Fri, Jul 26, 2013 at 9:25 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> This has always been an error; we just forgot to check for it.
>
> Fixes Piglit's no-aux-qual-on-fs-output.frag.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67333
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/glsl/ast_to_hir.cpp | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index bfd5fda..be7755d 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -2927,6 +2927,20 @@ ast_declarator_list::hir(exec_list *instructions,
>                            "'centroid in' cannot be used in a vertex shader");
>        }
>
> +      /* Section 4.3.6 of the GLSL 1.30 specification states:
> +       * "It is an error to use centroid out in a fragment shader."
> +       *
> +       * The GL_ARB_shading_language_420pack extension specification states:
> +       * "It is an error to use auxiliary storage qualifiers or interpolation
> +       *  qualifiers on an output in a fragment shader."
> +       */
> +      if (state->target == fragment_shader &&
> +          this->type->qualifier.flags.q.out &&
> +          this->type->qualifier.has_auxiliary_storage()) {
> +         _mesa_glsl_error(&loc, state,
> +                          "auxiliary storage qualifiers cannot be used on "
> +                          "fragment shader outputs");
> +      }
>
>        /* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
>         */
> --
> 1.8.3.3

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list