summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylanx.c.baker@intel.com>2014-11-11 15:20:53 -0800
committerDylan Baker <dylanx.c.baker@intel.com>2014-11-24 11:53:22 -0800
commit1aafca6a4e8746fd73fca374afb985152acfff74 (patch)
treea766c265a846fccb6f61005e6d7b1b706c2af33a
parent8d287c50089116c201ef082a24d88a696899dea6 (diff)
gen_texture_query_lod_tests.py: move file generation up in loop
This moves the directory name generation and existence checking/creation out of two loops, and allowing for more reuse. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--generated_tests/gen_texture_query_lod_tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/generated_tests/gen_texture_query_lod_tests.py b/generated_tests/gen_texture_query_lod_tests.py
index 00eb00778..03cc13f0c 100644
--- a/generated_tests/gen_texture_query_lod_tests.py
+++ b/generated_tests/gen_texture_query_lod_tests.py
@@ -117,20 +117,20 @@ def main():
"""Main function."""
for api, requirement in REQUIREMENTS.iteritems():
lod = 'Lod' if api == 'glsl-4.00' else 'LOD'
+ dirname = os.path.join("spec", api.lower(), "compiler",
+ "built-in-functions")
+ if not os.path.exists(dirname):
+ os.makedirs(dirname)
for sampler_type, coord_type in SAMPLER_TYPE_TO_COORD_TYPE.iteritems():
for execution_stage in ("vs", "fs"):
file_extension = 'frag' if execution_stage == 'fs' else 'vert'
filename = os.path.join(
- "spec", api.lower(), "compiler", "built-in-functions",
+ dirname,
"textureQuery{0}-{1}.{2}".format(lod, sampler_type,
file_extension))
print(filename)
- dirname = os.path.dirname(filename)
- if not os.path.exists(dirname):
- os.makedirs(dirname)
-
version = requirement['version']
extensions = [requirement['extension']] if requirement['extension'] else []