diff options
author | José Fonseca <[email protected]> | 2010-01-08 15:42:57 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-01-08 15:42:57 +0000 |
commit | 080c40ab32b2abd6d8381b4a0cc143d36a1652b2 (patch) | |
tree | e173767ebc5a82d81b9fc086449d915e29348976 /progs/demos/readpix.c | |
parent | 9cdf6f025b2ed55cfb13dd09f870f01d0c7947d3 (diff) | |
parent | a1de400e8de06a80ab140bb0fa950e990607572d (diff) |
Merge remote branch 'origin/master' into lp-binning
Conflicts:
src/gallium/auxiliary/util/u_surface.c
src/gallium/drivers/llvmpipe/Makefile
src/gallium/drivers/llvmpipe/SConscript
src/gallium/drivers/llvmpipe/lp_bld_arit.c
src/gallium/drivers/llvmpipe/lp_bld_flow.c
src/gallium/drivers/llvmpipe/lp_bld_interp.c
src/gallium/drivers/llvmpipe/lp_clear.c
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_draw_arrays.c
src/gallium/drivers/llvmpipe/lp_jit.c
src/gallium/drivers/llvmpipe/lp_jit.h
src/gallium/drivers/llvmpipe/lp_prim_vbuf.c
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup_point.c
src/gallium/drivers/llvmpipe/lp_state.h
src/gallium/drivers/llvmpipe/lp_state_blend.c
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_sampler.c
src/gallium/drivers/llvmpipe/lp_state_surface.c
src/gallium/drivers/llvmpipe/lp_tex_cache.c
src/gallium/drivers/llvmpipe/lp_tex_cache.h
src/gallium/drivers/llvmpipe/lp_tex_sample.h
src/gallium/drivers/llvmpipe/lp_tile_cache.c
Diffstat (limited to 'progs/demos/readpix.c')
-rw-r--r-- | progs/demos/readpix.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c index bbb3a68effa..cc4e4902694 100644 --- a/progs/demos/readpix.c +++ b/progs/demos/readpix.c @@ -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 { @@ -382,12 +383,11 @@ int main( int argc, char *argv[] ) { GLboolean ciMode = GL_FALSE; + glutInitWindowSize( 750, 250 ); + glutInit( &argc, argv ); if (argc > 1 && strcmp(argv[1], "-ci")==0) { ciMode = GL_TRUE; } - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 750, 250 ); if (ciMode) glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE ); else |