[Piglit] [PATCH] gs: less demanding tests for triangle strips.
Matt Turner
mattst88 at gmail.com
Mon Sep 9 10:11:05 PDT 2013
On Mon, Sep 9, 2013 at 9:44 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> On 5 September 2013 17:52, Matt Turner <mattst88 at gmail.com> wrote:
>>
>> 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.
>
>
> Argh, you're right. I keep forgetting about that. Fixed.
>
>>
>>
>> > +
>> > +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.
>
>
> Your understanding from the code is correct. Triangle 1-2-3's orientation
> isn't really significant for this particular test, since it is an "adjacent
> triangle". The vertices comprising the adjacent triangles are tested
> adequately by triangle-strip-adj.shader_test.
>
> I've updated the comment to look like this:
>
> # Note that the only triangles drawn by this test are triangles 1-3-5,
> # 5-3-7, 5-7-9, and 9-7-11. The other triangles shown in the diagram
> # are "adjacent triangles".
> #
> # Note also that triangles 1-3-5, 5-3-7, 5-7-9, and 9-7-11 are all
> # clockwise, so we expect gl_FrontFacing to be false.
>
> Is that clear enough, or should I explain in more detail?
Nope, that makes sense. Thanks Paul!
More information about the Piglit
mailing list