OSDN Git Service

t_dd_dmatmp: Disallow flat shading when rendering quad strips via tri strips
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 30 Jun 2014 16:53:12 +0000 (19:53 +0300)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 16 Jul 2015 13:48:41 +0000 (21:48 +0800)
When rendering quad strips via tri strips we can't get the provoking
vertex right, so disallow flat shading.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
src/mesa/tnl_dd/t_dd_dmatmp.h

index 3ed4a98..f56b0aa 100644 (file)
@@ -447,7 +447,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
 
       FLUSH();
    }
-   else if (HAVE_TRI_STRIPS) {
+   else if (HAVE_TRI_STRIPS && ctx->Light.ShadeModel == GL_SMOOTH) {
       LOCAL_VARS;
       int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
       int currentsz;
@@ -1124,7 +1124,7 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx,
         } else if (HAVE_QUAD_STRIPS) {
            ok = GL_TRUE;
         } else {
-           ok = HAVE_TRI_STRIPS;
+           ok = (HAVE_TRI_STRIPS && ctx->Light.ShadeModel == GL_SMOOTH);
         }
         break;
       case GL_QUADS: