[Piglit] [PATCH 1/2] GLSL-1.50 compiler: Test that vertex shader inputs can be arrays

Paul Berry stereotype441 at gmail.com
Thu Jul 25 09:57:24 PDT 2013


On 24 July 2013 15:02, Steve Miller <dervishx at gmail.com> wrote:

>  * GLSLLangSpec.1.50.09 4.3.4 Inputs:
>

I recommend phrasing this (and the other spec references) to look like
"Section 4.3.4 (Inputs) of the GLSL 1.50 spec says:"

Also the leading asterisks in the commit message are a little distracting.


>  *  Vertex shader inputs can only be float, floating-point vectors,
> matrices,
>  *  signed and unsigned integers and integer vectors.Vertex shader inputs
> can
>  *  also form arrays of these types, but not structures
> ---
>  .../glsl-1.50/compiler/input-arrays-float.vert     | 20 ++++++++++++++
>  .../spec/glsl-1.50/compiler/input-arrays-int.vert  | 31
> ++++++++++++++++++++++
>  .../spec/glsl-1.50/compiler/input-arrays-mat.vert  | 31
> ++++++++++++++++++++++
>  .../spec/glsl-1.50/compiler/input-arrays-uint.vert | 26 ++++++++++++++++++
>  4 files changed, 108 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-float.vert
>  create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-int.vert
>  create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-mat.vert
>  create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-uint.vert
>

All of these files include lines with trailing whitespace (you can see it
easily with "git log -p --color").

With those minor nit-picks fixed, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


>
> diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-float.vert
> b/tests/spec/glsl-1.50/compiler/input-arrays-float.vert
> new file mode 100644
> index 0000000..f5cf79a
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/input-arrays-float.vert
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +
> +in float a[2];
> +in vec2 b[2];
> +in vec3 c[2];
> +in vec4 d[2];
> +
> +void main()
> +{
> +       gl_Position = vec4(a[0] + a[1] +
> +                       b[0].x + b[1].x +
> +                       c[0].x + c[1].x +
> +                       d[0].x + d[1].x);
> +}
> diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-int.vert
> b/tests/spec/glsl-1.50/compiler/input-arrays-int.vert
> new file mode 100644
> index 0000000..b155a00
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/input-arrays-int.vert
> @@ -0,0 +1,31 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// check_link: false
> +// [end config]
> +//
> +// Tests that arrays can be inputs to the vertex shader
> +/*
> +* GLSLLangSpec.1.50.09 Inputs:
> +*
> +* Vertex shader inputs can only be float, floating-point
> +* vectors, matrices, signed and unsigned integers and integer vectors.
> +* Vertex shader inputs can also form arrays of these types, but not
> +* structures.
> +*
> +*/
> +
> +#version 150
> +
> +in int a[2];
> +in ivec2 b[2];
> +in ivec3 c[2];
> +in ivec4 d[2];
> +
> +void main()
> +{
> +       gl_Position = vec4(a[0] + a[1] +
> +                       b[0].x + b[1].x +
> +                       c[0].x + c[1].x +
> +                       d[0].x + d[1].x);
> +}
> diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-mat.vert
> b/tests/spec/glsl-1.50/compiler/input-arrays-mat.vert
> new file mode 100644
> index 0000000..c9c0f98
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/input-arrays-mat.vert
> @@ -0,0 +1,31 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// check_link: false
> +// [end config]
> +//
> +// Tests that arrays (of matrices) can be inputs to the vertex shader
> +/*
> +* GLSLLangSpec.1.50.09 Inputs:
> +*
> +* Vertex shader inputs can only be float, floating-point
> +* vectors, matrices, signed and unsigned integers and integer vectors.
> +* Vertex shader inputs can also form arrays of these types, but not
> +* structures.
> +*
> +*/
> +
> +#version 150
> +
> +in mat3 a[2];
> +in mat4 b[2];
> +
> +void main()
> +{
> +       gl_Position = vec4(
> +                       a[0][0].x + a[0][1].x +
> +                       a[1][0].x + a[1][1].x +
> +                       b[0][0].x + b[0][1].x +
> +                       b[1][0].x + b[1][1].x
> +                       );
> +}
> diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-uint.vert
> b/tests/spec/glsl-1.50/compiler/input-arrays-uint.vert
> new file mode 100644
> index 0000000..0d834b4
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/input-arrays-uint.vert
> @@ -0,0 +1,26 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// check_link: false
> +// [end config]
> +
> +// Section 4.3.4 (Inputs) of GLSL 1.50 spec states:
> +//     "Vertex shader inputs can only be float, floating-point
> +//     vectors, matrices, signed and unsigned integers and integer
> +//     vectors. Vertex shader inputs can also form
> +//     arrays of these types, but not structures."
> +
> +#version 150
> +
> +in uint  a[2];
> +in uvec2 b[2];
> +in uvec3 c[2];
> +in uvec4 d[2];
> +
> +void main()
> +{
> +    gl_Position = vec4(a[0] + a[1]
> +                       + b[0].x + b[1].x
> +                       + c[0].x + c[1].x
> +                       + d[0].x + d[1].x);
> +}
> --
> 1.8.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130725/96819672/attachment.html>


More information about the Piglit mailing list