From 4ecc387a935d2364c5be02cbf7a72b0a05fa419a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 14 Sep 2015 12:38:19 -0700 Subject: [PATCH] t_dd_dmatmp: Remove HAVE_QUADS support Two drivers use this file, and neither supports quads. No piglit regressions on i915 (G33) or radeon (Radeon 7500). Signed-off-by: Ian Romanick Reviewed-by: Brian Paul --- 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 2b3cf48b413..990f65c188c 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 c01a985e355..dce8aea218e 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 5da0eae37cc..33a0256496c 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.30.2