diff options
author | Brian <[email protected]> | 2008-01-06 18:07:26 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-06 18:07:26 -0700 |
commit | 601a6b872c33bfe3cb4ea03a5a8ba5ebe92dedaf (patch) | |
tree | 96730ec79e4a8c0dcbea3bab085ed624213f41fd /src/mesa/drivers/dri/savage | |
parent | ff73c783cc47361ff0dd819c82d067b4b85870dd (diff) |
Replace gl_framebuffer's _ColorDrawBufferMask with _ColorDrawBufferIndexes
Each array element is now a BUFFER_x token rather than a BUFFER_BIT_x bitmask.
The number of active color buffers is specified by _NumColorDrawBuffers.
This builds on the previous DrawBuffer changes and will help with drivers
implementing GL_ARB_draw_buffers.
Diffstat (limited to 'src/mesa/drivers/dri/savage')
-rw-r--r-- | src/mesa/drivers/dri/savage/savage_xmesa.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/savage/savagestate.c | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 013e88216fa..f23409fcbc9 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -730,7 +730,7 @@ void savageXMesaSetClipRects(savageContextPtr imesa) __DRIdrawablePrivate *dPriv = imesa->driDrawable; if ((dPriv->numBackClipRects == 0) - || (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)) { + || (imesa->glCtx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT)) { imesa->numClipRects = dPriv->numClipRects; imesa->pClipRects = dPriv->pClipRects; imesa->drawX = dPriv->x; diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index 741a9dda4f7..7c36b133a91 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -640,15 +640,17 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode ) savageContextPtr imesa = SAVAGE_CONTEXT(ctx); u_int32_t destCtrl = imesa->regs.s4.destCtrl.ui; - /* - * _DrawDestMask is easier to cope with than <mode>. - */ - switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { - case BUFFER_BIT_FRONT_LEFT: + if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { + FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + + switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) { + case BUFFER_FRONT_LEFT: imesa->IsDouble = GL_FALSE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11; break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: imesa->IsDouble = GL_TRUE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11; break; |