Re: [Mesa-dev] [PATCH 02/20] t_dd_dmatmp: Allow flat shaded polygons with tri fans

2015-05-21 Thread Ville Syrjälä
On Fri, May 15, 2015 at 12:07:54PM -0700, Ian Romanick wrote:
 On 03/23/2015 05:47 AM, ville.syrj...@linux.intel.com wrote:
  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.
 
 This sounds reasonable since it matches the DX behavior.  Is there a
 piglit test that would hit this?

Dunno. And in fact we won't hit it with i915 sine we HAVE_POLYGONS.
Failed to realize that before I cooked up the patch :)

 
  Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
  ---
   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:
  

-- 
Ville Syrjälä
Intel OTC
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/20] t_dd_dmatmp: Allow flat shaded polygons with tri fans

2015-05-15 Thread Ian Romanick
On 03/23/2015 05:47 AM, ville.syrj...@linux.intel.com wrote:
 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.

This sounds reasonable since it matches the DX behavior.  Is there a
piglit test that would hit this?

 Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
 ---
  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
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 02/20] t_dd_dmatmp: Allow flat shaded polygons with tri fans

2015-03-23 Thread ville . syrjala
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.

Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
---
 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:
-- 
2.0.5

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