[Piglit] [PATCH] tests/spec/arb_robustness/draw-vbo-bounds.c: add clipping

sroland at vmware.com sroland at vmware.com
Mon Oct 29 16:05:24 PDT 2012


From: Roland Scheidegger <sroland at vmware.com>

Make sure clipping is needed sometimes, and more often use small index counts,
to expose issues and excercise more paths in mesa's draw module.
---
 tests/spec/arb_robustness/draw-vbo-bounds.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_robustness/draw-vbo-bounds.c b/tests/spec/arb_robustness/draw-vbo-bounds.c
index 4351ac9..c780a3a 100644
--- a/tests/spec/arb_robustness/draw-vbo-bounds.c
+++ b/tests/spec/arb_robustness/draw-vbo-bounds.c
@@ -95,7 +95,7 @@ random_vertices(GLsizei offset, GLsizei stride, GLsizei count)
 
     for (i = 0; i < count; ++i) {
         GLfloat *vertex = (GLfloat *)(vertices + offset + i*stride);
-        vertex[0] = (rand() % 1000) * .001;
+        vertex[0] = (rand() % 1000) * ((rand() % 1000) ? 0.001 : 1.0);
         vertex[1] = (rand() % 1000) * .001;
     }
 
@@ -145,7 +145,7 @@ static void test(void)
     vertex_count = 1 + rand() % 0xffff;
 
     index_offset = (rand() % 0xff) * sizeof(GLushort);
-    index_count = 1 + rand() % 0xffff;
+    index_count = rand() % 10 ? 1 + rand() % 0xffff : 1 + rand() % 0x7ff;
     min_index = rand() % vertex_count;
     max_index = min_index + rand() % (vertex_count - min_index);
 
-- 
1.7.9.5



More information about the Piglit mailing list