Merge commit 'origin/gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / drivers / glide / fxtris.c
index 1b5c869872af30ebf5afdf187d3a7b935500ff5c..aff91fe7d4c28d011c2481948b1cd97840c940cd 100644 (file)
 
 #ifdef FX
 
-#include "imports.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
-#include "nvfragprog.h"
-
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/colormac.h"
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
 #include "tnl/t_context.h"
@@ -45,7 +43,7 @@
 #include "fxdrv.h"
 
 
-GLboolean fxMultipass_ColorSum (GLcontext *ctx, GLuint pass);
+static GLboolean fxMultipass_ColorSum (GLcontext *ctx, GLuint pass);
 
 
 /*
@@ -140,13 +138,13 @@ do {                                              \
  *              Fallback to swrast for basic primitives                *
  ***********************************************************************/
 
-/* Build an SWvertex from a hardware vertex. 
+/* Build an SWvertex from a hardware vertex.
  *
  * This code is hit only when a mix of accelerated and unaccelerated
  * primitives are being drawn, and only for the unaccelerated
- * primitives.  
+ * primitives.
  */
-static void 
+static void
 fx_translate_vertex( GLcontext *ctx, const GrVertex *src, SWvertex *dst)
 {
    fxMesaContext fxMesa = FX_CONTEXT(ctx);
@@ -201,10 +199,10 @@ fx_translate_vertex( GLcontext *ctx, const GrVertex *src, SWvertex *dst)
 }
 
 
-static void 
-fx_fallback_tri( fxMesaContext fxMesa, 
-                  GrVertex *v0, 
-                  GrVertex *v1, 
+static void
+fx_fallback_tri( fxMesaContext fxMesa,
+                  GrVertex *v0,
+                  GrVertex *v1,
                   GrVertex *v2 )
 {
    GLcontext *ctx = fxMesa->glCtx;
@@ -217,7 +215,7 @@ fx_fallback_tri( fxMesaContext fxMesa,
 }
 
 
-static void 
+static void
 fx_fallback_line( fxMesaContext fxMesa,
                    GrVertex *v0,
                    GrVertex *v1 )
@@ -230,8 +228,8 @@ fx_fallback_line( fxMesaContext fxMesa,
 }
 
 
-static void 
-fx_fallback_point( fxMesaContext fxMesa, 
+static void
+fx_fallback_point( fxMesaContext fxMesa,
                     GrVertex *v0 )
 {
    GLcontext *ctx = fxMesa->glCtx;
@@ -256,7 +254,7 @@ static void fx_print_vertex( GLcontext *ctx, const GrVertex *v )
 #else  /* !FX_PACKEDCOLOR */
  fprintf(stderr, "\tr %f g %f b %f a %f\n", v->r, v->g, v->b, v->a);
 #endif /* !FX_PACKEDCOLOR */
-   
+
  fprintf(stderr, "\n");
 }
 
@@ -1119,7 +1117,7 @@ static void fx_render_vb_line_loop( GLcontext *ctx,
    grDrawVertexArrayContiguous( GR_LINE_STRIP, count-j,
                                 fxVB + j, sizeof(GrVertex));
 
-   if (flags & PRIM_END) 
+   if (flags & PRIM_END)
       grDrawLine( fxVB + (count - 1),
                   fxVB + start );
 
@@ -1306,7 +1304,7 @@ static void fx_render_vb_noop( GLcontext *ctx,
 static void (*fx_render_tab_verts[GL_POLYGON+2])(GLcontext *,
                                                   GLuint,
                                                   GLuint,
-                                                  GLuint) = 
+                                                  GLuint) =
 {
    fx_render_vb_points,
    fx_render_vb_lines,
@@ -1361,8 +1359,8 @@ static void (*fx_render_tab_verts[GL_POLYGON+2])(GLcontext *,
     const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;      \
     (void) elt;
 
-#define RESET_STIPPLE 
-#define RESET_OCCLUSION 
+#define RESET_STIPPLE
+#define RESET_OCCLUSION
 #define PRESERVE_VB_DEFS
 
 /* Elts, no clipping.
@@ -1389,7 +1387,7 @@ static void (*fx_render_tab_verts[GL_POLYGON+2])(GLcontext *,
 
 
 
-static void fxRenderClippedPoly( GLcontext *ctx, const GLuint *elts, 
+static void fxRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
                                   GLuint n )
 {
    fxMesaContext fxMesa = FX_CONTEXT(ctx);
@@ -1397,12 +1395,12 @@ static void fxRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
    struct vertex_buffer *VB = &tnl->vb;
    GLuint prim = fxMesa->render_primitive;
 
-   /* Render the new vertices as an unclipped polygon. 
+   /* Render the new vertices as an unclipped polygon.
     */
    {
       GLuint *tmp = VB->Elts;
       VB->Elts = (GLuint *)elts;
-      tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, 
+      tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n,
                                                  PRIM_BEGIN|PRIM_END );
       VB->Elts = tmp;
    }
@@ -1414,7 +1412,7 @@ static void fxRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
 }
 
 
-static void fxFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts, 
+static void fxFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
                                       GLuint n )
 {
    int i;
@@ -1612,7 +1610,7 @@ static void fxRasterPrimitive( GLcontext *ctx, GLenum prim )
 
 
 
-/* Determine the rasterized primitive when not drawing unfilled 
+/* Determine the rasterized primitive when not drawing unfilled
  * polygons.
  */
 static void fxRenderPrimitive( GLcontext *ctx, GLenum prim )
@@ -1624,7 +1622,7 @@ static void fxRenderPrimitive( GLcontext *ctx, GLenum prim )
 
    if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
       return;
-       
+
    if (fxMesa->raster_primitive != rprim) {
       fxRasterPrimitive( ctx, rprim );
    }
@@ -1691,7 +1689,7 @@ void fxCheckIsInHardware( GLcontext *ctx )
         tnl->Driver.Render.Start = fxCheckTexSizes;
         tnl->Driver.Render.Finish = fxRenderFinish;
         tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive;
-        tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; 
+        tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
         tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
         tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
         tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
@@ -1729,14 +1727,14 @@ void fxDDInitTriFuncs( GLcontext *ctx )
    tnl->Driver.Render.Start = fxCheckTexSizes;
    tnl->Driver.Render.Finish = fxRenderFinish;
    tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive;
-   tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; 
+   tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon;
    tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
    tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
    tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
    tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
    tnl->Driver.Render.BuildVertices = fxBuildVertices;
    tnl->Driver.Render.Multipass = NULL;
-   
+
    (void) fx_print_vertex;
 }
 
@@ -1744,7 +1742,8 @@ void fxDDInitTriFuncs( GLcontext *ctx )
 /* [dBorca] Hack alert:
  * doesn't work with blending.
  */
-GLboolean fxMultipass_ColorSum (GLcontext *ctx, GLuint pass)
+static GLboolean
+fxMultipass_ColorSum (GLcontext *ctx, GLuint pass)
 {
  fxMesaContext fxMesa = FX_CONTEXT(ctx);
  tfxUnitsState *us = &fxMesa->unitsState;