Commit dc02bdd9 authored by Paul Berry's avatar Paul Berry
Browse files

Transform feedback: eliminate test dependency on tessellation order.



The transform feedback tests interleaved.c and position.c were
assuming that a GL_QUAD whose vertices are ABCD is tessellated into
triangle ABD followed by triangle BCD.  This is not a reliable
assumption--according to the EXT_transform_feedback spec, "the order
of tessellation within a primitive is undefined".  This was causing
these tests to fail on the nVidia proprietary Linux driver, which
tessellates quad ABCD as ABC followed by ACD.

This patch chnges interleaved.c and position.c so that they specify
triangles explicitly using glDrawElements(GL_TRIANGLES).  The expected
output is the same, but the test behavior no longer depends on how the
driver tessellates quads.

Fixes bogus failures on nVidia:
- interleaved-attribs
- position-readback-bufferbase
- position-readback-bufferbase-discard
- position-readback-bufferrange
- position-readback-bufferrange-discard
- position-render-bufferrange
- position-render-bufferrange-discard
Acked-by: Marek Olšák's avatarMarek Olšák <maraeo@gmail.com>
parent fd0cf853
......@@ -115,6 +115,9 @@ enum piglit_result piglit_display(void)
20, 20,
20, 10
};
static const unsigned indices[] = {
0, 1, 3, 1, 2, 3
};
static const float expected[] = {
0.550000, 0.660000, 0.770000,
1.000000, 0.900000, 0.800000, 0.700000,
......@@ -161,7 +164,7 @@ enum piglit_result piglit_display(void)
glEnable(GL_RASTERIZER_DISCARD);
piglit_BeginTransformFeedback(GL_TRIANGLES);
glVertexPointer(2, GL_FLOAT, 0, verts);
glDrawArrays(GL_QUADS, 0, 4);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, indices);
piglit_EndTransformFeedback();
glDisable(GL_RASTERIZER_DISCARD);
......
......@@ -180,6 +180,9 @@ enum piglit_result piglit_display(void)
-0.375000, 0.250000, 0.000000, 1.000000,
-0.375000, -0.375000, 0.000000, 1.000000,
};
static const unsigned indices[] = {
0, 1, 3, 1, 2, 3
};
static const float clearcolor[] = {0.2, 0.2, 0.2};
static const float white[] = {1, 1, 1};
static const float red[] = {1, 0, 0};
......@@ -206,7 +209,7 @@ enum piglit_result piglit_display(void)
piglit_BeginTransformFeedback(GL_TRIANGLES);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glVertexPointer(2, GL_FLOAT, 0, verts);
glDrawArrays(GL_QUADS, 0, 4);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, indices);
piglit_EndTransformFeedback();
if (discard)
glDisable(GL_RASTERIZER_DISCARD_EXT);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment