[Piglit] [PATCH 2/2] shaders: test linking similar unnamed types

Matt Turner mattst88 at gmail.com
Tue Jan 21 14:05:22 PST 2014


On Fri, Jan 17, 2014 at 4:37 PM, Grigori Goronzy <greg at chown.ath.cx> wrote:
> GLSL allows unnamed structure types in variable declarations. This
> test verifies that the GLSL linker recognizes similar unnamed structure
> types declared across multiple shader stages.
> ---
>  tests/shaders/glsl-link-unnamed-types.shader_test | 29 +++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 tests/shaders/glsl-link-unnamed-types.shader_test
>
> diff --git a/tests/shaders/glsl-link-unnamed-types.shader_test b/tests/shaders/glsl-link-unnamed-types.shader_test
> new file mode 100644
> index 0000000..c3a5e4b
> --- /dev/null
> +++ b/tests/shaders/glsl-link-unnamed-types.shader_test
> @@ -0,0 +1,29 @@
> +# Verifies that the GLSL linker can handle similar unnamed types
> +# that appear in multiple shader stages.
> +
> +[require]
> +GLSL >= 1.10
> +
> +[vertex shader]
> +varying vec4 color;
> +uniform struct { vec4 x; } a;
> +
> +void main()
> +{
> +    gl_Position = gl_Vertex;
> +    color = a.x;
> +}
> +
> +[fragment shader]
> +varying vec4 color;
> +uniform struct { vec4 x; } a;
> +
> +void main()
> +{
> +    gl_FragColor = color;
> +}
> +
> +[test]
> +uniform vec4 a.x 0.0 1.0 0.0 1.0
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> --
> 1.8.1.2

Thanks. Reviewed-by & committed.


More information about the Piglit mailing list