[Piglit] [PATCH 2/6] gles2, glsl: add gles2 support to glslparser test

Chad Versace chad.versace at linux.intel.com
Mon Dec 17 10:54:06 PST 2012


On 12/14/2012 12:01 PM, Tom Gall wrote:
> Add GLSLESParserTest class which runs the gles2/gles3
>    version of glslparsertest. Why is this needed?
>    The current GLSLParserTest class doesn't know about the
>    gles2/gles3 varient of glslparsertest. The versioning
>    of glsl_version in the config section of frags and vert
>    shaders is conceptually incompatible for the GLSL ES
>    versions.
> 
>    Consider. GLSL ES version 1.00 is approx equal to
>    GLSL 1.20. However there are situations where
>    a testcase that will pass on GLSL 1.20 but will fail
>    under GLSL ES 1.00.
> 
>    Ex: tests/glslparsertest/shaders/CorrectConstruct.vert
>    Embedded structure definitions are not allowed in GLSL ES
>    1.00 but are perfectly legal in GLSL 1.10. For both GLSL
>    and GLSL ES this is a good testcase.
> 
>    This creates a situation where version comparisons between
>    verions 1.00, 1.10, 1.20, etc just isn't going to work and
>    expected results can be different for the same testcase.
> 
>    To deal with this situation, GLSLESParserTest looks for
>    glsles_version in the config section. If not found, the
>    test is skipped. If found, this version is passed into
>    the glsl es version of glslparsertest.
> 
>    glsles_expect_result is also added as an option entry
>    in the config section. If it is not present the
>    expect_result is the same for GLSL and GLSL ES. If
>    present the glsles_expect_result is passed into the
>    appropriate GLSL ES version of glslparsertest.
> 
> Signed-off-by: Tom Gall <tom.gall at linaro.org>
> ---
>  framework/glsl_es_parser_test.py |  377 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 377 insertions(+)
>  create mode 100755 framework/glsl_es_parser_test.py

Nak. Rather than forking glslparsertest.py for only a minimal set of changes,
I think a better approach is to modify the existing glslparsertest.py. However,
exactly which modifications are needed for glslparsertest.py will be determined
by the resolution of a larger design decision: how should we add the gles2
glslparser tests to all.tests?

Do you already have a plan on how to add the gles2 glslparser tests to all.tests?

I see a ideal solution, but to achieve it will take some time. It requires adding
gles support to piglit-dispatch, building only one glslparsertest executable,
and letting the executable iterate over all GLSL versions declared in the config
block, printing a result for each. In this solution, all.tests needed no changing.

Nevermind my longterm solution. You want a solution now.

If all proposed shorterm solutions for adding gles2 glslparser tests to all.tests
prove too difficult or too messy, then we could just postpone their addition until
my proposed solution arrives. In that fallback scenario, we could just create a separate
gles2_glslparsertests.tests. I don't like that fallback, but we shouldn't rule
it out as an option. I'd rather see the gles2 glslparser tests added to all.tests
as soon as possible.






More information about the Piglit mailing list