[Piglit] [PATCH] draw-vertices-2101010: add half-scale color tests
Chris Forbes
chrisf at ijw.co.nz
Wed Nov 21 17:58:40 PST 2012
Picks up the driver not bothering to normalize attribute values.
This was broken in an early version of my i965 support for this
extension.
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
.../arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
index a4abf35..2e25e7c 100644
--- a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
+++ b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
@@ -98,10 +98,14 @@ static void test_packed_int_color_vertices(float x1, float y1, float x2, float y
v[1] = iconv(x1, y2, 0, 1);
v[2] = iconv(x2, y1, 0, 1);
- if (index == 0 || index == 2) {
+ if (index == 0 || index == 2 || index == 5) {
c[0] = iconv(511, 0, 0, 0);
c[1] = iconv(511, 0, 0, 0);
c[2] = iconv(511, 0, 0, 0);
+ } else if (index == 4) {
+ c[0] = iconv(254, 0, 0, 0);
+ c[1] = iconv(254, 0, 0, 0);
+ c[2] = iconv(254, 0, 0, 0);
} else {
c[0] = conv(1023, 0, 0, 0);
c[1] = conv(1023, 0, 0, 0);
@@ -116,6 +120,8 @@ static void test_packed_int_color_vertices(float x1, float y1, float x2, float y
case 1: vbo = vboColorPointer(4, GL_UNSIGNED_INT_2_10_10_10_REV, 4, c, sizeof(c), 0); break;
case 2: vbo = vboColorPointer(GL_BGRA, GL_INT_2_10_10_10_REV, 4, c, sizeof(c), 0); break;
case 3: vbo = vboColorPointer(GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, 4, c, sizeof(c), 0); break;
+ case 4: vbo = vboColorPointer(4, GL_INT_2_10_10_10_REV, 4, c, sizeof(c), 0); break;
+ case 5: vbo = vboColorPointer(4, GL_UNSIGNED_INT_2_10_10_10_REV, 4, c, sizeof(c), 0); break;
}
glDrawArrays(GL_TRIANGLES, 0, 3);
@@ -197,6 +203,8 @@ struct test tests[] = {
{test_packed_int_color_vertices, 1, {1, 0, 0, 0}, "Unsigned Int Color - 2/10/10/10"},
{test_packed_int_color_vertices, 2, {0, 0, 1, 0.333}, "Int BGRA Color - 2/10/10/10"},
{test_packed_int_color_vertices, 3, {0, 0, 1, 0}, "Unsigned Int BGRA Color - 2/10/10/10"},
+ {test_packed_int_color_vertices, 4, {0.5f, 0, 0, 0.333}, "Half-scale Int Color - 2/10/10/10"},
+ {test_packed_int_color_vertices, 5, {0.5f, 0, 0, 0}, "Half-scale Unsigned Int Color - 2/10/10/10"},
{test_int_vertices_abi, 0, {1, 0, 0, 1}, "Int 2/10/10/10 - test ABI" },
{test_int_vertices_abi, 1, {1, 0, 0, 1}, "Unsigned 2/10/10/10 - test ABI" },
--
1.8.0
More information about the Piglit
mailing list