Commit 8d287c50 authored by Dylan Baker's avatar Dylan Baker
Browse files

gen_texture_query_lod_tests.py: Use if __name__ == __main__ pattern


Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
parent 9406a6f6
......@@ -105,22 +105,25 @@ TEMPLATE = Template(dedent("""\
void main()
{
% if execution_stage == 'fs':
gl_FragColor.xy = textureQuery${Lod}(s, coord);
gl_FragColor.xy = textureQuery${lod}(s, coord);
% else:
gl_Position.xy = textureQuery${Lod}(s, coord);
gl_Position.xy = textureQuery${lod}(s, coord);
% endif
}
"""))
for api, requirement in REQUIREMENTS.iteritems():
Lod = 'Lod' if api == 'glsl-4.00' else 'LOD'
def main():
"""Main function."""
for api, requirement in REQUIREMENTS.iteritems():
lod = 'Lod' if api == 'glsl-4.00' else 'LOD'
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",
"textureQuery{0}-{1}.{2}".format(Lod, sampler_type,
"textureQuery{0}-{1}.{2}".format(lod, sampler_type,
file_extension))
print(filename)
......@@ -144,4 +147,8 @@ for api, requirement in REQUIREMENTS.iteritems():
execution_stage=execution_stage,
sampler_type=sampler_type,
coord_type=coord_type,
Lod=Lod))
lod=lod))
if __name__ == '__main__':
main()
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