summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylanx.c.baker@intel.com>2014-11-14 16:19:27 -0800
committerDylan Baker <dylanx.c.baker@intel.com>2014-11-24 11:46:53 -0800
commit40b5e47b8e4039ac98087b92e0b528e3a5ee6a69 (patch)
treec00340738c53bf3e4b4083be561fff15a154416f
parent40d7e4ff589aa04bd08214e4e6786cced2394f6b (diff)
gen_shader_bit_encoding_tests.py: move dirname assignment up in loops
The directory name doesn't depend on values in the inner loops; so we can generate it once and check for its existence once. v2: - add this patch Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--generated_tests/gen_shader_bit_encoding_tests.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/generated_tests/gen_shader_bit_encoding_tests.py b/generated_tests/gen_shader_bit_encoding_tests.py
index 5d5ee8a18..8c48f7016 100644
--- a/generated_tests/gen_shader_bit_encoding_tests.py
+++ b/generated_tests/gen_shader_bit_encoding_tests.py
@@ -136,6 +136,11 @@ def main():
version = requirement['version']
extensions = [requirement['extension']] if requirement['extension'] else []
+ dirname = os.path.join('spec', api.lower(), 'execution',
+ 'built-in-functions')
+ if not os.path.exists(dirname):
+ os.makedirs(dirname)
+
for func, attrib in FUNCS.iteritems():
in_func = attrib['in_func']
out_func = attrib['out_func']
@@ -150,18 +155,11 @@ def main():
modifier_name = '-' + in_modifier_func if in_modifier_func != '' else ''
filename = os.path.join(
- 'spec',
- api.lower(),
- 'execution',
- 'built-in-functions',
+ dirname,
"{0}-{1}{2}.shader_test".format(execution_stage, func,
modifier_name))
print(filename)
- dirname = os.path.dirname(filename)
- if not os.path.exists(dirname):
- os.makedirs(dirname)
-
if in_modifier_func == 'neg':
in_modifier_func = '-'
elif in_modifier_func == 'neg_abs':