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/sis | |
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/sis')
-rw-r--r-- | src/mesa/drivers/dri/sis/sis6326_state.c | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_state.c | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_tris.c | 2 |
3 files changed, 19 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/sis/sis6326_state.c b/src/mesa/drivers/dri/sis/sis6326_state.c index 08402fb3e2a..e47e663c358 100644 --- a/src/mesa/drivers/dri/sis/sis6326_state.c +++ b/src/mesa/drivers/dri/sis/sis6326_state.c @@ -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; } diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index 33a2f089b82..b7454d4a078 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -547,23 +547,24 @@ void sisDDDrawBuffer( GLcontext *ctx, GLenum mode ) __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; - /* - * _DrawDestMask is easier to cope with than <mode>. - */ + if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { + FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + current->hwDstSet &= ~MASK_DstBufferPitch; - switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { - case BUFFER_BIT_FRONT_LEFT: + switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) { + case BUFFER_FRONT_LEFT: FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE ); current->hwOffsetDest = smesa->front.offset >> 1; current->hwDstSet |= smesa->front.pitch >> 2; break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE ); current->hwOffsetDest = smesa->back.offset >> 1; current->hwDstSet |= smesa->back.pitch >> 2; break; default: - /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index a0e39dcd3c9..adbbb8ae137 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -848,7 +848,7 @@ static void sisRenderStart( GLcontext *ctx ) RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - if (ctx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT && + if (ctx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT && smesa->driDrawable->numClipRects != 0) { multipass_cliprect(ctx, 0); |