[Piglit] [PATCH 7/8] sample_common: Move clearing the buffer to the callers.

Eric Anholt eric at anholt.net
Tue Jul 26 00:43:43 UTC 2016


I want to be able to sample more than one dmabuf in the scene.
---
 tests/spec/ext_image_dma_buf_import/sample_common.c | 2 --
 tests/spec/ext_image_dma_buf_import/sample_rgb.c    | 6 ++++--
 tests/spec/ext_image_dma_buf_import/sample_yuv.c    | 2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/spec/ext_image_dma_buf_import/sample_common.c b/tests/spec/ext_image_dma_buf_import/sample_common.c
index 276d8a116a24..076d6245edfa 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_common.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_common.c
@@ -96,8 +96,6 @@ sample_tex(GLuint tex, unsigned w, unsigned h)
 	glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
 	glUniform1i(glGetUniformLocation(prog, "sampler"), 0);
 
-	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
 	glViewport(0, 0, w, h);
 	piglit_draw_rect_tex(-1, -1, 2, 2,
 			     0, 0, 1, 1);
diff --git a/tests/spec/ext_image_dma_buf_import/sample_rgb.c b/tests/spec/ext_image_dma_buf_import/sample_rgb.c
index 420cc8c3111e..af9b39ff637b 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_rgb.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_rgb.c
@@ -55,9 +55,11 @@ piglit_display(void)
 		src[ 6], src[ 5], src[ 4], force_alpha_to_one ? 255 : src[ 7],
 		src[10], src[ 9], src[ 8], force_alpha_to_one ? 255 : src[11],
 		src[14], src[13], src[12], force_alpha_to_one ? 255 : src[15] };
-	enum piglit_result res = dma_buf_create_and_sample_32bpp(
-					2, 2, 4, fourcc, src);
+	enum piglit_result res;
 
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+	res = dma_buf_create_and_sample_32bpp(2, 2, 4, fourcc, src);
 	if (res != PIGLIT_PASS)
 		return res;
 
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index a7b78f9de20a..1fb8de638831 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -106,6 +106,8 @@ piglit_display(void)
 		return PIGLIT_SKIP;
 	}
 
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
 	res = dma_buf_create_and_sample_32bpp(4, 4, 1, fourcc, t);
 	if (res != PIGLIT_PASS)
 		return res;
-- 
2.8.1



More information about the Piglit mailing list