diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2016-02-29 12:23:11 -0800 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2016-04-13 09:22:55 -0700 |
commit | 078fe82acffc919f19265519d1551d213acd6005 (patch) | |
tree | 1b2a3719e0089c443d824ff71bacf4d109d5ba97 /generated_tests/templates | |
parent | 6786371be43a0ceea8476bbbc781943e00bdf66f (diff) |
generators: port vp-tex.sh to python
There are only whitespace differences between the python generator and
the bash generator.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'generated_tests/templates')
-rw-r--r-- | generated_tests/templates/gen_vp_tex/arbvp.mako | 30 | ||||
-rw-r--r-- | generated_tests/templates/gen_vp_tex/helpers.mako | 54 | ||||
-rw-r--r-- | generated_tests/templates/gen_vp_tex/nvvp3.mako | 32 | ||||
-rw-r--r-- | generated_tests/templates/gen_vp_tex/nvvp3_2.mako | 33 |
4 files changed, 149 insertions, 0 deletions
diff --git a/generated_tests/templates/gen_vp_tex/arbvp.mako b/generated_tests/templates/gen_vp_tex/arbvp.mako new file mode 100644 index 000000000..87c9af16e --- /dev/null +++ b/generated_tests/templates/gen_vp_tex/arbvp.mako @@ -0,0 +1,30 @@ +## encoding=utf-8 +## Copyright © 2016 Intel Corporation +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in +## all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. + +<%namespace name="helpers" file="helpers.mako"/> + +!!ARBvp1.0 + +${helpers.require(target)} + +# FAIL - texture instructions not supported by GL_ARB_vertex_program +${inst} result.color, vertex.texcoord[0], texture[0], ${target}; +END diff --git a/generated_tests/templates/gen_vp_tex/helpers.mako b/generated_tests/templates/gen_vp_tex/helpers.mako new file mode 100644 index 000000000..e016d9299 --- /dev/null +++ b/generated_tests/templates/gen_vp_tex/helpers.mako @@ -0,0 +1,54 @@ +## encoding=utf-8 +## Copyright © 2016 Intel Corporation +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in +## all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. +<%! + import re + + _IS_NVVP3_FAIL = re.compile(r'(TEX|TX[BLP])') + + def dedent(text): + return '\n'.join(l.lstrip() for l in text.splitlines()) + + def newlines(text): + return '\n'.join(l for l in text.splitlines() if l.strip()) +%> + +<%def name="require(target)" filter="dedent,newlines"> + % if target.startswith("SHADOW"): + # REQUIRE GL_ARB_fragment_program_shadow + OPTION ARB_fragment_program_shadow; + ## Remove "SHADOW" portion of string + <% target = target[len("SHADOW"):] %> + % endif + + % if target == "RECT": + # REQUIRE GL_ARB_texture_rectangle + % elif target == "CUBE": + # REQUIRE GL_ARB_texture_cube_map + % elif target == "3D": + # REQUIRE GL_EXT_texture3D + % endif +</%def> + +<%def name="nvvp3_fail(inst)" filter="dedent"> + % if not _IS_NVVP3_FAIL.match(inst): + # FAIL - ${inst} not supported by GL_NV_vertex_program3 + % endif +</%def> diff --git a/generated_tests/templates/gen_vp_tex/nvvp3.mako b/generated_tests/templates/gen_vp_tex/nvvp3.mako new file mode 100644 index 000000000..39479fd1f --- /dev/null +++ b/generated_tests/templates/gen_vp_tex/nvvp3.mako @@ -0,0 +1,32 @@ +## encoding=utf-8 +## Copyright © 2016 Intel Corporation +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in +## all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. + +<%namespace name="helpers" file="helpers.mako"/> + +!!ARBvp1.0 + +# REQUIRE GL_NV_vertex_program3 +OPTION NV_vertex_program3; +${helpers.require(target)} + +${helpers.nvvp3_fail(inst)} +${inst} result.color, vertex.texcoord[0], texture[0], ${target}; +END diff --git a/generated_tests/templates/gen_vp_tex/nvvp3_2.mako b/generated_tests/templates/gen_vp_tex/nvvp3_2.mako new file mode 100644 index 000000000..761f18109 --- /dev/null +++ b/generated_tests/templates/gen_vp_tex/nvvp3_2.mako @@ -0,0 +1,33 @@ +## encoding=utf-8 +## Copyright © 2016 Intel Corporation +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in +## all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. + +<%namespace name="helpers" file="helpers.mako"/> + +!!ARBvp1.0 + +# REQUIRE GL_NV_vertex_program3 +OPTION NV_vertex_program3; +${helpers.require(target)} + +${helpers.nvvp3_fail(inst)} +OUTPUT ${target} = result.color; +${inst} ${target}, vertex.texcoord[0], texture[0], ${target}; +END |