This avoids having to flush rendering after every texture operation.
Combined with a vc4 driver fix, reduces runtime of the test on
simulation from 160s to 44s.

It's still provoking a lot of flushes, because each slice of the 3d
texture uploads is being DISCARD_RANGE-mapped individually.
---
 tests/texturing/texture-packed-formats.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/tests/texturing/texture-packed-formats.c 
b/tests/texturing/texture-packed-formats.c
index e53f71e..1c92b1c 100644
--- a/tests/texturing/texture-packed-formats.c
+++ b/tests/texturing/texture-packed-formats.c
@@ -273,7 +273,20 @@ Test(GLuint intFmt, GLuint dims)
                        glTexCoord3f(1, 1, 0.5);  glVertex2f(x + w, y + h);
                        glTexCoord3f(0, 1, 0.5);  glVertex2f(x + 0, y + h);
                        glEnd();
+               }
+       }
 
+       if (dims == 3)
+               glDisable(GL_TEXTURE_3D);
+       else
+               glDisable(GL_TEXTURE_2D);
+
+       /* Loop over byteswapping */
+       for (swap = 0; swap < 2; swap++) {
+               /* Loop over texture formats */
+               for (i = 0; i < NUM_FORMATS; i++) {
+                       int x = 5 * swap;
+                       int y = 5 * i;
                        /* test rendering */
                        if (!piglit_probe_rect_rgb(x, y, w, 2, red)) {
                                printf("Failure for format=%s, swap=%u, "
@@ -291,11 +304,6 @@ Test(GLuint intFmt, GLuint dims)
                }
        }
 
-       if (dims == 3)
-               glDisable(GL_TEXTURE_3D);
-       else
-               glDisable(GL_TEXTURE_2D);
-
        piglit_present_results();
 
        return pass;
-- 
2.1.1

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to