From 601a6b872c33bfe3cb4ea03a5a8ba5ebe92dedaf Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 6 Jan 2008 18:07:26 -0700 Subject: 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. --- src/mesa/drivers/dri/r128/r128_state.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/mesa/drivers/dri/r128') diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index f1e92d7a7a..2abe59056e 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -897,18 +897,22 @@ static void r128DDDrawBuffer( GLcontext *ctx, GLenum mode ) FLUSH_BATCH( rmesa ); - /* - * _ColorDrawBufferMask is easier to cope with than . - */ - 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; -- cgit v1.2.3