[Piglit] [PATCH 5/6] framework: observe PIGLIT_NO_FAST_SKIP in ShaderTest::__init__()
Dylan Baker
dylan at pnwbakers.com
Thu Oct 19 00:41:08 UTC 2017
Quoting Brian Paul (2017-10-12 21:23:09)
> If PIGLIT_NO_FAST_SKIP is defined, the FastSkip/FastSkipMixin classes
> are no-ops. Therefore, the GL/GLSL version info collected in
> ShaderTest::__init()__ isn't used. Skipping the shader test parsing
> is a big win for reducing start-up time on Windows. There's not much
> difference either way on Linux.
> ---
> framework/test/shader_test.py | 30 +++++++++++++++++++-----------
> 1 file changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
> index 7f3d876..a3fb8e2 100644
> --- a/framework/test/shader_test.py
> +++ b/framework/test/shader_test.py
> @@ -155,17 +155,25 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
> """
>
> def __init__(self, filename):
> - parser = Parser(filename)
> - parser.parse()
> -
> - super(ShaderTest, self).__init__(
> - [parser.prog, parser.filename],
> - run_concurrent=True,
> - gl_required=parser.gl_required,
> - gl_version=parser.gl_version,
> - gles_version=parser.gles_version,
> - glsl_version=parser.glsl_version,
> - glsl_es_version=parser.glsl_es_version)
> + if bool(os.environ.get('PIGLIT_NO_FAST_SKIP', False)):
> + # No need to parse the shader test file if we've disabled
> + # the FastSkip feature.
> + super(ShaderTest, self).__init__(
> + ['shader_runner', filename],
> + run_concurrent=True,)
> + else:
> + parser = Parser(filename)
> + parser.parse()
> +
> + super(ShaderTest, self).__init__(
> + [parser.prog, parser.filename],
> + run_concurrent=True,
> + gl_required=parser.gl_required,
> + gl_version=parser.gl_version,
> + gles_version=parser.gles_version,
> + glsl_version=parser.glsl_version,
> + glsl_es_version=parser.glsl_es_version)
> +
>
> @PiglitBaseTest.command.getter
> def command(self):
> --
> 1.9.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
Does it make more sense to just put this logic in the parser and have it return
an object of Nones immediatly if PIGLIT_NO_FAST_SKIP is set?
Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20171018/5b0c0d3a/attachment.sig>
More information about the Piglit
mailing list