summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2015-09-16 10:02:41 -0400
committerIan Romanick <ian.d.romanick@intel.com>2019-06-26 08:31:49 -0700
commit8dec0fabab5df61dbbfffa282dea8eaa4aa908cb (patch)
tree046c96463b8027201fa0661069fd82b7e6993a04
parentf0dbd94b2939461cdab9e9bf32c5e84a2a4cd96e (diff)
degenerate-prims: Add tests that draw one primitive and have some extra data
For GL_LINES, GL_TRIANGLES, GL_QUADS, and GL_QUAD_STRIP, add tests that are one vertex short of two primitives. This should draw something. We don't check exactly what's drawn because, well, it's hard. This is mostly try to reproduce a crash in some Mesa drivers. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38109
-rw-r--r--tests/general/degenerate-prims.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/general/degenerate-prims.c b/tests/general/degenerate-prims.c
index e46d5c2be..3403ed099 100644
--- a/tests/general/degenerate-prims.c
+++ b/tests/general/degenerate-prims.c
@@ -95,7 +95,9 @@ piglit_display(void)
static const float
verts2[2][2] = { {-1, -1}, {1, 1} },
verts3[3][2] = { {-1, -1}, {1, -1}, {0, 1} },
- verts4[4][2] = { {-1, -1}, {1, -1}, {1, 1}, {-1, 1} };
+ verts4[4][2] = { {-1, -1}, {1, -1}, {1, 1}, {-1, 1} },
+ verts5[8][2] = { {-1, -1}, {0, -1}, {0, 1}, {-1, 1},
+ {0, -1}, {1, -1}, {1, 1}, {0, 1} };
enum piglit_result result = PIGLIT_PASS;
glMatrixMode(GL_PROJECTION);
@@ -107,13 +109,17 @@ piglit_display(void)
struct test_data data[] = {
{ GL_POINTS, 0, verts2, true },
{ GL_LINES, 1, verts2, true },
+ { GL_LINES, 3, verts5, false },
{ GL_LINE_STRIP, 1, verts2, true },
{ GL_LINE_LOOP, 1, verts2, true },
{ GL_TRIANGLES, 2, verts3, true },
+ { GL_TRIANGLES, 5, verts5, false },
{ GL_TRIANGLE_STRIP, 2, verts3, true },
{ GL_TRIANGLE_FAN, 2, verts3, true },
{ GL_QUADS, 3, verts4, true },
+ { GL_QUADS, 7, verts5, false },
{ GL_QUAD_STRIP, 3, verts4, true },
+ { GL_QUAD_STRIP, 5, verts5, false },
{ GL_POLYGON, 2, verts4, true },
};