[Piglit] [PATCH] Transform feedback: Add tests of integral output types.
Paul Berry
stereotype441 at gmail.com
Wed Dec 21 09:21:34 PST 2011
When GLSL version 1.30 is supported, transform feedback can output
integral types (uint, int, uvec, and ivec). This patch expands the
existing EXT_transform_feedback/output-type tests to validate those
integral types.
Verified on the closed-source nVidia Linux driver and on Mesa master
using Intel Sandy Bridge.
---
tests/all.tests | 16 +
tests/spec/ext_transform_feedback/output-type.c | 445 ++++++++++++++++++++---
2 files changed, 403 insertions(+), 58 deletions(-)
diff --git a/tests/all.tests b/tests/all.tests
index d6de6f3..4aab158 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1457,6 +1457,22 @@ ext_transform_feedback['output-type mat4x3'] = PlainExecTest(['ext_transform_fee
ext_transform_feedback['output-type mat4x3[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat4x3[2]'])
ext_transform_feedback['output-type mat4'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat4'])
ext_transform_feedback['output-type mat4[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat4[2]'])
+ext_transform_feedback['output-type int'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'int'])
+ext_transform_feedback['output-type int[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'int[2]'])
+ext_transform_feedback['output-type ivec2'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'ivec2'])
+ext_transform_feedback['output-type ivec2[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'ivec2[2]'])
+ext_transform_feedback['output-type ivec3'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'ivec3'])
+ext_transform_feedback['output-type ivec3[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'ivec3[2]'])
+ext_transform_feedback['output-type ivec4'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'ivec4'])
+ext_transform_feedback['output-type ivec4[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'ivec4[2]'])
+ext_transform_feedback['output-type uint'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uint'])
+ext_transform_feedback['output-type uint[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uint[2]'])
+ext_transform_feedback['output-type uvec2'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uvec2'])
+ext_transform_feedback['output-type uvec2[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uvec2[2]'])
+ext_transform_feedback['output-type uvec3'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uvec3'])
+ext_transform_feedback['output-type uvec3[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uvec3[2]'])
+ext_transform_feedback['output-type uvec4'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uvec4'])
+ext_transform_feedback['output-type uvec4[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'uvec4[2]'])
arb_transform_feedback2 = Group()
spec['ARB_transform_feedback2'] = arb_transform_feedback2
diff --git a/tests/spec/ext_transform_feedback/output-type.c b/tests/spec/ext_transform_feedback/output-type.c
index d9b4484..48ddfc7 100644
--- a/tests/spec/ext_transform_feedback/output-type.c
+++ b/tests/spec/ext_transform_feedback/output-type.c
@@ -39,8 +39,10 @@ struct test_desc {
const char *vs;
unsigned num_varyings;
const char *varyings[16];
+ bool is_floating_point;
unsigned num_elements;
- float expected[256];
+ float expected_float[256];
+ GLint expected_int[256];
} tests[] = {
{
"float", /* name */
@@ -55,8 +57,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 1, /* num_elements, expected */
- {666}
+ true, /* is_floating_point */
+ 1, /* num_elements, expected_float, expected_int */
+ {666}, {}
},
{
"float[2]", /* name */
@@ -71,8 +74,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 2, /* num_elements, expected */
- {666, 0.123}
+ true, /* is_floating_point */
+ 2, /* num_elements, expected_float, expected_int */
+ {666, 0.123}, {}
},
{
"vec2", /* name */
@@ -87,8 +91,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 2, /* num_elements, expected */
- {666, 999}
+ true, /* is_floating_point */
+ 2, /* num_elements, expected_float, expected_int */
+ {666, 999}, {}
},
{
"vec2[2]", /* name */
@@ -103,8 +108,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 4, /* num_elements, expected */
- {666, 999, -1.5, -20.0}
+ true, /* is_floating_point */
+ 4, /* num_elements, expected_float, expected_int */
+ {666, 999, -1.5, -20.0}, {}
},
{
"vec3", /* name */
@@ -119,8 +125,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 3, /* num_elements, expected */
- {666, 999, -2}
+ true, /* is_floating_point */
+ 3, /* num_elements, expected_float, expected_int */
+ {666, 999, -2}, {}
},
{
"vec3[2]", /* name */
@@ -135,8 +142,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 6, /* num_elements, expected */
- {666, 999, -2, 0.4, 1.4, 3.5}
+ true, /* is_floating_point */
+ 6, /* num_elements, expected_float, expected_int */
+ {666, 999, -2, 0.4, 1.4, 3.5}, {}
},
{
"vec4", /* name */
@@ -151,8 +159,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 4, /* num_elements, expected */
- {0.666, 666, 999, -2}
+ true, /* is_floating_point */
+ 4, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2}, {}
},
{
"vec4[2]", /* name */
@@ -167,8 +176,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 8, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.5, -0.4, 30.0, 40.0}
+ true, /* is_floating_point */
+ 8, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.5, -0.4, 30.0, 40.0}, {}
},
{
"mat2", /* name */
@@ -183,8 +193,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 4, /* num_elements, expected */
- {0.666, 666, 999, -2}
+ true, /* is_floating_point */
+ 4, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2}, {}
},
{
"mat2[2]", /* name */
@@ -200,8 +211,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 8, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.34, 0.65, 0.14, -0.97}
+ true, /* is_floating_point */
+ 8, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.34, 0.65, 0.14, -0.97}, {}
},
{
"mat2x3", /* name */
@@ -216,8 +228,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 6, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.5, -0.4}
+ true, /* is_floating_point */
+ 6, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.5, -0.4}, {}
},
{
"mat2x3[2]", /* name */
@@ -233,8 +246,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 12, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.5, -0.4, 0.34, 0.12, -10.0, 30.1, 5.3, 9.8}
+ true, /* is_floating_point */
+ 12, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.5, -0.4, 0.34, 0.12, -10.0, 30.1, 5.3, 9.8}, {}
},
{
"mat2x4", /* name */
@@ -249,8 +263,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 8, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.5, -0.4, 30, 40}
+ true, /* is_floating_point */
+ 8, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.5, -0.4, 30, 40}, {}
},
{
"mat2x4[2]", /* name */
@@ -266,8 +281,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 16, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.5, -0.4, 30, 40, 0.12, 0.24, 0.34, 0.56, 0.67, 0.78, 0.89, 0.04}
+ true, /* is_floating_point */
+ 16, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.5, -0.4, 30, 40, 0.12, 0.24, 0.34, 0.56, 0.67, 0.78, 0.89, 0.04}, {}
},
{
"mat3x2", /* name */
@@ -283,8 +299,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 6, /* num_elements, expected */
- {0.666, 666.0, 999.0, -2.0, 0.2, 5.0}
+ true, /* is_floating_point */
+ 6, /* num_elements, expected_float, expected_int */
+ {0.666, 666.0, 999.0, -2.0, 0.2, 5.0}, {}
},
{
"mat3x2[2]", /* name */
@@ -300,8 +317,9 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 12, /* num_elements, expected */
- {0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 0.98, 0.87, 0.76, 0.65, 0.54, 0.43}
+ true, /* is_floating_point */
+ 12, /* num_elements, expected_float, expected_int */
+ {0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 0.98, 0.87, 0.76, 0.65, 0.54, 0.43}, {}
},
{
"mat3", /* name */
@@ -318,8 +336,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 9, /* num_elements, expected */
- {0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 3.0, 0.3, -10.0}
+ true, /* is_floating_point */
+ 9, /* num_elements, expected_float, expected_int */
+ {0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 3.0, 0.3, -10.0}, {}
},
{
"mat3[2]", /* name */
@@ -337,9 +356,10 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 18, /* num_elements, expected */
+ true, /* is_floating_point */
+ 18, /* num_elements, expected_float, expected_int */
{0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 3.0, 0.3, -10.0,
- 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6, 8.0}
+ 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6, 8.0}, {}
},
{
"mat3x4", /* name */
@@ -357,8 +377,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 12, /* num_elements, expected */
- {0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 3.0, 0.3, -10.0, 0.4, -4.1, -5.9}
+ true, /* is_floating_point */
+ 12, /* num_elements, expected_float, expected_int */
+ {0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 3.0, 0.3, -10.0, 0.4, -4.1, -5.9}, {}
},
{
"mat3x4[2]", /* name */
@@ -376,9 +397,10 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 24, /* num_elements, expected */
+ true, /* is_floating_point */
+ 24, /* num_elements, expected_float, expected_int */
{0.666, 666.0, 999.0, -2.0, 0.2, 5.0, 3.0, 0.3, -10.0, 0.4, -4.1, -5.9,
- 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6, 8.0, 0.4, -4.1, -5.9}
+ 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6, 8.0, 0.4, -4.1, -5.9}, {}
},
{
"mat4x2", /* name */
@@ -393,8 +415,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 8, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.5, -0.4, 30, 40}
+ true, /* is_floating_point */
+ 8, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.5, -0.4, 30, 40}, {}
},
{
"mat4x2[2]", /* name */
@@ -410,9 +433,10 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 16, /* num_elements, expected */
+ true, /* is_floating_point */
+ 16, /* num_elements, expected_float, expected_int */
{0.666, 666, 999, -2, 0.5, -0.4, 30, 40,
- 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6}
+ 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6}, {}
},
{
"mat4x3", /* name */
@@ -429,8 +453,9 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 12, /* num_elements, expected */
- {0.666, 666, 999, -2, 0.5, -0.4, 30, 40, 0.3, 0.2, 0.1, 0.4}
+ true, /* is_floating_point */
+ 12, /* num_elements, expected_float, expected_int */
+ {0.666, 666, 999, -2, 0.5, -0.4, 30, 40, 0.3, 0.2, 0.1, 0.4}, {}
},
{
"mat4x3[2]", /* name */
@@ -449,9 +474,10 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 24, /* num_elements, expected */
+ true, /* is_floating_point */
+ 24, /* num_elements, expected_float, expected_int */
{0.666, 666, 999, -2, 0.5, -0.4, 30, 40, 0.3, 0.2, 0.1, 0.4,
- 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6, 8.0, 0.4, -4.1, -5.9}
+ 20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6, 8.0, 0.4, -4.1, -5.9}, {}
},
{
"mat4", /* name */
@@ -469,11 +495,12 @@ struct test_desc {
1, /* num_varyings, varyings */
{"r"},
- 16, /* num_elements, expected */
+ true, /* is_floating_point */
+ 16, /* num_elements, expected_float, expected_int */
{0.666, 666.0, 999.0, -2.0,
0.2, 5.0, 3.0, 0.3,
-10.0, 20.1, 52.4, -34.3,
- 45.0, 56.0, 67.0, 78.0}
+ 45.0, 56.0, 67.0, 78.0}, {}
},
{
"mat4[2]", /* name */
@@ -491,13 +518,298 @@ struct test_desc {
2, /* num_varyings, varyings */
{"r[0]", "r[1]"},
- 32, /* num_elements, expected */
+ true, /* is_floating_point */
+ 32, /* num_elements, expected_float, expected_int */
{0.666, 666.0, 999.0, -2.0,
0.2, 5.0, 3.0, 0.3,
-10.0, 20.1, 52.4, -34.3,
45.0, 56.0, 67.0, 78.0,
20.0, 10.0, 5.0, 90.0, -4.0, 3.4, -2.3, -8.6,
- 8.0, 0.4, -4.1, -5.9, -10.0, 0.4, -4.1, -5.9}
+ 8.0, 0.4, -4.1, -5.9, -10.0, 0.4, -4.1, -5.9}, {}
+ },
+ {
+ "int", /* name */
+
+ "#version 130\n"
+ "flat out int r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = 2145948354;"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 1, /* num_elements, expected_float, expected_int */
+ {}, {2145948354}
+ },
+ {
+ "int[2]", /* name */
+
+ "#version 130\n"
+ "flat out int[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = int[2](-362245257,"
+ " 2074398469);"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 2, /* num_elements, expected_float, expected_int */
+ {}, {-362245257, 2074398469}
+ },
+ {
+ "ivec2", /* name */
+
+ "#version 130\n"
+ "flat out ivec2 r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = ivec2(408918569, -69869318);"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 2, /* num_elements, expected_float, expected_int */
+ {}, {408918569, -69869318}
+ },
+ {
+ "ivec2[2]", /* name */
+
+ "#version 130\n"
+ "flat out ivec2[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = ivec2[2](ivec2(5703639, 654049542),"
+ " ivec2(82927237, -1489678625));"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 4, /* num_elements, expected_float, expected_int */
+ {}, {5703639, 654049542, 82927237, -1489678625}
+ },
+ {
+ "ivec3", /* name */
+
+ "#version 130\n"
+ "flat out ivec3 r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = ivec3(1402620337, -931103284, -1922128750);"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 3, /* num_elements, expected_float, expected_int */
+ {}, {1402620337, -931103284, -1922128750}
+ },
+ {
+ "ivec3[2]", /* name */
+
+ "#version 130\n"
+ "flat out ivec3[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = ivec3[2](ivec3(819762795, 292214138, 207695021),"
+ " ivec3(-541769145, -896550370, -322088831));"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 6, /* num_elements, expected_float, expected_int */
+ {}, {819762795, 292214138, 207695021,
+ -541769145, -896550370, -322088831}
+ },
+ {
+ "ivec4", /* name */
+
+ "#version 130\n"
+ "flat out ivec4 r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = ivec4(1979209158, -791559088, -992849733, -59981678);"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 4, /* num_elements, expected_float, expected_int */
+ {}, {1979209158, -791559088, -992849733, -59981678}
+ },
+ {
+ "ivec4[2]", /* name */
+
+ "#version 130\n"
+ "flat out ivec4[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = ivec4[2](ivec4(-764612129, 395402837, -1260359913, 936205122),"
+ " ivec4(-1510453781, -707590649, -760434930, -1756396083));"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 8, /* num_elements, expected_float, expected_int */
+ {}, {-764612129, 395402837, -1260359913, 936205122,
+ -1510453781, -707590649, -760434930, -1756396083}
+ },
+ {
+ "uint", /* name */
+
+ "#version 130\n"
+ "flat out uint r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = 2230472931u;"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 1, /* num_elements, expected_float, expected_int */
+ {}, {2230472931u}
+ },
+ {
+ "uint[2]", /* name */
+
+ "#version 130\n"
+ "flat out uint[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = uint[2](4073369952u,"
+ " 1026348970u);"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 2, /* num_elements, expected_float, expected_int */
+ {}, {4073369952u, 1026348970u}
+ },
+ {
+ "uvec2", /* name */
+
+ "#version 130\n"
+ "flat out uvec2 r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = uvec2(1214092884u, 3587337147u);"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 2, /* num_elements, expected_float, expected_int */
+ {}, {1214092884u, 3587337147u}
+ },
+ {
+ "uvec2[2]", /* name */
+
+ "#version 130\n"
+ "flat out uvec2[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = uvec2[2](uvec2(1011258288u, 684916166u),"
+ " uvec2(381807053u, 3306523233u));"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 4, /* num_elements, expected_float, expected_int */
+ {}, {1011258288u, 684916166u, 381807053u, 3306523233u}
+ },
+ {
+ "uvec3", /* name */
+
+ "#version 130\n"
+ "flat out uvec3 r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = uvec3(1076370307u, 1186562996u, 3616039281u);"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 3, /* num_elements, expected_float, expected_int */
+ {}, {1076370307u, 1186562996u, 3616039281u}
+ },
+ {
+ "uvec3[2]", /* name */
+
+ "#version 130\n"
+ "flat out uvec3[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = uvec3[2](uvec3(2984731006u, 2324137892u, 876349448u),"
+ " uvec3(2493082028u, 1481747175u, 1530233730u));"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 6, /* num_elements, expected_float, expected_int */
+ {}, {2984731006u, 2324137892u, 876349448u,
+ 2493082028u, 1481747175u, 1530233730u}
+ },
+ {
+ "uvec4", /* name */
+
+ "#version 130\n"
+ "flat out uvec4 r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = uvec4(3046379279u, 3265138790u, 4109383147u, 2654056480u);"
+ "}",
+
+ 1, /* num_varyings, varyings */
+ {"r"},
+
+ false, /* is_floating_point */
+ 4, /* num_elements, expected_float, expected_int */
+ {}, {3046379279u, 3265138790u, 4109383147u, 2654056480u}
+ },
+ {
+ "uvec4[2]", /* name */
+
+ "#version 130\n"
+ "flat out uvec4[2] r;" /* vs */
+ "void main() {"
+ " gl_Position = ftransform();"
+ " r = uvec4[2](uvec4(2563680931u, 754130007u, 230209823u, 707580188u),"
+ " uvec4(3015681429u, 3850948302u, 2224673498u, 2376088107u));"
+ "}",
+
+ 2, /* num_varyings, varyings */
+ {"r[0]", "r[1]"},
+
+ false, /* is_floating_point */
+ 8, /* num_elements, expected_float, expected_int */
+ {}, {2563680931u, 754130007u, 230209823u, 707580188u,
+ 3015681429u, 3850948302u, 2224673498u, 2376088107u}
},
{NULL}
@@ -544,6 +856,8 @@ test_ready:
}
piglit_require_GLSL();
piglit_require_transform_feedback();
+ if (!test->is_floating_point)
+ piglit_require_GLSL_version(130);
glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, &maxcomps);
if (maxcomps < test->num_elements) {
@@ -590,7 +904,9 @@ test_ready:
enum piglit_result piglit_display(void)
{
GLboolean pass = GL_TRUE;
- float *ptr;
+ void *ptr;
+ float *ptr_float;
+ GLint *ptr_int;
unsigned i;
static const float verts[NUM_VERTICES*2] = {
10, 10,
@@ -612,12 +928,25 @@ enum piglit_result piglit_display(void)
assert(glGetError() == 0);
ptr = glMapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, GL_READ_ONLY);
+ ptr_float = ptr;
+ ptr_int = ptr;
for (i = 0; i < test->num_elements*NUM_VERTICES; i++) {
- float value = test->expected[i % test->num_elements];
+ if (test->is_floating_point) {
+ float value = test->expected_float[i % test->num_elements];
- if (fabs(ptr[i] - value) > 0.01) {
- printf("Buffer[%i]: %f, Expected: %f\n", i, ptr[i], value);
- pass = GL_FALSE;
+ if (fabs(ptr_float[i] - value) > 0.01) {
+ printf("Buffer[%i]: %f, Expected: %f\n", i,
+ ptr_float[i], value);
+ pass = GL_FALSE;
+ }
+ } else {
+ GLint value = test->expected_int[i % test->num_elements];
+
+ if (ptr_int[i] != value) {
+ printf("Buffer[%i]: %i, Expected: %i\n", i,
+ ptr_int[i], value);
+ pass = GL_FALSE;
+ }
}
}
glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);
--
1.7.6.4
More information about the Piglit
mailing list