-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.11 2002/10/30 12:51:39 alanh Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
#include "enums.h"
#include "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"
y1 = 0;
else if ( y1 >= rmesa->driScreen->fbHeight )
y1 = rmesa->driScreen->fbHeight - 1;
+ if ( x2 < 0 )
+ x2 = 0;
+ else if ( x2 >= rmesa->driScreen->fbWidth )
+ x2 = rmesa->driScreen->fbWidth - 1;
+ if ( y2 < 0 )
+ y2 = 0;
+ else if ( y2 >= rmesa->driScreen->fbHeight )
+ y2 = rmesa->driScreen->fbHeight - 1;
rmesa->setup.sc_top_left_c = (((y1 & 0x3FFF) << 16) | (x1 & 0x3FFF));
rmesa->setup.sc_bottom_right_c = (((y2 & 0x3FFF) << 16) | (x2 & 0x3FFF));
r128ContextPtr rmesa = R128_CONTEXT(ctx);
int x = rmesa->driDrawable->x;
int y = rmesa->driDrawable->y;
- struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
driRenderbuffer *drb = (driRenderbuffer *) rb;
rmesa->setup.window_xy_offset = (((y & 0xFFF) << R128_WINDOW_Y_SHIFT) |
FLUSH_BATCH( rmesa );
- /*
- * _ColorDrawBufferMask is easier to cope with than <mode>.
- */
- switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
- case BUFFER_BIT_FRONT_LEFT:
- case BUFFER_BIT_BACK_LEFT:
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
- default:
+ if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) {
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_TRUE );
- break;
+ return;
+ }
+ else {
+ switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) {
+ case BUFFER_FRONT_LEFT:
+ case BUFFER_BACK_LEFT:
+ FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
+ break;
+ default:
+ /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
+ FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_TRUE );
+ break;
+ }
}
rmesa->new_state |= R128_NEW_WINDOW;
R128_UPLOAD_WINDOW |
R128_UPLOAD_CORE) ) {
memcpy( &sarea->context_state, regs, sizeof(sarea->context_state) );
+
+ if( rmesa->dirty & R128_UPLOAD_CONTEXT )
+ {
+ /* One possible side-effect of uploading a new context is the
+ * setting of the R128_GMC_AUX_CLIP_DIS bit, which causes all
+ * auxilliary cliprects to be disabled. So the next command must
+ * upload them again. */
+ rmesa->dirty |= R128_UPLOAD_CLIPRECTS;
+ }
}
if ( (rmesa->dirty & R128_UPLOAD_TEX0) && t0 ) {
r128UpdateMasks( ctx );
if ( new_state & R128_NEW_WINDOW )
+ {
r128UpdateWindow( ctx );
+ r128CalcViewport( ctx );
+ }
if ( rmesa->NewGLState & _NEW_TEXTURE ) {
r128UpdateTextureState( ctx );
{
_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 );
R128_CONTEXT(ctx)->NewGLState |= new_state;
}
ctx->Driver.DepthRange = r128DepthRange;
ctx->Driver.Viewport = r128Viewport;
-
- /* Pixel path fallbacks.
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
-
- /* Swrast hooks for imaging extensions:
- */
- ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
- ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
- ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
- ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
}