<div dir="ltr">On 16 September 2013 09:35, Nicholas Mack <span dir="ltr"><<a href="mailto:nichmack@gmail.com" target="_blank">nichmack@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---<br>
 .../glsl-1.50/compiler/layout-max-verts-limited.geom    | 17 +++++++++++++++++<br>
 1 file changed, 17 insertions(+)<br>
 create mode 100644 tests/spec/glsl-1.50/compiler/layout-max-verts-limited.geom<br>
<br>
diff --git a/tests/spec/glsl-1.50/compiler/layout-max-verts-limited.geom b/tests/spec/glsl-1.50/compiler/layout-max-verts-limited.geom<br>
new file mode 100644<br>
index 0000000..7794d94<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/compiler/layout-max-verts-limited.geom<br>
@@ -0,0 +1,17 @@<br>
+// [config]<br>
+// expect_result: fail<br>
+// glsl_version: 1.50<br>
+// check_link: true<br>
+// [end config]<br>
+//<br>
+// Section 4.3.8 (Output Layout Qualifiers) of the GLSL 1.50 spec says:<br>
+// "It is an error for the maximum number of vertices to be greater than<br>
+//  gl_MaxGeometryOutputVertices."<br>
+<br>
+#version 150<br>
+<br>
+layout(max_vertices = 2147483647) out;<br>
+<br>
+void main()<br>
+{<br>
+}<br></blockquote><div><br></div><div>The commit message and the comment are a little misleading.  They say that we're testing that max_vertices can't be larger than gl_MaxGeometryOutputVertices, but in fact, we're testing that max_vertices can't be set to INT_MAX.<br>
<br></div><div>It would be a pain to write the test that the comment implies (we would have to write a C program that queries gl_MaxGeometryOutputVertices, adds 1, and then sprintfs the result into a dynamically-constructed geometry shader), so I think it's ok to go ahead and do this test as a stopgap, but we should change the commit message and the comment to accurately describe what the test is doing.  Maybe change the commit message to something like "GS: Test that max_vertices cannot be set to INT_MAX"?<br>
<br></div><div>And maybe add an explanatory comment to the test that says something like:<br><br>// Unfortunately, we can't easlily try to set max_vertices to<br>// gl_MaxGeometryOutputVertices+1, since "max_vertices=" must be<br>
// followed by an integer-constant (not a constant expression), so as<br>// a stop gap, we just verify that setting max_vertices = INT_MAX<br>// leads to an error.<br><br></div>With those changes, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div></div></div>