Merge branch 'i965g-restart'
[mesa.git] / src / mesa / tnl_dd / t_dd_dmatmp2.h
index 46a35de06a9d3a9719c9f99613a022a8ad4309a0..cd225b6343eff8f240f31211385c0ef36e20a9db 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  4.0.3
+ * Version:  6.5.1
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -27,7 +26,9 @@
  */
 
 
-/* Template for render stages which build and emit vertices directly
+/**
+ * \file t_dd_dmatmp2.h
+ * Template for render stages which build and emit vertices directly
  * to fixed-size dma buffers.  Useful for rendering strips and other
  * native primitives where clipping and per-vertex tweaks such as
  * those in t_dd_tritmp.h are not required.
@@ -265,6 +266,7 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx,
            if (j + nr < count) {
               ELT_TYPE *dest = ALLOC_ELTS( nr );
               dest = TAG(emit_consecutive_elts)( ctx, dest, j, nr );
+              (void) dest;
               j += nr - 1;
               CLOSE_ELTS();
            }
@@ -272,6 +274,7 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx,
               ELT_TYPE *dest = ALLOC_ELTS( nr + 1 );
               dest = TAG(emit_consecutive_elts)( ctx, dest, j, nr );
               dest = TAG(emit_consecutive_elts)( ctx, dest, start, 1 );
+              (void) dest;
               j += nr;
               CLOSE_ELTS();
            }
@@ -422,7 +425,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
    if (HAVE_QUAD_STRIPS) {
       EMIT_PRIM( ctx, GL_QUAD_STRIP, HW_QUAD_STRIP, start, count );
    } 
-   else if (ctx->_TriangleCaps & DD_FLATSHADE) {
+   else if (ctx->Light.ShadeModel == GL_FLAT) {
       LOCAL_VARS;
       int dmasz = GET_MAX_HW_ELTS();
       GLuint j, nr;
@@ -470,7 +473,7 @@ static void TAG(render_quads_verts)( GLcontext *ctx,
       return;
 
    if (HAVE_QUADS) {
-      EMIT_PRIM( ctx, HW_QUADS, GL_QUADS, start, count );
+      EMIT_PRIM( ctx, GL_QUADS, HW_QUADS, start, count );
    } 
    else {
       /* Hardware doesn't have a quad primitive type -- simulate it
@@ -516,7 +519,7 @@ static void TAG(render_noop)( GLcontext *ctx,
 
 
 
-static render_func TAG(render_tab_verts)[GL_POLYGON+2] =
+static tnl_render_func TAG(render_tab_verts)[GL_POLYGON+2] =
 {
    TAG(render_points_verts),
    TAG(render_lines_verts),
@@ -553,6 +556,7 @@ static void TAG(render_points_elts)( GLcontext *ctx,
       nr = MIN2( dmasz, count - j );
       dest = ALLOC_ELTS( nr );
       dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
+      (void) dest;
       CLOSE_ELTS();
    }
 }
@@ -589,6 +593,7 @@ static void TAG(render_lines_elts)( GLcontext *ctx,
       nr = MIN2( dmasz, count - j );
       dest = ALLOC_ELTS( nr );
       dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
+      (void) dest;
       CLOSE_ELTS();
    }
 
@@ -620,6 +625,7 @@ static void TAG(render_line_strip_elts)( GLcontext *ctx,
       nr = MIN2( dmasz, count - j );
       dest = ALLOC_ELTS( nr );
       dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
+      (void) dest;
       CLOSE_ELTS();
    }
 }
@@ -670,6 +676,7 @@ static void TAG(render_line_loop_elts)( GLcontext *ctx,
       j += nr - 1;
       if (j + 1 >= count && (flags & PRIM_END)) {
         dest = TAG(emit_elts)( ctx, dest, elts+start, 1 );
+        (void) dest;
       }
       CLOSE_ELTS();
    }
@@ -702,6 +709,7 @@ static void TAG(render_triangles_elts)( GLcontext *ctx,
       nr = MIN2( dmasz, count - j );
       dest = ALLOC_ELTS( nr );
       dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
+      (void) dest;
       CLOSE_ELTS();
    }
 }
@@ -733,6 +741,7 @@ static void TAG(render_tri_strip_elts)( GLcontext *ctx,
 
       dest = ALLOC_ELTS( nr );
       dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
+      (void) dest;
       CLOSE_ELTS();
    }
 }
@@ -758,6 +767,7 @@ static void TAG(render_tri_fan_elts)( GLcontext *ctx,
       dest = ALLOC_ELTS( nr );
       dest = TAG(emit_elts)( ctx, dest, elts+start, 1 );
       dest = TAG(emit_elts)( ctx, dest, elts+j, nr - 1 );
+      (void) dest;
       CLOSE_ELTS();
    }
 }
@@ -784,6 +794,7 @@ static void TAG(render_poly_elts)( GLcontext *ctx,
       dest = ALLOC_ELTS( nr );
       dest = TAG(emit_elts)( ctx, dest, elts+start, 1 );
       dest = TAG(emit_elts)( ctx, dest, elts+j, nr - 1 );
+      (void) dest;
       CLOSE_ELTS();
    }
 }
@@ -810,7 +821,7 @@ static void TAG(render_quad_strip_elts)( GLcontext *ctx,
       dmasz -= dmasz & 1;
       count -= (count-start) & 1;
 
-      if (ctx->_TriangleCaps & DD_FLATSHADE) {
+      if (ctx->Light.ShadeModel == GL_FLAT) {
         ELT_INIT( GL_TRIANGLES, HW_TRIANGLES );
 
         dmasz = dmasz/6*2;
@@ -842,6 +853,7 @@ static void TAG(render_quad_strip_elts)( GLcontext *ctx,
            nr = MIN2( dmasz, count - j );
            dest = ALLOC_ELTS( nr );
            dest = TAG(emit_elts)( ctx, dest, elts+j, nr );
+           (void) dest;
            CLOSE_ELTS();
         }
       }
@@ -898,7 +910,7 @@ static void TAG(render_quads_elts)( GLcontext *ctx,
 
 
 
-static render_func TAG(render_tab_elts)[GL_POLYGON+2] =
+static tnl_render_func TAG(render_tab_elts)[GL_POLYGON+2] =
 {
    TAG(render_points_elts),
    TAG(render_lines_elts),