On the way to getting stencil working.
[mesa.git] / src / mesa / drivers / dri / sis / sis_span.c
index 05e1777891cc44813451fa201dca005f8bba2139..47790a5f8527bf43e599255945af2ec352b5fee2 100644 (file)
@@ -34,6 +34,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "sis_context.h"
 #include "sis_span.h"
+#include "sis_lock.h"
+#include "sis_tris.h"
 
 #include "swrast/swrast.h"
 
@@ -203,11 +205,11 @@ static void sisDDSetBuffer( GLcontext *ctx,
    sisContextPtr smesa = SIS_CONTEXT(ctx);
 
    switch ( bufferBit ) {
-   case FRONT_LEFT_BIT:
+   case DD_FRONT_LEFT_BIT:
       smesa->drawOffset = smesa->readOffset = smesa->frontOffset;
       smesa->drawPitch  = smesa->readPitch  = smesa->frontPitch;
       break;
-   case BACK_LEFT_BIT:
+   case DD_BACK_LEFT_BIT:
       smesa->drawOffset = smesa->readOffset = smesa->backOffset;
       smesa->drawPitch  = smesa->readPitch  = smesa->backPitch;
       break;
@@ -216,16 +218,21 @@ static void sisDDSetBuffer( GLcontext *ctx,
    }
 }
 
-static void sisSpanRenderStart( GLcontext *ctx )
+void sisSpanRenderStart( GLcontext *ctx )
 {
    sisContextPtr smesa = SIS_CONTEXT(ctx);
 
+   SIS_FIREVERTICES(smesa);
+   LOCK_HARDWARE();
    WaitEngIdle( smesa );
 }
 
-static void sisSpanRenderFinish( GLcontext *ctx )
+void sisSpanRenderFinish( GLcontext *ctx )
 {
+   sisContextPtr smesa = SIS_CONTEXT(ctx);
+
    _swrast_flush( ctx );
+   UNLOCK_HARDWARE();
 }
 
 void
@@ -294,7 +301,7 @@ sisDDInitSpanFuncs( GLcontext *ctx )
       swdd->ReadRGBAPixels = sisReadRGBAPixels_8888;
       break;
     default:
-      assert(0);
+      sis_fatal_error("Bad bytesPerPixel.\n");
       break;
    }