[Mesa-dev] [PATCH 06/24] t_dd_dmatmp.h: Remove HAVE_QUAD_STRIPS support

Ian Romanick idr at freedesktop.org
Mon Sep 14 18:01:12 PDT 2015


From: Ian Romanick <ian.d.romanick at intel.com>

Two drivers use this file, and neither supports quad strips.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/dri/i915/intel_render.c   |  1 -
 src/mesa/drivers/dri/radeon/radeon_swtcl.c |  1 -
 src/mesa/tnl_dd/t_dd_dmatmp.h              | 41 ++++++------------------------
 3 files changed, 8 insertions(+), 35 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c
index df21c66..2b3cf48 100644
--- a/src/mesa/drivers/dri/i915/intel_render.c
+++ b/src/mesa/drivers/dri/i915/intel_render.c
@@ -65,7 +65,6 @@
 #define HAVE_TRI_FANS    1
 #define HAVE_POLYGONS    1
 #define HAVE_QUADS       0
-#define HAVE_QUAD_STRIPS 0
 
 #define HAVE_ELTS        0
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
index 7938c53..c01a985 100644
--- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
+++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
@@ -356,7 +356,6 @@ void r100_swtcl_flush(struct gl_context *ctx, uint32_t current_offset)
 #define HAVE_TRI_STRIP_1 0
 #define HAVE_TRI_FANS    1
 #define HAVE_QUADS       0
-#define HAVE_QUAD_STRIPS 0
 #define HAVE_POLYGONS    0
 /* \todo: is it possible to make "ELTS" work with t_vertex code ? */
 #define HAVE_ELTS        0
diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
index ede16e1..8c27379 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -43,6 +43,10 @@
 #error "must have at least triangles to use render template"
 #endif
 
+#if HAVE_QUAD_STRIPS
+#error "quad strips not supported by render template"
+#endif
+
 #if !HAVE_ELTS
 #define ELTS_VARS(buf)
 #define ALLOC_ELTS(nr) 0
@@ -418,33 +422,9 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
 {
    GLuint j, nr;
 
-   if (HAVE_QUAD_STRIPS) {
-      LOCAL_VARS;
-      GLuint j, nr;
-      int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
-      int currentsz;
-
-      INIT(GL_QUAD_STRIP);
-
-      currentsz = GET_CURRENT_VB_MAX_VERTS();
-      if (currentsz < 8) {
-	 currentsz = dmasz;
-      }
-
-      dmasz -= (dmasz & 2);
-      currentsz -= (currentsz & 2);
-
-      for (j = 0; j + 3 < count; j += nr - 2 ) {
-	 nr = MIN2( currentsz, count - j );
-         TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
-	 currentsz = dmasz;
-      }
-
-      FLUSH();
-
-   } else if (HAVE_TRI_STRIPS && 
-	      ctx->Light.ShadeModel == GL_FLAT &&
-	      TNL_CONTEXT(ctx)->vb.AttribPtr[_TNL_ATTRIB_COLOR0]->stride) {
+   if (HAVE_TRI_STRIPS &&
+       ctx->Light.ShadeModel == GL_FLAT &&
+       TNL_CONTEXT(ctx)->vb.AttribPtr[_TNL_ATTRIB_COLOR0]->stride) {
       if (HAVE_ELTS) {
 	 LOCAL_VARS;
 	 int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@@ -999,9 +979,7 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
 					 GLuint count,
 					 GLuint flags )
 {
-   if (HAVE_QUAD_STRIPS && 0) {
-   }
-   else if (HAVE_TRI_STRIPS) {
+   if (HAVE_TRI_STRIPS) {
       LOCAL_VARS;
       GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
       int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@@ -1216,9 +1194,6 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx,
       case GL_QUAD_STRIP:
 	 if (VB->Elts) {
 	    ok = HAVE_TRI_STRIPS;
-	 }
-	 else if (HAVE_QUAD_STRIPS) {
-	    ok = GL_TRUE;
 	 } else if (HAVE_TRI_STRIPS && 
 		    ctx->Light.ShadeModel == GL_FLAT &&
 		    VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0) {
-- 
2.1.0



More information about the mesa-dev mailing list