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 = {
REQUIREMENTS = {
'ARB_texture_query_lod': {
'version': '1.30',
'extension': 'GL_ARB_texture_query_lod'
'extensions': 'GL_ARB_texture_query_lod'
},
'glsl-4.00': {
'version': '4.00',
'extension': ''
'extensions': None
}
}
......@@ -123,6 +123,15 @@ def main():
os.makedirs(dirname)
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"):
file_extension = 'frag' if execution_stage == 'fs' else 'vert'
filename = os.path.join(
......@@ -131,19 +140,10 @@ def main():
file_extension))
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:
f.write(TEMPLATE.render(version=version,
extensions=extensions,
f.write(TEMPLATE.render(
version=requirement['version'],
extensions=requirements,
execution_stage=execution_stage,
sampler_type=sampler_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