[Piglit] [PATCH] sso: add test for linking gs without explicit locations

Timothy Arceri t_arceri at yahoo.com.au
Thu Jan 21 14:14:43 PST 2016


On Thu, 2016-01-21 at 08:45 -0500, Ilia Mirkin wrote:
> Mesa treats each GS input as taking up 3 locations instead of 1,
> because
> it doesn't de-array the vars. This causes it to take col3 from VS
> instead of col1.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

As discussed on IRC the desktop spec leaves SSO interface validation up
to the dev so the mismatch between VS and GS should be fine as far as I
understand.

Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>


> ---
>  .../execution/vs-gs-linking.shader_test            | 57
> ++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
>  create mode 100644
> tests/spec/arb_separate_shader_objects/execution/vs-gs
> -linking.shader_test
> 
> diff --git a/tests/spec/arb_separate_shader_objects/execution/vs-gs
> -linking.shader_test
> b/tests/spec/arb_separate_shader_objects/execution/vs-gs
> -linking.shader_test
> new file mode 100644
> index 0000000..938df13
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/execution/vs-gs
> -linking.shader_test
> @@ -0,0 +1,57 @@
> +[require]
> +GLSL >= 1.50
> +SSO ENABLED
> +
> +[vertex shader]
> +#version 150
> +
> +in vec4 piglit_vertex;
> +out vec4 col0;
> +out vec4 col1;
> +out vec4 col2;
> +out vec4 col3;
> +out vec4 col4;
> +out vec4 col5;
> +
> +void main() {
> +  gl_Position = piglit_vertex;
> +  col1 = vec4(0, 1, 0, 1);
> +  col0 = col2 = col3 = col4 = col5 = vec4(1, 0, 0, 1);
> +}
> +
> +[geometry shader]
> +#version 150
> +
> +layout (triangles) in;
> +layout (triangle_strip, max_vertices=3) out;
> +
> +in vec4 color0[];
> +in vec4 color1[];
> +
> +out vec4 color;
> +
> +void main() {
> +  int i;
> +  for (i = 0; i < 3; i++) {
> +    gl_Position = gl_in[i].gl_Position;
> +    color = color1[i];
> +    EmitVertex();
> +  }
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +in vec4 color;
> +out vec4 col;
> +
> +void main() {
> +  col = color;
> +}
> +
> +[test]
> +clear color 0.2 0.2 0.2 0.2
> +clear
> +
> +draw rect -1 -1 2 2
> +probe all rgba 0 1 0 1


More information about the Piglit mailing list