[Piglit] [PATCH] gs: less demanding tests for triangle strips.
Matt Turner
mattst88 at gmail.com
Thu Sep 5 17:52:08 PDT 2013
On Wed, Aug 28, 2013 at 1:59 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> +[vertex shader]
> +#version 150
We don't need to specify the #version anymore, now that it's added by
shader_runner, given the [require] section.
> +
> +in vec4 vertex;
> +out vec4 vertex_to_gs;
> +
> +void main()
> +{
> + vertex_to_gs = vertex;
> +}
> +
> +[geometry shader]
> +#version 150
> +
> +layout(triangles_adjacency) in;
> +layout(triangle_strip, max_vertices = 3) out;
> +
> +in vec4 vertex_to_gs[6];
> +
> +void main()
> +{
> + for (int i = 0; i < 3; i++) {
> + gl_Position = vertex_to_gs[2*i];
If I understand correctly, in the first geometry shader invocation
this will emit vertices 1, 3, and 5 from your picture. Is that what
you're referring to when you say "the first triangle is clockwise"?
I wasn't clear whether you meant the triangle 1-2-3, or 1-3-5. From
the comment and picture I'd have thought the first, and from the code
I'd have thought the second. Both, as it turn out are clockwise.
Once I understand that,
Reviewed-by: Matt Turner <mattst88 at gmail.com>
More information about the Piglit
mailing list