Merge commit 'origin/gallium-0.1'
[mesa.git] / src / mesa / drivers / dri / sis / sis6326_state.c
index 6bc2c6de3bf84b3dcafbb5a28ab766e08a1925e0..65d4c064660784a0b7e184d73262248cb6005c49 100644 (file)
 #include "sis_tex.h"
 #include "sis_reg.h"
 
-#include "context.h"
-#include "enums.h"
-#include "colormac.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/colormac.h"
 #include "swrast/swrast.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
 #include "tnl/tnl.h"
 #include "swrast_setup/swrast_setup.h"
 
@@ -497,25 +497,27 @@ void sis6326DDDrawBuffer( GLcontext *ctx, GLenum mode )
    __GLSiSHardware *current = &smesa->current;
 
    if(getenv("SIS_DRAW_FRONT"))
-      ctx->DrawBuffer->_ColorDrawBufferMask[0] = GL_FRONT_LEFT;
+      ctx->DrawBuffer->_ColorDrawBufferIndexes[0] = BUFFER_FRONT_LEFT;
+
+   if (ctx->DrawBuffer->_NumColorDrawBuffers > 1) {
+      FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE );
+      return;
+   }
 
-   /*
-    * _DrawDestMask is easier to cope with than <mode>.
-    */
    current->hwDstSet &= ~MASK_DstBufferPitch;
-   switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
-   case BUFFER_BIT_FRONT_LEFT:
+
+   switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) {
+   case BUFFER_FRONT_LEFT:
       current->hwOffsetDest = smesa->front.offset;
       current->hwDstSet |= smesa->front.pitch;
       FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
       break;
-   case BUFFER_BIT_BACK_LEFT:
+   case BUFFER_BACK_LEFT:
       current->hwOffsetDest = smesa->back.offset;
       current->hwDstSet |= smesa->back.pitch;
       FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
       break;
    default:
-      /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
       FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE );
       return;
    }
@@ -645,7 +647,7 @@ sis6326DDInvalidateState( GLcontext *ctx, GLuint new_state )
 
        _swrast_InvalidateState( ctx, new_state );
        _swsetup_InvalidateState( ctx, new_state );
-       _ac_InvalidateState( ctx, new_state );
+       _vbo_InvalidateState( ctx, new_state );
        _tnl_InvalidateState( ctx, new_state );
        smesa->NewGLState |= new_state;
 }