[Piglit] [PATCH 1/6] shader_runner: Check feature support before querying GL_MAX_*.

Ilia Mirkin imirkin at alum.mit.edu
Wed Nov 11 06:44:09 PST 2015


On Wed, Nov 11, 2015 at 1:46 AM, Matt Turner <mattst88 at gmail.com> wrote:
> Otherwise, these will generate an error (to be noticed sometime later
> when glGetError() is called), often resulting in a test failure.
> ---
>  tests/shaders/shader_runner.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 32ac7bd..4597b46 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3111,12 +3111,18 @@ piglit_init(int argc, char **argv)
>         if (piglit_get_gl_version() >= 32)
>                 glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS,
>                               &gl_max_vertex_output_components);
> -       glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> -                     &gl_max_fragment_uniform_components);
> -       glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> -                     &gl_max_vertex_uniform_components);
> -       glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> -                     &gl_max_varying_components);
> +       if (piglit_get_gl_version() >= 20 ||
> +           piglit_is_extension_supported("GL_ARB_fragment_shader"))
> +               glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> +                             &gl_max_fragment_uniform_components);
> +       if (piglit_get_gl_version() >= 20 ||
> +           piglit_is_extension_supported("GL_ARB_vertex_shader"))
> +               glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> +                             &gl_max_vertex_uniform_components);
> +       if (piglit_get_gl_version() >= 30 ||
> +           piglit_is_extension_supported("GL_EXT_geometry_shader4"))

I'll admit to not having gone to check the specs, but you almost
certainly mean GL_EXT_gpu_shader4 here, no?

> +               glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> +                             &gl_max_varying_components);
>         glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max_clip_planes);
>  #else
>         glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS,
> --
> 2.4.9
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list