[Piglit] [PATCH 1/2] util: Observe piglit_tolerance in piglit_probe_image_ubyte()
Kristian Høgsberg
hoegsberg at gmail.com
Wed May 25 22:09:54 UTC 2016
From: Kristian Høgsberg Kristensen <kristian.h.kristensen at intel.com>
---
tests/util/piglit-util-gl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index a96ab27..727a901 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1792,7 +1792,9 @@ piglit_probe_image_ubyte(int x, int y, int w, int h, GLenum format,
const GLubyte *probe = &pixels[(j * w + i) * c];
for (p = 0; p < c; ++p) {
- if (probe[p] == expected[p])
+
+ const int tolerance = ceil(piglit_tolerance[p] * 255);
+ if (abs((int)probe[p] - (int)expected[p]) < tolerance)
continue;
printf("Probe at (%i,%i)\n", x + i, y + j);
--
2.5.0
More information about the Piglit
mailing list