GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit 271b77ad authored by Dylan Baker's avatar Dylan Baker
Browse files

gen_texture_query_lod_tests.py: Split template into templates folder


Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
parent 900cb682
......@@ -41,7 +41,9 @@ piglit_make_generated_tests(
gen_non-lvalue_tests.py)
piglit_make_generated_tests(
texture_query_lod_tests.list
gen_texture_query_lod_tests.py)
gen_texture_query_lod_tests.py
templates/gen_texture_query_lod_tests/template.glsl_parser_test.mako
)
piglit_make_generated_tests(
shader_bit_encoding_tests.list
gen_shader_bit_encoding_tests.py
......
......@@ -24,9 +24,11 @@
from __future__ import print_function
import os
import os.path
from textwrap import dedent
from mako.template import Template
from templates import template_file
TEMPLATE = template_file(os.path.basename(os.path.splitext(__file__)[0]),
'template.glsl_parser_test.mako')
SAMPLER_TYPE_TO_COORD_TYPE = {
'sampler1D': 'float',
......@@ -76,42 +78,6 @@ REQUIREMENTS = {
}
}
TEMPLATE = Template(dedent("""\
/* [config]
% if execution_stage == 'fs':
* expect_result: pass
% else:
* expect_result: fail
% endif
* glsl_version: ${version}
% if extensions:
* require_extensions: ${" ".join(extensions)}
% endif
* [end config]
*/
#version ${version.translate(None, '.')}
% for extension in extensions:
#extension ${extension} : enable
% endfor
uniform ${sampler_type} s;
% if execution_stage == 'fs':
varying ${coord_type} coord;
% else:
uniform ${coord_type} coord;
% endif
void main()
{
% if execution_stage == 'fs':
gl_FragColor.xy = textureQuery${lod}(s, coord);
% else:
gl_Position.xy = textureQuery${lod}(s, coord);
% endif
}
"""))
def main():
"""Main function."""
......
/* [config]
% if execution_stage == 'fs':
* expect_result: pass
% else:
* expect_result: fail
% endif
* glsl_version: ${version}
% if extensions:
* require_extensions: ${" ".join(extensions)}
% endif
* [end config]
*/
#version ${version.translate(None, '.')}
% for extension in extensions:
#extension ${extension} : enable
% endfor
uniform ${sampler_type} s;
% if execution_stage == 'fs':
varying ${coord_type} coord;
% else:
uniform ${coord_type} coord;
% endif
void main()
{
% if execution_stage == 'fs':
gl_FragColor.xy = textureQuery${lod}(s, coord);
% else:
gl_Position.xy = textureQuery${lod}(s, coord);
% endif
}
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