[Piglit] [PATCH 2/4] arb_viewport_array-render_scissor: fix probing for any window size

Brian Paul brianp at vmware.com
Fri May 2 14:53:46 PDT 2014


The float->int conversion can be sketchy for various window sizes.
Simply probe a slightly smaller rect region.
---
 tests/spec/arb_viewport_array/render_scissor.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_viewport_array/render_scissor.c b/tests/spec/arb_viewport_array/render_scissor.c
index 15d9583..1e921a3 100644
--- a/tests/spec/arb_viewport_array/render_scissor.c
+++ b/tests/spec/arb_viewport_array/render_scissor.c
@@ -78,8 +78,8 @@ draw_check_pixels(void)
 			expected[1] =
 			expected[2] = 1.0 / (GLfloat) (1 + j + i*divY);
 			expected[3] = 1.0;
-			p = piglit_probe_rect_rgba(i * w, j * h, w, h,
-						   expected);
+			p = piglit_probe_rect_rgba(i * w + 1, j * h + 1,
+						   w-2, h-2, expected);
 			if (!p) {
 				printf("Wrong color for viewport i,j %d %d\n",
 				       i, j);
-- 
1.7.10.4



More information about the Piglit mailing list