[Piglit] [PATCH 4/5] util/gl: Add a helper for probing a rect of varying data

Jason Ekstrand jason at jlekstrand.net
Fri Jun 8 01:08:01 UTC 2018


All the other helpers can only assert that a given rectangle is the
given solid color; this one takes an array of pixel data.
---
 tests/util/piglit-util-gl.c | 8 ++++++++
 tests/util/piglit-util-gl.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index a19eef5f0..06715ed6b 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1467,6 +1467,14 @@ piglit_probe_rect_rgba(int x, int y, int w, int h, const float *expected)
 	return probe_rect(x, y, w, h, 4, expected, 0, 0, false);
 }
 
+int piglit_probe_rect_rgba_varying(int x, int y, int w, int h,
+				   const float* expected, size_t stride)
+{
+	assert(stride % sizeof(float) == 0);
+	return probe_rect(x, y, w, h, 4, expected,
+			  4, stride / sizeof(float), false);
+}
+
 int
 piglit_probe_rect_rgba_int(int x, int y, int w, int h, const int *expected)
 {
diff --git a/tests/util/piglit-util-gl.h b/tests/util/piglit-util-gl.h
index 7b1cee564..ccad1adab 100644
--- a/tests/util/piglit-util-gl.h
+++ b/tests/util/piglit-util-gl.h
@@ -150,6 +150,8 @@ int piglit_probe_rect_r_ubyte(int x, int y, int w, int h, GLubyte expected);
 int piglit_probe_rect_rgb(int x, int y, int w, int h, const float* expected);
 int piglit_probe_rect_rgb_silent(int x, int y, int w, int h, const float *expected);
 int piglit_probe_rect_rgba(int x, int y, int w, int h, const float* expected);
+int piglit_probe_rect_rgba_varying(int x, int y, int w, int h,
+				   const float* expected, size_t stride);
 int piglit_probe_rect_rgba_int(int x, int y, int w, int h, const int* expected);
 int piglit_probe_rect_rgba_uint(int x, int y, int w, int h, const unsigned int* expected);
 bool piglit_probe_rect_two_rgb(int x, int y, int w, int h,
-- 
2.17.1



More information about the Piglit mailing list