[Piglit] [PATCH 1/2] Transform feedback: Refactor output-type tests into a loop in all.tests.

Paul Berry stereotype441 at gmail.com
Tue Jan 3 22:31:43 PST 2012


This will make it more straightforward to add tests of transform
feedback of non-subscripted arrays.
---
 tests/all.tests |   50 ++++++++------------------------------------------
 1 files changed, 8 insertions(+), 42 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index 9ad78fa..e70baf8 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1483,48 +1483,14 @@ for alignment in [0, 4, 8, 12]:
         ext_transform_feedback[test_name] = PlainExecTest(
                 'ext_transform_feedback-{0} -auto'.format(test_name))
 
-ext_transform_feedback['output-type float'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'float'])
-ext_transform_feedback['output-type float[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'float[2]'])
-ext_transform_feedback['output-type vec2'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'vec2'])
-ext_transform_feedback['output-type vec2[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'vec2[2]'])
-ext_transform_feedback['output-type vec3'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'vec3'])
-ext_transform_feedback['output-type vec3[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'vec3[2]'])
-ext_transform_feedback['output-type vec4'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'vec4'])
-ext_transform_feedback['output-type vec4[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'vec4[2]'])
-ext_transform_feedback['output-type mat2'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat2'])
-ext_transform_feedback['output-type mat2[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat2[2]'])
-ext_transform_feedback['output-type mat2x3'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat2x3'])
-ext_transform_feedback['output-type mat2x3[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat2x3[2]'])
-ext_transform_feedback['output-type mat2x4'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat2x4'])
-ext_transform_feedback['output-type mat2x4[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat2x4[2]'])
-ext_transform_feedback['output-type mat3x2'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat3x2'])
-ext_transform_feedback['output-type mat3x2[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat3x2[2]'])
-ext_transform_feedback['output-type mat3'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat3'])
-ext_transform_feedback['output-type mat3[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat3[2]'])
-ext_transform_feedback['output-type mat3x4'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat3x4'])
-ext_transform_feedback['output-type mat3x4[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat3x4[2]'])
-ext_transform_feedback['output-type mat4x2'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat4x2'])
-ext_transform_feedback['output-type mat4x2[2]'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat4x2[2]'])
-ext_transform_feedback['output-type mat4x3'] = PlainExecTest(['ext_transform_feedback-output-type', '-auto', 'mat4x3'])
-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]'])
+for output_type in ['float', 'vec2', 'vec3', 'vec4', 'mat2', 'mat2x3',
+                    'mat2x4', 'mat3x2', 'mat3', 'mat3x4', 'mat4x2', 'mat4x3',
+                    'mat4', 'int', 'ivec2', 'ivec3', 'ivec4', 'uint', 'uvec2',
+                    'uvec3', 'uvec4']:
+        for suffix in ['', '[2]']:
+                test_name = 'output-type {0}{1}'.format(output_type, suffix)
+                ext_transform_feedback[test_name] = PlainExecTest(
+                        'ext_transform_feedback-{0} -auto'.format(test_name))
 
 for mode in ['discard', 'buffer', 'prims_generated', 'prims_written']:
         test_name = 'generatemipmap {0}'.format(mode)
-- 
1.7.6.5



More information about the Piglit mailing list