On 03/23/2015 05:47 AM, [email protected] wrote: > From: Ville Syrjälä <[email protected]> > > We can allow rendering flat shaded polygons using tri fans if we check > the provoking vertex convention.
This sounds reasonable since it matches the DX behavior. Is there a piglit test that would hit this? > Signed-off-by: Ville Syrjälä <[email protected]> > --- > src/mesa/tnl_dd/t_dd_dmatmp.h | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h > index 5ea2d31..3ed4a98 100644 > --- a/src/mesa/tnl_dd/t_dd_dmatmp.h > +++ b/src/mesa/tnl_dd/t_dd_dmatmp.h > @@ -406,7 +406,9 @@ static void TAG(render_poly_verts)( struct gl_context > *ctx, > > FLUSH(); > } > - else if (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH) { > + else if (HAVE_TRI_FANS && > + (ctx->Light.ShadeModel == GL_SMOOTH || > + ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)) { > TAG(render_tri_fan_verts)( ctx, start, count, flags ); > } else { > fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); > @@ -885,7 +887,9 @@ static void TAG(render_poly_elts)( struct gl_context *ctx, > FLUSH(); > currentsz = dmasz; > } > - } else if (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH) { > + } else if (HAVE_TRI_FANS && > + (ctx->Light.ShadeModel == GL_SMOOTH || > + ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)) { > TAG(render_tri_fan_verts)( ctx, start, count, flags ); > } else { > fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__); > @@ -1109,7 +1113,9 @@ static GLboolean TAG(validate_render)( struct > gl_context *ctx, > ok = GL_TRUE; > } > else { > - ok = (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH); > + ok = (HAVE_TRI_FANS && > + (ctx->Light.ShadeModel == GL_SMOOTH || > + ctx->Light.ProvokingVertex == > GL_FIRST_VERTEX_CONVENTION_EXT)); > } > break; > case GL_QUAD_STRIP: > _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
