[Mesa-dev] [PATCH] glsl: for anonymous struct matching use without_array()

Dave Airlie airlied at gmail.com
Mon Jun 6 00:54:02 UTC 2016


From: Dave Airlie <airlied at redhat.com>

With tessellation shaders we can have cases where we have
arrays of anon structs, so make sure we match using without_array().

Fixes:
GL45-CTS.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_in

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/compiler/glsl/link_varyings.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index a286e77..395fef4 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -226,9 +226,11 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
        *     fragment language."
        */
       if (!output->type->is_array() || !is_gl_identifier(output->name)) {
-         bool anon_matches = output->type->is_anonymous() &&
-            type_to_match->is_anonymous() &&
-            type_to_match->record_compare(output->type);
+         const struct glsl_type *to_match_wa = type_to_match->without_array();
+         const struct glsl_type *out_type_wa = output->type->without_array();
+         bool anon_matches = out_type_wa->is_anonymous() &&
+            to_match_wa->is_anonymous() &&
+            to_match_wa->record_compare(out_type_wa);
 
          if (!anon_matches) {
             linker_error(prog,
-- 
2.7.4



More information about the mesa-dev mailing list