[Piglit] [PATCH v2] Modify RASTERIZER_DISCARD test to try also drawing lines and points.
Paul Berry
stereotype441 at gmail.com
Wed Jan 11 15:08:36 PST 2012
Previously, the RASTERIZER_DISCARD test only tried drawing a filled
rectangle (which is typically implemented by drawing two triangles).
This patch modifies the test to verify that RASTERIZER_DISCARD also
properly discards lines and points.
Verified using the nVidia proprietary driver for Linux and using Mesa
i965 on Sandy Bridge.
v2: use glDrawArrays instead of glBegin/glEnd paradigm.
---
.../ext_transform_feedback/discard-drawarrays.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/tests/spec/ext_transform_feedback/discard-drawarrays.c b/tests/spec/ext_transform_feedback/discard-drawarrays.c
index a9ffa39..ce8ec7e 100644
--- a/tests/spec/ext_transform_feedback/discard-drawarrays.c
+++ b/tests/spec/ext_transform_feedback/discard-drawarrays.c
@@ -50,6 +50,12 @@ piglit_display(void)
{
bool pass = true;
float green[4] = {0.0, 1.0, 0.0, 0.0};
+ float vertex_data[] = {
+ -0.5, -0.5,
+ 0.5, -0.5,
+ 0.0, 0.5,
+ 0.0, 0.0
+ };
glDisable(GL_RASTERIZER_DISCARD);
glColor4f(0.0, 1.0, 0.0, 0.0);
@@ -58,6 +64,10 @@ piglit_display(void)
glEnable(GL_RASTERIZER_DISCARD);
glColor4f(1.0, 0.0, 0.0, 0.0);
piglit_draw_rect(-1, -1, 2, 2);
+ glVertexPointer(2, GL_FLOAT, 0, vertex_data);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glDrawArrays(GL_LINE_LOOP, 0, 3);
+ glDrawArrays(GL_POINTS, 3, 1);
pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, green);
--
1.7.6.5
More information about the Piglit
mailing list