[Mesa-dev] [PATCH-RFC] draw: Rewrite primitive decomposer
Zack Rusin
zackr at vmware.com
Tue Aug 3 13:14:22 PDT 2010
On Tuesday 03 August 2010 12:56:41 Chia-I Wu wrote:
> I see your point. There are more than one way to interpret the
> diagram. Now I am curious if the diagram is all the D3D documents have
> for triangle strip with adjacency?
As far as the public docs go I think that's it.
> > and so on. If you have a testcase that shows which way it is, great,
> > lets change it (aka fix it). Otherwise I'm just not too excited about
> > changing code that was working with the (corny) testcases it had for
> > something without any.
>
> Sure. Where can I find the test cases, if they are public?
I've tested with a few proprietary demos/apps, but since I've implemented gs
in Mesa as well we can use that. You can put the attached files in
demos/src/glsl and compile it there. I never tested triangle strips with
adjacency in mesa but it seems to be at least rendering something (the
adjacency vertices are definitely flipped). Try glDrawArrays with different
values, e.g.
1) glDrawArrays(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 0, 6);
2) glDrawArrays(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 2, 6);
3) glDrawArrays(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 4, 6);
4) glDrawArrays(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 0, 8);
5) glDrawArrays(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 2, 8);
6) glDrawArrays(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 0, 10);
It'd be awesome if we had a piglit test for it, but right now anything that
with some manual testing looks like whatever proprietary NVIDIA/AMD drivers do
would be fine.
z
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tri-adj.c
Type: text/x-csrc
Size: 6007 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100803/558fa4ef/attachment.c>
-------------- next part --------------
#version 120
#extension GL_EXT_geometry_shader4: enable
void main()
{
gl_Position = gl_PositionIn[1];
gl_FrontColor = vec4(1, 0, 0, 0.5);
EmitVertex();
gl_Position = gl_PositionIn[3];
gl_FrontColor = vec4(0, 1, 0, 0.5);
EmitVertex();
gl_Position = gl_PositionIn[5];
gl_FrontColor = vec4(0, 0, 1, 0.5);
EmitVertex();
EndPrimitive();
gl_Position = gl_PositionIn[0];
gl_FrontColor = vec4(1, 1, 1, 1);
EmitVertex();
gl_Position = gl_PositionIn[2];
gl_FrontColor = vec4(1, 0, 0, 1);
EmitVertex();
gl_Position = gl_PositionIn[4];
gl_FrontColor = vec4(0, 0, 1, 1);
EmitVertex();
EndPrimitive();
}
More information about the mesa-dev
mailing list