mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 07:20:16 +01:00
progs/demos: report pixel rate in million pixels / sec
This commit is contained in:
parent
f44f6473e6
commit
79e74cda73
1 changed files with 5 additions and 4 deletions
|
|
@ -219,7 +219,7 @@ Display( void )
|
|||
GLint reads = 0;
|
||||
GLint endTime;
|
||||
GLint startTime = glutGet(GLUT_ELAPSED_TIME);
|
||||
GLdouble seconds, pixelsPerSecond;
|
||||
GLdouble seconds, mpixels, mpixelsPerSecond;
|
||||
printf("Benchmarking...\n");
|
||||
do {
|
||||
glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
||||
|
|
@ -228,9 +228,10 @@ Display( void )
|
|||
endTime = glutGet(GLUT_ELAPSED_TIME);
|
||||
} while (endTime - startTime < 4000); /* 4 seconds */
|
||||
seconds = (double) (endTime - startTime) / 1000.0;
|
||||
pixelsPerSecond = reads * ImgWidth * ImgHeight / seconds;
|
||||
printf("Result: %d reads in %f seconds = %f pixels/sec\n",
|
||||
reads, seconds, pixelsPerSecond);
|
||||
mpixels = reads * (ImgWidth * ImgHeight / (1000.0 * 1000.0));
|
||||
mpixelsPerSecond = mpixels / seconds;
|
||||
printf("Result: %d reads in %f seconds = %f Mpixels/sec\n",
|
||||
reads, seconds, mpixelsPerSecond);
|
||||
Benchmark = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue