From: Ville Syrjälä <ville.syrj...@linux.intel.com>

We can allow rendering flat shaded polygons using tri fans if we check
the provoking vertex convention.

v2 (idr): Remove _EXT suffixes from GL_FIRST_VERTEX_CONVENTION.

Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
---
 src/mesa/tnl_dd/t_dd_dmatmp.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
index 415c3df..be4b69c 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -315,7 +315,8 @@ static void TAG(render_poly_verts)(struct gl_context *ctx,
       }
 
       FLUSH();
-   } else if (ctx->Light.ShadeModel == GL_SMOOTH) {
+   } else if (ctx->Light.ShadeModel == GL_SMOOTH ||
+              ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION) {
       TAG(render_tri_fan_verts)( ctx, start, count, flags );
    } else {
       unreachable("Cannot draw primitive");
@@ -455,7 +456,8 @@ static bool TAG(validate_render)(struct gl_context *ctx,
          ok = true;
          break;
       case GL_POLYGON:
-         ok = (HAVE_POLYGONS) || ctx->Light.ShadeModel == GL_SMOOTH;
+         ok = (HAVE_POLYGONS) || ctx->Light.ShadeModel == GL_SMOOTH ||
+              ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION;
          break;
       case GL_QUAD_STRIP:
          ok = VB->Elts ||
-- 
2.1.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to