[Piglit] [PATCH] fbo-missing-attachment-clear: probe correct buffer size

Brian Paul brianp at vmware.com
Mon Sep 22 09:31:07 PDT 2014


The piglit_probe_rect_depth() was invalid because it was using the
piglit window size rather than the FBO size.
---
 .../spec/arb_es2_compatibility/fbo-missing-attachment-clear.c  |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_es2_compatibility/fbo-missing-attachment-clear.c b/tests/spec/arb_es2_compatibility/fbo-missing-attachment-clear.c
index 381253c..4b1ffd2 100644
--- a/tests/spec/arb_es2_compatibility/fbo-missing-attachment-clear.c
+++ b/tests/spec/arb_es2_compatibility/fbo-missing-attachment-clear.c
@@ -51,6 +51,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
+#define BUF_SIZE 32
+
 enum piglit_result
 piglit_display(void)
 {
@@ -72,7 +74,7 @@ piglit_init(int argc, char **argv)
 	 */
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D, tex);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 32, 32, 0,
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, BUF_SIZE, BUF_SIZE, 0,
 		     GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
 
 	glGenFramebuffers(1, &fb);
@@ -95,14 +97,14 @@ piglit_init(int argc, char **argv)
 	printf("Clearing depth buffer to 0.0...\n");
 	glClearDepth(0.0);
 	glClear(GL_DEPTH_BUFFER_BIT);
-	pass = piglit_probe_rect_depth(0, 0, piglit_width, piglit_height, 0.0);
+	pass = piglit_probe_rect_depth(0, 0, BUF_SIZE, BUF_SIZE, 0.0);
 
 	/* Clear the depth buffer and the color buffer to different values.
 	 */
 	printf("Clearing depth buffer to 0.5...\n");
 	glClearDepth(0.5);
 	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-	pass = piglit_probe_rect_depth(0, 0, piglit_width, piglit_height, 0.5)
+	pass = piglit_probe_rect_depth(0, 0, BUF_SIZE, BUF_SIZE, 0.5)
 		&& pass;
 
 	if (!piglit_check_gl_error(GL_NO_ERROR))
-- 
1.7.10.4



More information about the Piglit mailing list