[Piglit] [PATCH] glsl-fs-fragcoord: incr loops by 16 to probe fewer pixels

Brian Paul brianp at vmware.com
Wed Oct 12 09:38:18 PDT 2011


As it was, we were calling glReadPixels 65,536 times to probe all the
pixels.  This actually took quite a while with some drivers.  Probing
"only" 256 pixels now is much faster, and good enough.
---
 tests/shaders/glsl-fs-fragcoord.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/shaders/glsl-fs-fragcoord.c b/tests/shaders/glsl-fs-fragcoord.c
index 65e5881..47555e3 100644
--- a/tests/shaders/glsl-fs-fragcoord.c
+++ b/tests/shaders/glsl-fs-fragcoord.c
@@ -48,8 +48,8 @@ piglit_display(void)
 
 	piglit_draw_rect(0, 0, piglit_width, piglit_height);
 
-	for (y = 0; y < piglit_height; y++) {
-		for (x = 0; x < piglit_width; x++) {
+	for (y = 8; y < piglit_height && pass; y += 16) {
+		for (x = 8; x < piglit_width; x += 16) {
 			float color[3];
 
 			color[0] = x / 256.0;
-- 
1.7.3.4



More information about the Piglit mailing list