Merge commit 'origin/gallium-0.1'
[mesa.git] / src / mesa / drivers / dri / sis / sis6326_state.c
index 08402fb3e2a5d6c7bb1b654b5b35b59f82b5e43a..65d4c064660784a0b7e184d73262248cb6005c49 100644 (file)
@@ -33,9 +33,9 @@
 #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 "vbo/vbo.h"
 #include "tnl/tnl.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;
    }