Commit 1aafca6a authored by Dylan Baker's avatar Dylan Baker
Browse files

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: default avatarDylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
parent 8d287c50
......@@ -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 []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment