[Piglit] [PATCH] Add interface blocks that make sure unsized arrays are not allowed.

Fabian Bieler fabianbieler at fastmail.fm
Sat Jun 8 03:21:43 PDT 2013


On Sat, Jun 8, 2013, at 08:28 AM, Kenneth Graunke wrote:
> This is explicitly forbidden: "Geometry shader input blocks [...].  All
> other input and output block arrays must specify an array size."
> 
> The vertex and fragment shader tests pass on Mesa.  The GS test has not
> been tested.
> 
> Cc: Jordan Justen <jljusten at gmail.com>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
[...]
> a/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
> b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
> new file mode 100644
> index 0000000..f506b72
> --- /dev/null
> +++
> b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
> @@ -0,0 +1,27 @@
> +// [config]
> +// expect_result: pass
I think this test should fail.
Or the unsized interface block array should be an input block, rather
than an output block.
> +// glsl_version: 1.50
> +// check_link: true
> +// [end config]
> +
> +#version 150
> +
> +layout(triangles) in;
> +layout(triangle_strip, max_vertices = 3) out;
> +
> +/* From the GLSL 1.50 spefication, section 4.3.7, the second to last
> paragraph:
> + * "Geometry shader input blocks [...].  All other input and output
> block
> + *  arrays must specify an array size."
> + */
> +out block {
> +  vec4 v;
> +} varyings[];
> +
> +void main()
> +{
> +  for (int i = 0; i < 3; i++) {
> +    gl_Position = vec4(0.0);
> +    varyings[0].v = vec4(1.0);
> +    EmitVertex();
> +  }
> +}
[...]


More information about the Piglit mailing list