[Piglit] [PATCH] Make the generated constant array size tests respect extensions.

Ian Romanick idr at freedesktop.org
Sat Feb 8 03:43:25 CET 2014


On 02/07/2014 05:13 PM, Kenneth Graunke wrote:
> In 89603add5ad0bf02fcfcb7fdc0149c09f5aa2988, I neglected to update the
> constant array size test generator.  In the following commit, I added a
> bunch of AMD_shader_trinary_minmax tests which then got generated
> without the #extension directive and put in the wrong place.
> 
> Cc: Ian Romanick <idr at freedesktop.org>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

Thanks for the quick fix.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Tested-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>  generated_tests/gen_constant_array_size_tests.py | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/generated_tests/gen_constant_array_size_tests.py b/generated_tests/gen_constant_array_size_tests.py
> index db885b2..99b15d0 100644
> --- a/generated_tests/gen_constant_array_size_tests.py
> +++ b/generated_tests/gen_constant_array_size_tests.py
> @@ -147,6 +147,8 @@ class ParserTest(object):
>      def make_shader(self):
>          """Generate the shader code necessary to test the built-in."""
>          shader = self.version_directive()
> +        if self.__signature.extension:
> +            shader += '#extension GL_{0} : require\n'.format(self.__signature.extension)
>          shader += self.additional_declarations()
>          shader += '\n'
>          shader += 'void main()\n'
> @@ -164,9 +166,12 @@ class ParserTest(object):
>      def filename(self):
>          argtype_names = '-'.join(
>              str(argtype) for argtype in self.__signature.argtypes)
> +        if self.__signature.extension:
> +            subdir = self.__signature.extension
> +        else:
> +            subdir = 'glsl-{0:1.2f}'.format(float(self.glsl_version()) / 100)
>          return os.path.join(
> -            'spec', 'glsl-{0:1.2f}'.format(float(self.glsl_version()) / 100),
> -            'compiler', 'built-in-functions',
> +            'spec', subdir, 'compiler', 'built-in-functions',
>              '{0}-{1}.{2}'.format(
>                  self.__signature.name, argtype_names, self.test_suffix()))
>  
> 



More information about the Piglit mailing list