[Piglit] [PATCH] glslparsertest: Handle compute and tessellation shaders in ES.
Kenneth Graunke
kenneth at whitecape.org
Fri May 13 18:08:54 UTC 2016
On Friday, May 13, 2016 9:37:22 AM PDT Ilia Mirkin wrote:
> On May 13, 2016 4:41 AM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:
> >
> > We apparently have some generated parser tests for ES 3.x extensions
> > that use compute shaders. These didn't work because glslparsertest
> > didn't actually support these features.
> >
> > For example, spec/oes_sample_variables/preprocessor/enabled-es.comp
> > failed as soon as I enabled the OES_sample_variables extension.
> > ---
> > tests/glslparsertest/glslparsertest.c | 41
> +++++++++++++++--------------------
> > 1 file changed, 18 insertions(+), 23 deletions(-)
> >
> > diff --git a/tests/glslparsertest/glslparsertest.c
> b/tests/glslparsertest/glslparsertest.c
> > index d70f508..b0b73d7 100644
> > --- a/tests/glslparsertest/glslparsertest.c
> > +++ b/tests/glslparsertest/glslparsertest.c
> > @@ -227,17 +227,23 @@ attach_dummy_shader(GLuint shader_prog, GLenum type)
> > static void
> > attach_complementary_shader(GLuint shader_prog, GLenum type)
> > {
> > - switch (type) {
> > - case GL_FRAGMENT_SHADER:
> > + if (type == GL_FRAGMENT_SHADER)
> > attach_dummy_shader(shader_prog, GL_VERTEX_SHADER);
> > - break;
> > - case GL_VERTEX_SHADER:
> > + else if (type == GL_VERTEX_SHADER)
> > attach_dummy_shader(shader_prog, GL_FRAGMENT_SHADER);
> > - break;
> > - default:
> > - fprintf(stderr,
> > - "Unexpected type in
> attach_complementary_shader()");
> > - piglit_report_result(PIGLIT_FAIL);
> > +}
> > +
> > +static void
> > +require_feature(int gl_ver, const char *gl_ext, int es_ver, const char
> *es_ext)
> > +{
> > + const int required_ver = piglit_is_gles() ? es_ver : gl_ver;
> > + const char *required_ext = piglit_is_gles() ? es_ext : gl_ext;
> > +
> > + if (piglit_get_gl_version() < required_ver &&
> > + !piglit_is_extension_supported(required_ext)) {
> > + printf("Test requires version %g or %s\n",
> > + required_ver / 10.0, required_ext);
> > + piglit_report_result(PIGLIT_SKIP);
> > }
> > }
> >
> > @@ -258,7 +264,6 @@ test(void)
> > type = GL_FRAGMENT_SHADER;
> > else if (strcmp(filename + strlen(filename) - 4, "vert") == 0)
> > type = GL_VERTEX_SHADER;
> > -#ifdef PIGLIT_USE_OPENGL
> > else if (strcmp(filename + strlen(filename) - 4, "tesc") == 0)
> > type = GL_TESS_CONTROL_SHADER;
> > else if (strcmp(filename + strlen(filename) - 4, "tese") == 0)
> > @@ -267,7 +272,6 @@ test(void)
> > type = GL_GEOMETRY_SHADER;
> > else if (strcmp(filename + strlen(filename) - 4, "comp") == 0)
> > type = GL_COMPUTE_SHADER;
> > -#endif
> > else {
> > type = GL_NONE;
> > fprintf(stderr, "Couldn't determine type of program %s\n",
> > @@ -279,21 +283,12 @@ test(void)
> > piglit_require_fragment_shader();
> >
> > if (type == GL_TESS_CONTROL_SHADER || type ==
> GL_TESS_EVALUATION_SHADER) {
> > - if
> (!piglit_is_extension_supported("GL_ARB_tessellation_shader") &&
> > - (piglit_is_gles() || piglit_get_gl_version() < 40)) {
> > - printf("Test requires GL version 4.0 or "
> > - "GL_ARB_tessellation_shader\n");
> > - piglit_report_result(PIGLIT_SKIP);
> > - }
> > + require_feature(43, "GL_ARB_tessellation_shader",
>
> I guess you meant 40 here?
Right, I was more focused on the ES version and...too much copy and
paste. Fixed locally. Thanks :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160513/69a3e53a/attachment-0001.sig>
More information about the Piglit
mailing list