[Piglit] [PATCH] glsl-1.50: test gl_PrimitiveID xfb

Dave Airlie airlied at gmail.com
Mon Jan 27 19:17:47 UTC 2020


On Mon, 6 Jan 2020 at 09:05, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>
> This appears to trigger an issue on at least GP108 due to an odd shader
> export write restriction. And we should be testing gl_PrimitiveID
> anyways.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

Reviewed-by: Dave Airlie <airlied at redhat.com>
> ---
>  .../execution/geometry/transform-feedback-builtins.c      | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c b/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c
> index cfd71c944..4144c7cb1 100644
> --- a/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c
> +++ b/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c
> @@ -60,6 +60,7 @@ static const char *gs_template =
>         "{\n"
>         "  for (int i = 0; i < 3; i++) {\n"
>         "    gl_Layer = 2 * i + 1;\n"
> +       "    gl_PrimitiveID = gl_PrimitiveIDIn + i;\n"
>         "%s"
>         "    EmitVertex();\n"
>         "  }\n"
> @@ -71,16 +72,17 @@ static const char *gs_template =
>   * above, the output should be a sequence of integers defined in this
>   * array.
>   */
> -static const int expected[2][3] = {{1, 3, 5}, /* gl_Layer */
> +static const int expected[3][3] = {{1, 3, 5}, /* gl_Layer */
> +                                  {0, 1, 2}, /* gl_PrimitiveID */
>                                    {1, 2, 3}}; /* gl_ViewportIndex */
>
> -static const char *varyings[] = {"gl_Layer", "gl_ViewportIndex"};
> +static const char *varyings[] = {"gl_Layer", "gl_PrimitiveID", "gl_ViewportIndex"};
>
>  void
>  piglit_init(int argc, char **argv)
>  {
>         int i, j, num_xfb_buffers;
> -       GLuint prog, vao, xfb_buf[2];
> +       GLuint prog, vao, xfb_buf[3];
>         const GLint *readback;
>         char *gstext;
>         bool pass = true;
> --
> 2.24.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list