Commit 900cb682 authored by Dylan Baker's avatar Dylan Baker
Browse files

gen_texture_query_lod_tests.py: minor refactors


Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
parent 1aafca6a
...@@ -68,11 +68,11 @@ SAMPLER_TYPE_TO_COORD_TYPE = { ...@@ -68,11 +68,11 @@ SAMPLER_TYPE_TO_COORD_TYPE = {
REQUIREMENTS = { REQUIREMENTS = {
'ARB_texture_query_lod': { 'ARB_texture_query_lod': {
'version': '1.30', 'version': '1.30',
'extension': 'GL_ARB_texture_query_lod' 'extensions': 'GL_ARB_texture_query_lod'
}, },
'glsl-4.00': { 'glsl-4.00': {
'version': '4.00', 'version': '4.00',
'extension': '' 'extensions': None
} }
} }
...@@ -123,6 +123,15 @@ def main(): ...@@ -123,6 +123,15 @@ def main():
os.makedirs(dirname) os.makedirs(dirname)
for sampler_type, coord_type in SAMPLER_TYPE_TO_COORD_TYPE.iteritems(): for sampler_type, coord_type in SAMPLER_TYPE_TO_COORD_TYPE.iteritems():
requirements = [requirement['extensions']] if requirement['extensions'] else []
# samplerCubeArray types are part GLSL 4.00
# or GL_ARB_texture_cube_map_array.
if api == "ARB_texture_query_lod" and sampler_type in [
'samplerCubeArray', 'isamplerCubeArray',
'usamplerCubeArray', 'samplerCubeArrayShadow']:
requirements.append('GL_ARB_texture_cube_map_array')
for execution_stage in ("vs", "fs"): for execution_stage in ("vs", "fs"):
file_extension = 'frag' if execution_stage == 'fs' else 'vert' file_extension = 'frag' if execution_stage == 'fs' else 'vert'
filename = os.path.join( filename = os.path.join(
...@@ -131,19 +140,10 @@ def main(): ...@@ -131,19 +140,10 @@ def main():
file_extension)) file_extension))
print(filename) print(filename)
version = requirement['version']
extensions = [requirement['extension']] if requirement['extension'] else []
# samplerCubeArray types are part GLSL 4.00
# or GL_ARB_texture_cube_map_array.
if api == "ARB_texture_query_lod" and sampler_type in [
'samplerCubeArray', 'isamplerCubeArray',
'usamplerCubeArray', 'samplerCubeArrayShadow']:
extensions += ['GL_ARB_texture_cube_map_array']
with open(filename, "w") as f: with open(filename, "w") as f:
f.write(TEMPLATE.render(version=version, f.write(TEMPLATE.render(
extensions=extensions, version=requirement['version'],
extensions=requirements,
execution_stage=execution_stage, execution_stage=execution_stage,
sampler_type=sampler_type, sampler_type=sampler_type,
coord_type=coord_type, coord_type=coord_type,
......
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