On 20 September 2011 14:51, Eric Anholt <span dir="ltr">&lt;<a href="mailto:eric@anholt.net">eric@anholt.net</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
As fallout, test a couple more combinations.<br>
---<br>
 tests/all.tests                             |   29 ++++++-----<br>
 tests/spec/gl-2.0/vertex-program-two-side.c |   73 +++++++++++++--------------<br>
 2 files changed, 50 insertions(+), 52 deletions(-)<br>
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index 94b3184..5404880 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -732,21 +732,22 @@ add_texwrap_test3(gl20, &#39;2D&#39;, &#39;npot&#39;, &#39;proj&#39;)<br>
 add_texwrap_test2(gl20, &#39;3D&#39;, &#39;npot&#39;)<br>
 add_texwrap_test3(gl20, &#39;3D&#39;, &#39;npot&#39;, &#39;proj&#39;)<br>
 add_plain_test(gl20, &#39;getattriblocation-conventional&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled front back front2 back2&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled front back&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled front2 back2&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled front front2&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled back back2&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled front&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled back&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled front2&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side enabled back2&#39;)<br>
+<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side front back front2 back2&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side front back&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side front2 back2&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side front front2&#39;)<br>
 add_concurrent_test(gl20, &#39;vertex-program-two-side front&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side back&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side primary&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side primary front&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side primary back&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side secondary&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side secondary front&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side secondary back&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side disabled&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side disabled front&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side disabled primary&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side disabled primary front&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side disabled secondary&#39;)<br>
-add_concurrent_test(gl20, &#39;vertex-program-two-side disabled secondary front&#39;)<br>
+add_concurrent_test(gl20, &#39;vertex-program-two-side front2&#39;)<br></blockquote><div><br>There are a few nonsensical use cases that won&#39;t produce well-defined colors, but are probably worth testing just to make sure they don&#39;t cause a GPU hang or assertion failure, such as &quot;enabled front back back2&quot;, or &quot;back back2&quot;.  In fact, I would argue that it&#39;s worth testing all 32 combinations of enable, front, back, front2, and back2 just to be on the safe side.<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
 # Group spec/glsl-1.00<br>
 spec[&#39;glsl-1.00&#39;] = Group()<br>
diff --git a/tests/spec/gl-2.0/vertex-program-two-side.c b/tests/spec/gl-2.0/vertex-program-two-side.c<br>
index e57e508..611e1a9 100644<br>
--- a/tests/spec/gl-2.0/vertex-program-two-side.c<br>
+++ b/tests/spec/gl-2.0/vertex-program-two-side.c<br>
@@ -50,11 +50,12 @@ int piglit_window_mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE;<br>
<br>
 static GLint prog;<br>
<br>
-static bool primary = true;<br>
-static bool secondary = true;<br>
-static bool enabled = true;<br>
-static bool front = true;<br>
-static bool back = true;<br>
+static bool enabled = false;<br>
+static bool front = false;<br>
+static bool back = false;<br>
+static bool front2 = false;<br>
+static bool back2 = false;<br>
+<br>
 static float frontcolor[4] = {0.0, 0.5, 0.0, 0.0};<br>
 static float backcolor[4] = {0.0, 0.0, 0.5, 0.0};<br>
 static float secondary_frontcolor[4] = {0.0, 0.25, 0.0, 0.0};<br>
@@ -78,51 +79,49 @@ piglit_display(void)<br>
        int w = piglit_width / 2, h = piglit_height / 2;<br>
        int x2 = piglit_width - w, y2 = piglit_height - h;<br>
        bool pass = true;<br>
-       bool draw_back = back || !enabled;<br>
<br>
        glClearColor(0.5, 0.5, 0.5, 0.5);<br>
        glClear(GL_COLOR_BUFFER_BIT);<br>
<br>
        glUniform1i(draw_secondary_loc, false);<br>
-       if (front &amp;&amp; primary)<br>
+       if (front)<br>
                piglit_draw_rect(-1,  0,  1, 1); /* top left */<br>
-       if (draw_back &amp;&amp; primary)<br>
+       if (back || (front &amp;&amp; !enabled))<br>
                piglit_draw_rect( 1,  0, -1, 1); /* top right */<br>
<br>
        glUniform1i(draw_secondary_loc, true);<br>
-       if (front &amp;&amp; secondary)<br>
+       if (front2)<br>
                piglit_draw_rect(-1, -1,  1, 1); /* bot left */<br>
-       if (draw_back &amp;&amp; secondary)<br>
+       if (back2 || (front2 &amp;&amp; !enabled))<br>
                piglit_draw_rect( 1, -1, -1, 1); /* bot right */<br></blockquote><div><br>Along the same lines of what I said above, I think it would be worth drawing all four rects regardless of the command-line arguments, just to make sure there isn&#39;t an assertion failure or GPU hang when drawing a rect with an undefined color.  We can rely on the if tests below to ensure that we only *check* the colors in the cases where they are well-defined.<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
        if (front) {<br>
-               if (primary) {<br>
-                       pass = pass &amp;&amp; piglit_probe_rect_rgba(x1, y2, w, h,<br>
-                                                             frontcolor);<br>
-               }<br>
-               if (secondary) {<br>
-                       pass = pass &amp;&amp; piglit_probe_rect_rgba(x1, y1, w, h,<br>
-                                                             secondary_frontcolor);<br>
-               }<br>
+               pass = pass &amp;&amp; piglit_probe_rect_rgba(x1, y2, w, h,<br>
+                                                     frontcolor);<br>
+       }<br>
+<br>
+       if (front2) {<br>
+               pass = pass &amp;&amp; piglit_probe_rect_rgba(x1, y1, w, h,<br>
+                                                     secondary_frontcolor);<br>
        }<br>
<br>
-       if (back &amp;&amp; enabled) {<br>
+       if (enabled) {<br>
                /* Two-sided: Get the back color/secondarycolor. */<br>
-               if (primary) {<br>
+               if (back) {<br>
                        pass = pass &amp;&amp; piglit_probe_rect_rgba(x2, y2, w, h,<br>
                                                              backcolor);<br>
                }<br>
-               if (secondary) {<br>
+               if (back2) {<br>
                        pass = pass &amp;&amp; piglit_probe_rect_rgba(x2, y1, w, h,<br>
                                                              secondary_backcolor);<br>
                }<br>
-       } else if (back) {<br>
+       } else {<br>
                /* Non-two-sided: Get the front color/secondarycolor. */<br>
-               if (primary) {<br>
+               if (front) {<br>
                        pass = pass &amp;&amp; piglit_probe_rect_rgba(x2, y2, w, h,<br>
                                                              frontcolor);<br>
                }<br>
-               if (secondary) {<br>
+               if (front2) {<br>
                        pass = pass &amp;&amp; piglit_probe_rect_rgba(x2, y1, w, h,<br>
                                                              secondary_frontcolor);<br>
                }<br>
@@ -168,30 +167,28 @@ piglit_init(int argc, char **argv)<br>
        printf(&quot;+-------------------------+------------------------+\n&quot;);<br>
<br>
        for (i = 1; i &lt; argc; i++) {<br>
-               if (strcmp(argv[i], &quot;disabled&quot;) == 0) {<br>
-                       enabled = false;<br>
+               if (strcmp(argv[i], &quot;enabled&quot;) == 0) {<br>
+                       enabled = true;<br>
                } else if (strcmp(argv[i], &quot;front&quot;) == 0) {<br>
-                       back = false;<br>
+                       front = true;<br>
                } else if (strcmp(argv[i], &quot;back&quot;) == 0) {<br>
-                       front = false;<br>
-               } else if (strcmp(argv[i], &quot;primary&quot;) == 0) {<br>
-                       secondary = false;<br>
-               } else if (strcmp(argv[i], &quot;secondary&quot;) == 0) {<br>
-                       primary = false;<br>
+                       back = true;<br>
+               } else if (strcmp(argv[i], &quot;front2&quot;) == 0) {<br>
+                       front2 = true;<br>
+               } else if (strcmp(argv[i], &quot;back2&quot;) == 0) {<br>
+                       back2 = true;<br>
                } else {<br>
                        fprintf(stderr, &quot;unknown argument %s\n&quot;, argv[i]);<br>
                }<br>
        }<br>
<br>
-       assert(enabled || front);<br>
-<br>
-       if (front &amp;&amp; primary)<br>
+       if (front)<br>
                setup_output(&amp;vs_outputs[0], &quot;gl_FrontColor&quot;, frontcolor);<br>
-       if (back &amp;&amp; primary)<br>
+       if (back)<br>
                setup_output(&amp;vs_outputs[1], &quot;gl_BackColor&quot;, backcolor);<br>
-       if (front &amp;&amp; secondary)<br>
+       if (front2)<br>
                setup_output(&amp;vs_outputs[2], &quot;gl_FrontSecondaryColor&quot;, secondary_frontcolor);<br>
-       if (back &amp;&amp; secondary)<br>
+       if (back2)<br>
                setup_output(&amp;vs_outputs[3], &quot;gl_BackSecondaryColor&quot;, secondary_backcolor);<br>
<br>
        asprintf(&amp;vs_source,<br>
<font color="#888888">--<br>
1.7.5.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></blockquote></div><br>Other than the two comments above, this series is<br><br>Reviewed-by: Paul Berry &lt;<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>&gt;<br>