<p dir="ltr">Reviewed-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>></p>
<div class="gmail_extra"><br><div class="gmail_quote">On Sep 17, 2016 3:53 PM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes ESEXT-CTS.draw_elements_base_<wbr>vertex_tests.AEP_shader_stages and<br>
ESEXT-CTS.texture_cube_map_<wbr>array.texture_size_<wbr>tesselation_con_sh.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
 src/compiler/glsl/ast_to_hir.<wbr>cpp | 28 +++++++++++++++++++++++++++-<br>
 1 file changed, 27 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/compiler/glsl/ast_to_<wbr>hir.cpp b/src/compiler/glsl/ast_to_<wbr>hir.cpp<br>
index 0a23195..9de8454 100644<br>
--- a/src/compiler/glsl/ast_to_<wbr>hir.cpp<br>
+++ b/src/compiler/glsl/ast_to_<wbr>hir.cpp<br>
@@ -5127,7 +5127,33 @@ ast_declarator_list::hir(exec_<wbr>list *instructions,<br>
          const glsl_type *const t = (earlier == NULL)<br>
             ? var->type : earlier->type;<br>
<br>
-         if (t->is_unsized_array())<br>
+         /* Skip the unsized array check for TCS/TES/GS inputs & TCS outputs.<br>
+          *<br>
+          * The GL_OES_tessellation_shader spec says about inputs:<br>
+          *<br>
+          *    "Declaring an array size is optional. If no size is specified,<br>
+          *     it will be taken from the implementation-dependent maximum<br>
+          *     patch size (gl_MaxPatchVertices)."<br>
+          *<br>
+          * and about TCS outputs:<br>
+          *<br>
+          *    "If no size is specified, it will be taken from output patch<br>
+          *     size declared in the shader."<br>
+          *<br>
+          * The GL_OES_geometry_shader spec says:<br>
+          *<br>
+          *    "All geometry shader input unsized array declarations will be<br>
+          *     sized by an earlier input primitive layout qualifier, when<br>
+          *     present, as per the following table."<br>
+          */<br>
+         const bool implicitly_sized =<br>
+            (var->data.mode == ir_var_shader_in &&<br>
+             state->stage >= MESA_SHADER_TESS_CTRL &&<br>
+             state->stage <= MESA_SHADER_GEOMETRY) ||<br>
+            (var->data.mode == ir_var_shader_out &&<br>
+             state->stage == MESA_SHADER_TESS_CTRL);<br>
+<br>
+         if (t->is_unsized_array() && !implicitly_sized)<br>
             /* Section 10.17 of the GLSL ES 1.00 specification states that<br>
              * unsized array declarations have been removed from the language.<br>
              * Arrays that are sized using an initializer are still explicitly<br>
--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>