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

Chia-I Wu olvaffe at gmail.com
Fri Aug 6 06:33:56 PDT 2010

On Fri, Aug 6, 2010 at 6:03 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 5 August 2010 18:51, Chia-I Wu <olvaffe at gmail.com> wrote:
>> The GL rule is last vertex last for each primitive.  The D3D rule is first
>> vertex first.  My idea is to have draw_decompose_tmp.h use a local variable,
>> last_vertex_last, to select the rules.  In draw_gs_tmp.h and
>> draw_so_emit_tmp.h, last_vertex_last is TRUE when the new settable flags is
>> TRUE.  However, in draw_pt_decompse.h, where the rules no longer matter,
>> last_vertex_last is set to !(flatshade && flatshade_first).
> Doesn't ARB_provoking_vertex control that for GL?
The decomposers are using the provoking convention to decide the
decomposition rule.  That is, tri_strip [0, 1, 2, 3] is decomposed to

  tri [0, 1, 2] and [2, 1, 3], when GL_LAST_VERTEX_CONVENTION
  tri [0, 1, 2] and [1, 3, 2], when GL_FIRST_VERTEX_CONVENTION

That is fine when GS is not active.  But when GS is active, and when
the second triangle is processed, gl_PositionIn[0] could be vertex 2
or vertex 1 depending on the convention.  Now that is not desirable.

The decomposers should not depend on the provoking convention to
decide how to decompose, at least for those decomposers before GS.

olv at LunarG.com

More information about the mesa-dev mailing list