summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-09-14 14:31:09 -0700
committerIan Romanick <[email protected]>2015-09-23 09:57:13 -0700
commit03c3208c185c29dd26446ffa5bae8f05f51d3f1b (patch)
treea13bfc02b987b065ebebec726a6366dfcf8cc07a
parent2e19ed3cb54cb33e8d772bfde78cc1d33dc0853b (diff)
t_dd_dmatmp: Require HAVE_TRI_FANS
Two drivers use this file, and both support triangle fans. No piglit regressions on i915 (G33) or radeon (Radeon 7500). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/mesa/tnl_dd/t_dd_dmatmp.h27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
index 0c63284d2cc..07e7ccc6b74 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -39,8 +39,8 @@
* tristrips, lineloops to linestrips), or to indexed vertices.
*/
-#if !HAVE_TRIANGLES || !HAVE_LINES || !HAVE_LINE_STRIPS || !HAVE_TRI_STRIPS
-#error "must have lines, line strips, triangles, and triangle strips to use render template"
+#if !HAVE_TRIANGLES || !HAVE_LINES || !HAVE_LINE_STRIPS || !HAVE_TRI_STRIPS || !HAVE_TRI_FANS
+#error "must have lines, line strips, triangles, triangle fans, and triangle strips to use render template"
#endif
#if HAVE_QUAD_STRIPS || HAVE_QUADS
@@ -312,7 +312,6 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx,
GLuint count,
GLuint flags )
{
- if (HAVE_TRI_FANS) {
LOCAL_VARS;
GLuint j, nr;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
@@ -336,14 +335,6 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx,
}
FLUSH();
- }
- else {
- /* Could write code to emit these as indexed vertices (for the
- * g400, for instance).
- */
- fprintf(stderr, "%s - cannot draw primitive\n", __func__);
- return;
- }
}
@@ -377,7 +368,7 @@ static void TAG(render_poly_verts)( struct gl_context *ctx,
FLUSH();
}
- else if (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH) {
+ else if (ctx->Light.ShadeModel == GL_SMOOTH) {
TAG(render_tri_fan_verts)( ctx, start, count, flags );
} else {
fprintf(stderr, "%s - cannot draw primitive\n", __func__);
@@ -812,7 +803,6 @@ static void TAG(render_tri_fan_elts)( struct gl_context *ctx,
GLuint count,
GLuint flags )
{
- if (HAVE_TRI_FANS) {
LOCAL_VARS;
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
GLuint j, nr;
@@ -837,11 +827,6 @@ static void TAG(render_tri_fan_elts)( struct gl_context *ctx,
FLUSH();
currentsz = dmasz;
}
- } else {
- /* TODO: try to emit as indexed triangles */
- fprintf(stderr, "%s - cannot draw primitive\n", __func__);
- return;
- }
}
@@ -875,7 +860,7 @@ 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 (ctx->Light.ShadeModel == GL_SMOOTH) {
TAG(render_tri_fan_verts)( ctx, start, count, flags );
} else {
fprintf(stderr, "%s - cannot draw primitive\n", __func__);
@@ -1054,14 +1039,14 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx,
ok = GL_TRUE;
break;
case GL_TRIANGLE_FAN:
- ok = HAVE_TRI_FANS;
+ ok = GL_TRUE;
break;
case GL_POLYGON:
if (HAVE_POLYGONS) {
ok = GL_TRUE;
}
else {
- ok = (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH);
+ ok = (ctx->Light.ShadeModel == GL_SMOOTH);
}
break;
case GL_QUAD_STRIP: