Mesa (master): glsl: Fix inout qualifier handling in GLSL 4.40.

Kenneth Graunke kwg at kemper.freedesktop.org
Fri Aug 12 06:57:47 UTC 2016


Module: Mesa
Branch: master
Commit: dffa371665fc45481f6b6686e586f9be2b36a915
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dffa371665fc45481f6b6686e586f9be2b36a915

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Aug 11 11:40:25 2016 -0700

glsl: Fix inout qualifier handling in GLSL 4.40.

inout variables have q.in and q.out set.  We were trying to set
xfb_buffer = 1 for shader output variables (and inadvertantly setting
it on inout parameters, too).  But input_layout_mask doesn't have
xfb_buffer set, so it was seen as in invalid input qualifier.

This meant that all 'inout' parameters were broken.

Caught by running a WebGL conformance test in Chromium:
https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/qualification_order.html?webglVersion=2

Fixes Piglit's tests/spec/glsl-4.40/compiler/inout-parameter-qualifier.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>

---

 src/compiler/glsl/ast_type.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_type.cpp b/src/compiler/glsl/ast_type.cpp
index ef573e7..248b647 100644
--- a/src/compiler/glsl/ast_type.cpp
+++ b/src/compiler/glsl/ast_type.cpp
@@ -242,7 +242,8 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
          if (q.flags.q.xfb_buffer) {
             this->flags.q.xfb_buffer = 1;
             this->xfb_buffer = q.xfb_buffer;
-         } else if (!this->flags.q.xfb_buffer && this->flags.q.out) {
+         } else if (!this->flags.q.xfb_buffer && this->flags.q.out &&
+                    !this->flags.q.in) {
             /* Assign global xfb_buffer value */
             this->flags.q.xfb_buffer = 1;
             this->xfb_buffer = state->out_qualifier->xfb_buffer;




More information about the mesa-commit mailing list