Module: Mesa
Branch: master
Commit: 6a09c9d2d891a7118bc7c07d03900d69154116ba
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a09c9d2d891a7118bc7c07d03900d69154116ba

Author: Keith Whitwell <[email protected]>
Date:   Tue Sep 22 12:35:56 2009 +0100

progs/perf: make teximage results easier to read, more reproducible

Always run the same tests on different drivers, give zero results
where test image is too big for driver.

Add a newline between groups of tests.

---

 progs/perf/teximage.c |   44 +++++++++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/progs/perf/teximage.c b/progs/perf/teximage.c
index 9e032ad..4621176 100644
--- a/progs/perf/teximage.c
+++ b/progs/perf/teximage.c
@@ -181,34 +181,44 @@ PerfDraw(void)
       /* loop over glTexImage, glTexSubImage */
       for (subImage = 0; subImage < 2; subImage++) {
 
-         /* loop over texture sizes */
-         for (TexSize = 16; TexSize <= maxSize; TexSize *= 4) {
-            GLint bytesPerImage;
+         /* loop over a defined range of texture sizes, test only the
+          * ones which are legal for this driver.
+          */
+         for (TexSize = 16; TexSize <= 4096; TexSize *= 4) {
             double mbPerSec;
 
-            bytesPerImage = TexSize * TexSize * 4;
-            TexImage = malloc(bytesPerImage);
-
-            if (subImage) {
-               /* create initial, empty texture */
-               glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
-                            TexSize, TexSize, 0,
-                            TexSrcFormat, TexSrcType, NULL);
-               rate = PerfMeasureRate(UploadTexSubImage2D);
+            if (TexSize <= maxSize) {
+               GLint bytesPerImage;
+
+               bytesPerImage = TexSize * TexSize * 4;
+               TexImage = malloc(bytesPerImage);
+
+               if (subImage) {
+                  /* create initial, empty texture */
+                  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                               TexSize, TexSize, 0,
+                               TexSrcFormat, TexSrcType, NULL);
+                  rate = PerfMeasureRate(UploadTexSubImage2D);
+               }
+               else {
+                  rate = PerfMeasureRate(UploadTexImage2D);
+               }
+
+               mbPerSec = rate * bytesPerImage / (1024.0 * 1024.0);
+               free(TexImage);
             }
             else {
-               rate = PerfMeasureRate(UploadTexImage2D);
+               rate = 0;
+               mbPerSec = 0;
             }
 
-            mbPerSec = rate * bytesPerImage / (1024.0 * 1024.0);
-
             perf_printf("  glTex%sImage2D(%s %d x %d): "
                         "%.1f images/sec, %.1f MB/sec\n",
                         (subImage ? "Sub" : ""),
                         SrcFormats[fmt].name, TexSize, TexSize, rate, 
mbPerSec);
-
-            free(TexImage);
          }
+
+         perf_printf("\n");
       }
    }
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to