[Mesa-dev] [PATCH 07/24] t_dd_dmatmp.h: Remove HAVE_QUADS support

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


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

Two drivers use this file, and neither supports quads.

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              | 51 +++---------------------------
 3 files changed, 5 insertions(+), 48 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c
index 2b3cf48..990f65c 100644
--- a/src/mesa/drivers/dri/i915/intel_render.c
+++ b/src/mesa/drivers/dri/i915/intel_render.c
@@ -64,7 +64,6 @@
 #define HAVE_TRI_STRIP_1 0      /* has it, template can't use it yet */
 #define HAVE_TRI_FANS    1
 #define HAVE_POLYGONS    1
-#define HAVE_QUADS       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 c01a985..dce8aea 100644
--- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
+++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
@@ -355,7 +355,6 @@ void r100_swtcl_flush(struct gl_context *ctx, uint32_t current_offset)
 #define HAVE_TRI_STRIPS  1
 #define HAVE_TRI_STRIP_1 0
 #define HAVE_TRI_FANS    1
-#define HAVE_QUADS       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 8c27379..8109daf 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -43,8 +43,8 @@
 #error "must have at least triangles to use render template"
 #endif
 
-#if HAVE_QUAD_STRIPS
-#error "quad strips not supported by render template"
+#if HAVE_QUAD_STRIPS || HAVE_QUADS
+#error "quads and quad strips not supported by render template"
 #endif
 
 #if !HAVE_ELTS
@@ -525,25 +525,7 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
    /* Emit whole number of quads in total. */
    count -= count & 3;
 
-   if (HAVE_QUADS) {
-      LOCAL_VARS;
-      int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/4) * 4;
-      int currentsz;
-      GLuint j, nr;
-
-      INIT(GL_QUADS);
-
-      currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4;
-      if (currentsz < 8)
-         currentsz = dmasz;
-
-      for (j = 0; j < count; j += nr) {
-         nr = MIN2( currentsz, count - j );
-         TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
-         currentsz = dmasz;
-      }
-   }
-   else if (HAVE_ELTS) {
+   if (HAVE_ELTS) {
       /* Hardware doesn't have a quad primitive type -- try to
        * simulate it using indexed vertices and the triangle
        * primitive:
@@ -1048,28 +1030,7 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
    /* Emit whole number of quads in total. */
    count -= count & 3;
 
-   if (HAVE_QUADS) {
-      LOCAL_VARS;
-      GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
-      int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS()/4*4;
-      int currentsz;
-      GLuint j, nr;
-
-      FLUSH();
-      ELT_INIT( GL_TRIANGLES );
-
-      currentsz = GET_CURRENT_VB_MAX_ELTS()/4*4;
-
-      if (currentsz < 8)
-	 currentsz = dmasz;
-
-      for (j = 0; j < count; j += nr) {
-	 nr = MIN2( currentsz, count - j );
-         TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
-	 FLUSH();
-	 currentsz = dmasz;
-      }
-   } else {
+   {
       LOCAL_VARS;
       GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
       int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@@ -1208,9 +1169,7 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx,
 	    ok = HAVE_TRI_STRIPS;
 	 break;
       case GL_QUADS:
-	 if (HAVE_QUADS) {
-	    ok = GL_TRUE;
-	 } else if (HAVE_ELTS) {
+         if (HAVE_ELTS) {
 	    ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS();
 	 }
 	 else {
-- 
2.1.0



More information about the mesa-dev mailing list