[Piglit] [PATCH 20/45] gen_shader_bit_encoding_tests.py: simplify extension handling
Dylan Baker
baker.dylan.c at gmail.com
Wed Nov 12 15:46:02 PST 2014
The original code was designed to handle the requirements of multiple
extensions. However, the generator never uses multiple extensions, so
this adds a lot of needless complexity. This patch simplifies the
generator to simply check if an extension is required or not
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
generated_tests/gen_shader_bit_encoding_tests.py | 9 +++------
.../gen_shader_bit_encoding_tests/template.shader_test.mako | 12 ++++++------
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/generated_tests/gen_shader_bit_encoding_tests.py b/generated_tests/gen_shader_bit_encoding_tests.py
index cbed383..ff9d406 100644
--- a/generated_tests/gen_shader_bit_encoding_tests.py
+++ b/generated_tests/gen_shader_bit_encoding_tests.py
@@ -106,7 +106,7 @@ requirements = {
},
'glsl-3.30': {
'version': '3.30',
- 'extension': ''
+ 'extension': None
}
}
@@ -114,9 +114,6 @@ requirements = {
def main():
"""main function."""
for api, requirement in requirements.iteritems():
- version = requirement['version']
- extensions = [requirement['extension']] if requirement['extension'] else []
-
for func, attrib in funcs:
for execution_stage in ('vs', 'fs'):
for in_modifier_func, modifier_func in modifier_funcs.iteritems():
@@ -145,8 +142,8 @@ def main():
with open(filename, 'w') as f:
f.write(TEMPLATE.render(
- version=version,
- extensions=extensions,
+ version=requirement['version'],
+ extension=requirement['extension'],
execution_stage=execution_stage,
func=func,
funcs=attrib,
diff --git a/generated_tests/templates/gen_shader_bit_encoding_tests/template.shader_test.mako b/generated_tests/templates/gen_shader_bit_encoding_tests/template.shader_test.mako
index 75ead4c..c9843dd 100644
--- a/generated_tests/templates/gen_shader_bit_encoding_tests/template.shader_test.mako
+++ b/generated_tests/templates/gen_shader_bit_encoding_tests/template.shader_test.mako
@@ -1,14 +1,14 @@
[require]
GLSL >= ${version}
-% for extension in extensions:
+% if extension:
${extension}
-% endfor
+% endif
[vertex shader]
% if execution_stage == 'vs':
-% for extension in extensions:
+% if extension:
#extension ${extension}: enable
-% endfor
+% endif
uniform ${funcs.input_type} given;
uniform ${funcs.output_type} expected;
@@ -36,9 +36,9 @@ void main() {
[fragment shader]
% if execution_stage == 'fs':
-% for extension in extensions:
+% if extension:
#extension ${extension}: enable
-% endfor
+% endif
uniform ${funcs.input_type} given;
uniform ${funcs.output_type} expected;
--
2.1.3
More information about the Piglit
mailing list