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/i810 | |
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/i810')
-rw-r--r-- | src/mesa/drivers/dri/i810/i810context.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i810/i810state.c | 16 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index 3f7f2cc8a47..9e09bddea3d 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -424,11 +424,11 @@ void i810XMesaSetBackClipRects( i810ContextPtr imesa ) static void i810XMesaWindowMoved( i810ContextPtr imesa ) { /* Determine current color drawing buffer */ - switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) { - case BUFFER_BIT_FRONT_LEFT: + switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferIndexes[0]) { + case BUFFER_FRONT_LEFT: i810XMesaSetFrontClipRects( imesa ); break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: i810XMesaSetBackClipRects( imesa ); break; default: @@ -486,11 +486,11 @@ i810UpdatePageFlipping( i810ContextPtr imesa ) int front = 0; /* Determine current color drawing buffer */ - switch (ctx->DrawBuffer->_ColorDrawBufferMask[0]) { - case BUFFER_BIT_FRONT_LEFT: + switch (ctx->DrawBuffer->_ColorDrawBufferIndexes[0]) { + case BUFFER_FRONT_LEFT: front = 1; break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: front = 0; break; default: diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index e0d5b2b4876..185c098b5e1 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -292,18 +292,20 @@ void i810DrawBuffer(GLcontext *ctx, GLenum mode ) i810ContextPtr imesa = I810_CONTEXT(ctx); int front = 0; - /* - * _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( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + + switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0]) { + case BUFFER_FRONT_LEFT: front = 1; break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: front = 0; break; default: - /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } |