added dispatch override mechanism, used by trace extension
[mesa.git] / src / mesa / swrast / s_context.h
index 493758ad695fa819b3bd2753b75d66343c2b66fc..86b71ecc4590e57020175fd519c30caed02a24cb 100644 (file)
@@ -1,19 +1,19 @@
 /*
  * Mesa 3-D graphics library
  * Version:  3.5
- * 
+ *
  * Copyright (C) 1999  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"),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included
  * in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
@@ -28,7 +28,7 @@
 #ifndef S_CONTEXT_H
 #define S_CONTEXT_H
 
-#include "types.h"
+#include "mtypes.h"
 #include "swrast.h"
 
 /*
@@ -55,10 +55,19 @@ typedef void (*blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[],
                             GLchan src[][4], CONST GLchan dst[][4] );
 #endif
 
-typedef void (*swrast_tri_func)( GLcontext *ctx, 
-                                SWvertex *, SWvertex *, SWvertex *);
-typedef void (*swrast_line_func)( GLcontext *ctx, SWvertex *, SWvertex *);
-typedef void (*swrast_point_func)( GLcontext *ctx, SWvertex *);
+typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *);
+
+typedef void (*swrast_line_func)( GLcontext *ctx,
+                                  const SWvertex *, const SWvertex *);
+
+typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *,
+                                 const SWvertex *, const SWvertex *);
+
+typedef void (*swrast_quad_func)( GLcontext *ctx,
+                                  const SWvertex *, const SWvertex *,
+                                  const SWvertex *, const SWvertex *);
+
+
 
 /*
  * Bitmasks to indicate which rasterization options are enabled (RasterMask)
@@ -93,15 +102,33 @@ typedef void (*swrast_point_func)( GLcontext *ctx, SWvertex *);
 
 typedef struct
 {
-   GLuint NewState;
-   GLuint StateChanges;
+   /* Configuration mechanisms to make software rasterizer match
+    * characteristics of the hardware rasterizer (if present):
+    */
+   GLboolean AllowVertexFog;
+   GLboolean AllowPixelFog;
 
+   /* Derived values, invalidated on statechanges, updated from
+    * _swrast_validate_derived():
+    */
    GLuint _RasterMask;
+   GLboolean _MultiTextureEnabled;
    GLuint _MinMagThresh[MAX_TEXTURE_UNITS];
+   GLfloat _backface_sign;
+   GLboolean _PreferPixelFog;
+
+   /* Accum buffer temporaries.
+    */
+   GLboolean _IntegerAccumMode;        /* Storing unscaled integers? */
+   GLfloat _IntegerAccumScaler;        /* Implicit scale factor */
+
 
+   /* Working values:
+    */
    struct pixel_buffer* PB;
    GLuint StippleCounter;    /* Line stipple counter */
-
+   GLuint NewState;
+   GLuint StateChanges;
 
    /* Mechanism to allow driver (like X11) to register further
     * software rasterization routines.
@@ -120,11 +147,11 @@ typedef struct
    /* Function pointers for dispatch behind public entrypoints.
     */
    void (*InvalidateState)( GLcontext *ctx, GLuint new_state );
-   void (*Point)( GLcontext *ctx, SWvertex *v );
-   void (*Line)( GLcontext *ctx, SWvertex *v0, SWvertex *v1 );
-   void (*Triangle)( GLcontext *ctx, SWvertex *v0, SWvertex *v1, SWvertex *v2 );
-   void (*Quad)( GLcontext *ctx, SWvertex *v0, SWvertex *v1, SWvertex *v2, 
-                SWvertex *v3);
+
+   swrast_point_func Point;
+   swrast_line_func Line;
+   swrast_tri_func Triangle;
+   swrast_quad_func Quad;
 
    /* Internal hooks, kept uptodate by the same mechanism as above.
     */