summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-26 21:18:56 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-07-27 10:31:40 -0700
commit17856726c94000bf16156f7f9acea77a271a6005 (patch)
tree91f85a6168a692de3837f4bdd8c4f214ec4cc374 /src/glsl
parentc178ec0d7e8cc7007cb34e4f56f14261a057c200 (diff)
downloadexternal_mesa3d-17856726c94000bf16156f7f9acea77a271a6005.zip
external_mesa3d-17856726c94000bf16156f7f9acea77a271a6005.tar.gz
external_mesa3d-17856726c94000bf16156f7f9acea77a271a6005.tar.bz2
glsl: Disallow auxiliary storage qualifiers on FS outputs.
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@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Cc: mesa-stable@lists.freedesktop.org
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_to_hir.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 2569cde..598da92 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.
*/