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/mach64 | |
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/mach64')
-rw-r--r-- | src/mesa/drivers/dri/mach64/mach64_lock.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mach64/mach64_state.c | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/mach64/mach64_lock.c b/src/mesa/drivers/dri/mach64/mach64_lock.c index b73e350111f..13e212b81de 100644 --- a/src/mesa/drivers/dri/mach64/mach64_lock.c +++ b/src/mesa/drivers/dri/mach64/mach64_lock.c @@ -70,7 +70,7 @@ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags ) if ( mmesa->lastStamp != dPriv->lastStamp ) { mmesa->lastStamp = dPriv->lastStamp; - if (mmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) + if (mmesa->glCtx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_BACK_LEFT) mach64SetCliprects( mmesa->glCtx, GL_BACK_LEFT ); else mach64SetCliprects( mmesa->glCtx, GL_FRONT_LEFT ); diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index 667a3945206..10a5b40ba16 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -726,24 +726,26 @@ static void mach64DDDrawBuffer( GLcontext *ctx, GLenum mode ) FLUSH_BATCH( mmesa ); - /* - * _DrawDestMask is easier to cope with than <mode>. - */ - switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { - case BUFFER_BIT_FRONT_LEFT: + if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { + /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ + FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + + switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) { + case BUFFER_FRONT_LEFT: FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE ); mach64SetCliprects( ctx, GL_FRONT_LEFT ); if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) fprintf(stderr,"%s: BUFFER_BIT_FRONT_LEFT\n", __FUNCTION__); break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE ); mach64SetCliprects( ctx, GL_BACK_LEFT ); if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) fprintf(stderr,"%s: BUFFER_BIT_BACK_LEFT\n", __FUNCTION__); break; default: - /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_TRUE ); if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) fprintf(stderr,"%s: fallback (mode=%d)\n", __FUNCTION__, mode); |