progs/perf: break up long runs of fullscreen quads
authorKeith Whitwell <keithw@vmware.com>
Tue, 22 Sep 2009 10:01:53 +0000 (11:01 +0100)
committerKeith Whitwell <keithw@vmware.com>
Tue, 22 Sep 2009 10:21:10 +0000 (11:21 +0100)
Not all drivers cope gracefully with command-buffers with zillions of
fullscreen quads.

progs/perf/fill.c

index fb9fa2453f62e4e00baa9ab1977ca069eab6c7b2..279f2b5f189c2643f126329d36a6ecd68a0d93ba 100644 (file)
@@ -169,14 +169,31 @@ static void
 DrawQuad(unsigned count)
 {
    unsigned i;
+   glClear(GL_COLOR_BUFFER_BIT);
+
    for (i = 0; i < count; i++) {
       glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+      /* Avoid sending command buffers with huge numbers of fullscreen
+       * quads.  Graphics schedulers don't always cope well with
+       * this...
+       */
+      if (i % 128 == 0) {
+         PerfSwapBuffers();
+         glClear(GL_COLOR_BUFFER_BIT);
+      }
    }
+
    glFinish();
-   if (0)
+
+   if (1)
       PerfSwapBuffers();
 }
 
+void
+PerfNextRound(void)
+{
+}
 
 /** Called from test harness/main */
 void