New comments, clean-up of fields related to point/line/triangle validation.
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 26 Jan 2006 01:32:47 +0000 (01:32 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 26 Jan 2006 01:32:47 +0000 (01:32 +0000)
src/mesa/drivers/dos/dmesa.c
src/mesa/drivers/x11/xm_dd.c
src/mesa/swrast/s_context.c
src/mesa/swrast/s_context.h

index 01667150e26a823a75ca1a2605974657fc8bd99f..719f4ec54daa0658add3676e588bad7bc6b1b93d 100644 (file)
@@ -868,8 +868,8 @@ dmesa_register_swrast_functions (GLcontext *ctx)
    swrast->choose_line = dmesa_choose_line;
    swrast->choose_triangle = dmesa_choose_tri;
 
-   swrast->invalidate_line |= DMESA_NEW_LINE;
-   swrast->invalidate_triangle |= DMESA_NEW_TRIANGLE;
+   swrast->InvalidateLineMask |= DMESA_NEW_LINE;
+   swrast->InvalidateTriangleMask |= DMESA_NEW_TRIANGLE;
 }
 
 
index e6f90d35bb214aa92539486d0f9df4d004fca23d..7a519335cc3764544d694585332ea0b16c83007e 100644 (file)
@@ -1293,8 +1293,10 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
                             _SWRAST_NEW_RASTERMASK)
 
 
-/* Extend the software rasterizer with our line/point/triangle
+/**
+ * Extend the software rasterizer with our line/point/triangle
  * functions.
+ * Called during context creation only.
  */
 void xmesa_register_swrast_functions( GLcontext *ctx )
 {
@@ -1304,7 +1306,8 @@ void xmesa_register_swrast_functions( GLcontext *ctx )
    swrast->choose_line = xmesa_choose_line;
    swrast->choose_triangle = xmesa_choose_triangle;
 
-   swrast->invalidate_point |= XMESA_NEW_POINT;
-   swrast->invalidate_line |= XMESA_NEW_LINE;
-   swrast->invalidate_triangle |= XMESA_NEW_TRIANGLE;
+   /* XXX these lines have no net effect.  Remove??? */
+   swrast->InvalidatePointMask |= XMESA_NEW_POINT;
+   swrast->InvalidateLineMask |= XMESA_NEW_LINE;
+   swrast->InvalidateTriangleMask |= XMESA_NEW_TRIANGLE;
 }
index 9d283b0589e4167bc1fbd5a43e216bb012cc47db..dc5b92dbf8feeb4c8d2f623428d0f63b304d4243 100644 (file)
@@ -392,13 +392,13 @@ _swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state )
       new_state = ~0;
    }
 
-   if (new_state & swrast->invalidate_triangle)
+   if (new_state & swrast->InvalidateTriangleMask)
       swrast->Triangle = _swrast_validate_triangle;
 
-   if (new_state & swrast->invalidate_line)
+   if (new_state & swrast->InvalidateLineMask)
       swrast->Line = _swrast_validate_line;
 
-   if (new_state & swrast->invalidate_point)
+   if (new_state & swrast->InvalidatePointMask)
       swrast->Point = _swrast_validate_point;
 
    if (new_state & _SWRAST_NEW_BLEND_FUNC)
@@ -570,9 +570,9 @@ _swrast_CreateContext( GLcontext *ctx )
    swrast->choose_line = _swrast_choose_line;
    swrast->choose_triangle = _swrast_choose_triangle;
 
-   swrast->invalidate_point = _SWRAST_NEW_POINT;
-   swrast->invalidate_line = _SWRAST_NEW_LINE;
-   swrast->invalidate_triangle = _SWRAST_NEW_TRIANGLE;
+   swrast->InvalidatePointMask = _SWRAST_NEW_POINT;
+   swrast->InvalidateLineMask = _SWRAST_NEW_LINE;
+   swrast->InvalidateTriangleMask = _SWRAST_NEW_TRIANGLE;
 
    swrast->Point = _swrast_validate_point;
    swrast->Line = _swrast_validate_line;
index 5cfe7627a5d100d5284f693267e8bc28b0d8aa52..c1c01df8f566b5e2aac863b0308def7b1d0716d3 100644 (file)
@@ -299,23 +299,32 @@ typedef struct
    GLuint StateChanges;
    GLenum Primitive;    /* current primitive being drawn (ala glBegin) */
 
-   /** Mechanism to allow driver (like X11) to register further
-    * software rasterization routines.
+   void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state );
+
+   /**
+    * When the NewState mask intersects these masks, we invalidate the
+    * Point/Line/Triangle function pointers below.
+    */
+   /*@{*/
+   GLbitfield InvalidatePointMask;
+   GLbitfield InvalidateLineMask;
+   GLbitfield InvalidateTriangleMask;
+   /*@}*/
+
+   /**
+    * Device drivers plug in functions for these callbacks.
+    * Will be called when the GL state change mask intersects the above masks.
     */
    /*@{*/
    void (*choose_point)( GLcontext * );
    void (*choose_line)( GLcontext * );
    void (*choose_triangle)( GLcontext * );
-
-   GLbitfield invalidate_point;
-   GLbitfield invalidate_line;
-   GLbitfield invalidate_triangle;
    /*@}*/
 
-   /** Function pointers for dispatch behind public entrypoints. */
+   /**
+    * Current point, line and triangle drawing functions.
+    */
    /*@{*/
-   void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state );
-
    swrast_point_func Point;
    swrast_line_func Line;
    swrast_tri_func Triangle;