[Mesa-dev] [PATCH-RFC] draw: Rewrite primitive decomposer

keith whitwell keith.whitwell at gmail.com
Mon Aug 2 15:48:27 PDT 2010

On Mon, Aug 2, 2010 at 5:33 PM, Chia-I Wu <olvaffe at gmail.com> wrote:
> Hi,
> While studying the draw module, I noticed that multiple primitive
> decomposers exist: draw_pt_vcache_tmp.h, draw_gs_tmp.h,
> draw_so_emit_tmp.h, and draw_pt_decompose.h.  The differences between
> them are small, yet some of them support primitive modes that others
> don't.  So I started the work to add a generic draw_decompose_tmp.h
> that can be included by other tmp header files.  You may find the
> changes in the attachments, or
>  http://cgit.freedesktop.org/~olv/mesa/log/?h=draw-decompose
> draw_decompose_tmp.h supports all primitive modes.  While it is a
> rewrite, it resembles the existing decomposers a lot.  There are two
> changes regarding how PIPE_PRIM_POLYGON and
> When flatshade_first is TRUE, the first triangle of the decomposed
> polygon has edge flags 0 and 1 set; the last triangle has edge flags 1
> and 2 set;  the other triangles has edge flags 1 set.  This is
> different from the existing decomposers, which seem to set the edge
> flags wrongly(?).
> As for PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY, the GS decomposer does not
> seem to follow the vertex ordering of GL_TRIANGLE_STRIP_ADJACENCY.  I
> write that part from scratch.  I am not 100% sure here as I don't have
> a test case to verify.  It would be great if someone can clarify.

The trivial/poly-unfilled test and friends should give a quick idea.

> I haven't done a thorough (read: piglit) test yet.  I would like to
> get early feedback before continuing.  Suggestions?

This looks like a great cleanup - thanks for taking it on.  I think
everyone would have wanted it to be like this, but a lot of that code
was written in something of a hurry...


More information about the mesa-dev mailing list