Only available with Xlib driver for now.
Assorted clean-ups related to Draw/ReadBuffer().
Renamed FRONT_LEFT_BIT -> DD_FRONT_LEFT_BIT, etc.
AMesaContext context = (AMesaContext)(ctx->DriverCtx);\r
GLboolean ok = GL_TRUE;\r
\r
- if (bit == FRONT_LEFT_BIT)\r
+ if (bit == DD_FRONT_LEFT_BIT)\r
context->Buffer->Active = context->Buffer->Screen;\r
\r
- else if (bit == BACK_LEFT)\r
+ else if (bit == DD_BACK_LEFT)\r
{\r
if (context->Buffer->Background)\r
context->Buffer->Active = context->Buffer->Background;\r
switch (bufferBit) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
dPriv->currentBuffer = dPriv->frontBuffer;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
dPriv->currentBuffer = dPriv->backBuffer;
break;
default:
#endif
fbc &= ~(FFB_FBC_WB_AB | FFB_FBC_RB_MASK);
switch (buffer) {
- case FRONT_LEFT_BIT:
+ case GL_FRONT:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
else
fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
break;
- case BACK_LEFT_BIT:
+ case GL_BACK:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
else
fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
break;
- case BACK_LEFT_BIT | FRONT_LEFT_BIT:
+ case GL_FRONT_AND_BACK:
fbc |= FFB_FBC_WB_AB;
break;
#endif
fbc &= ~(FFB_FBC_RB_MASK);
switch (bufferBit) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_RB_B;
else
fbc |= FFB_FBC_RB_A;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_RB_A;
else
break;
default:
+ _mesa_problem(ctx, "Unexpected buffer in ffbDDSetBuffer()");
return;
};
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
switch ( bufferBit ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
gmesa->readOffset = 0;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp;
break;
+ default:
+ _mesa_problem(ctx, "Unexpected buffer 0x%x in gammaSetBuffer()", bufferBit);
}
}
static void i810XMesaWindowMoved( i810ContextPtr imesa )
{
switch (imesa->glCtx->Color._DrawDestMask) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
i810XMesaSetFrontClipRects( imesa );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
i810XMesaSetBackClipRects( imesa );
break;
- case GL_FRONT_LEFT:
default:
/* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
i810XMesaSetFrontClipRects( imesa );
int front = 0;
switch (ctx->Color._DrawDestMask) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
front = 1;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
front = 0;
break;
default:
(void) buffer;
switch(bufferBit) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
if ( imesa->sarea->pf_current_page == 1)
imesa->readMap = imesa->i810Screen->back.map;
else
imesa->readMap = (char*)imesa->driScreen->pFB;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
if ( imesa->sarea->pf_current_page == 1)
imesa->readMap = (char*)imesa->driScreen->pFB;
else
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
- front=1;
+ case DD_FRONT_LEFT_BIT:
+ front = 1;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
front = 0;
break;
default:
static void i830XMesaWindowMoved( i830ContextPtr imesa )
{
switch (imesa->glCtx->Color._DrawDestMask) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
i830XMesaSetFrontClipRects( imesa );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
i830XMesaSetBackClipRects( imesa );
break;
default:
GLuint bufferBit)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
- if (bufferBit == FRONT_LEFT_BIT) {
+ if (bufferBit == DD_FRONT_LEFT_BIT) {
imesa->drawMap = (char *)imesa->driScreen->pFB;
imesa->readMap = (char *)imesa->driScreen->pFB;
- } else if (bufferBit == BACK_LEFT_BIT) {
+ } else if (bufferBit == DD_BACK_LEFT_BIT) {
imesa->drawMap = imesa->i830Screen->back.map;
imesa->readMap = imesa->i830Screen->back.map;
} else {
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
I830_FIREVERTICES(imesa);
I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset;
i830XMesaSetFrontClipRects( imesa );
FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
I830_FIREVERTICES(imesa);
I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
imesa->BufferSetup[I830_DESTREG_CBUFADDR] =
if ( mmesa->lastStamp != dPriv->lastStamp ) {
mmesa->lastStamp = dPriv->lastStamp;
- if (mmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT)
+ if (mmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT)
mach64SetCliprects( mmesa->glCtx, GL_BACK_LEFT );
else
mach64SetCliprects( mmesa->glCtx, GL_FRONT_LEFT );
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
switch ( bufferBit ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: FRONT_LEFT_BIT\n", __FUNCTION__);
+ fprintf(stderr,"%s: DD_FRONT_LEFT_BIT\n", __FUNCTION__);
mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->frontOffset;
mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->frontPitch;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: BACK_LEFT_BIT\n", __FUNCTION__);
+ fprintf(stderr,"%s: DD_BACK_LEFT_BIT\n", __FUNCTION__);
mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->backOffset;
mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->backPitch;
break;
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE );
mach64SetCliprects( ctx, GL_FRONT_LEFT );
if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: FRONT_LEFT_BIT\n", __FUNCTION__);
+ fprintf(stderr,"%s: DD_FRONT_LEFT_BIT\n", __FUNCTION__);
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE );
mach64SetCliprects( ctx, GL_BACK_LEFT );
if (MACH64_DEBUG & DEBUG_VERBOSE_MSG)
- fprintf(stderr,"%s: BACK_LEFT_BIT\n", __FUNCTION__);
+ fprintf(stderr,"%s: DD_BACK_LEFT_BIT\n", __FUNCTION__);
break;
default:
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
unsigned int offset;
- assert( (bufferBit == FRONT_LEFT_BIT) || (bufferBit == BACK_LEFT_BIT) );
+ assert((bufferBit == DD_FRONT_LEFT_BIT) || (bufferBit == DD_BACK_LEFT_BIT));
- offset = (bufferBit == FRONT_LEFT_BIT)
+ offset = (bufferBit == DD_FRONT_LEFT_BIT)
? mmesa->mgaScreen->frontOffset
: mmesa->mgaScreen->backOffset;
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
mmesa->draw_buffer = MGA_FRONT;
mgaXMesaSetFrontClipRects( mmesa );
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
mmesa->draw_buffer = MGA_BACK;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
- use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT);
+ use_back = (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT);
use_back ^= (rmesa->sarea->pfCurrentPage == 1);
if ( R128_DEBUG & DEBUG_VERBOSE_API )
r128ContextPtr rmesa = R128_CONTEXT(ctx);
switch ( bufferBit ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset;
rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch;
rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
}
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset;
rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
int use_back;
rmesa->doPageFlip = rmesa->sarea->pfState;
- use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT);
+ use_back = (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT);
use_back ^= (rmesa->sarea->pfCurrentPage == 1);
if (use_back) {
if ( rmesa->lastStamp != dPriv->lastStamp ) {
r200UpdatePageFlipping( rmesa );
- if (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT)
+ if (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT)
r200SetCliprects( rmesa, GL_BACK_LEFT );
else
r200SetCliprects( rmesa, GL_FRONT_LEFT );
r200ContextPtr rmesa = R200_CONTEXT(ctx);
switch ( bufferBit ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset;
rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch;
rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
}
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset;
rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch;
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE );
r200SetCliprects( rmesa, GL_FRONT_LEFT );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE );
r200SetCliprects( rmesa, GL_BACK_LEFT );
break;
rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate;
if ( RADEON_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, rmesa->glCtx );
+ fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *) rmesa->glCtx );
}
RADEON_FIREVERTICES( rmesa );
rmesa->doPageFlip = rmesa->sarea->pfState;
- use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT);
+ use_back = (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT);
use_back ^= (rmesa->sarea->pfCurrentPage == 1);
if ( RADEON_DEBUG & DEBUG_VERBOSE )
if ( rmesa->lastStamp != dPriv->lastStamp ) {
radeonUpdatePageFlipping( rmesa );
- if (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT)
+ if (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT)
radeonSetCliprects( rmesa, GL_BACK_LEFT );
else
radeonSetCliprects( rmesa, GL_FRONT_LEFT );
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
switch ( bufferBit ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset;
rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch;
rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch;
}
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset;
rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch;
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE );
radeonSetCliprects( rmesa, GL_FRONT_LEFT );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE );
radeonSetCliprects( rmesa, GL_BACK_LEFT );
break;
fprintf(stderr, "savageXMesaWindowMoved\n\n");
switch (imesa->glCtx->Color._DrawDestMask) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
savageXMesaSetFrontClipRects( imesa );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
savageXMesaSetBackClipRects( imesa );
break;
default:
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
char *map;
- assert( (bufferBit == FRONT_LEFT_BIT) || (bufferBit == BACK_LEFT_BIT) );
+ assert((bufferBit == DD_FRONT_LEFT_BIT) || (bufferBit == DD_BACK_LEFT_BIT));
- map = (bufferBit == FRONT_LEFT_BIT)
+ map = (bufferBit == DD_FRONT_LEFT_BIT)
? (char*)imesa->apertureBase[TARGET_FRONT]
: (char*)imesa->apertureBase[TARGET_BACK];
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
imesa->IsDouble = GL_FALSE;
if(imesa->IsFullScreen)
savageXMesaSetFrontClipRects( imesa );
FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
imesa->IsDouble = GL_TRUE;
imesa->drawMap = (char *)imesa->apertureBase[TARGET_BACK];
imesa->readMap = (char *)imesa->apertureBase[TARGET_BACK];
imesa->regs.s4.zBufOffset.ni.zDepthSelect = 1;
}
- if (imesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT) {
+ if (imesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT) {
if(imesa->IsFullScreen)
{
imesa->toggle = TARGET_BACK;
sisContextPtr smesa = SIS_CONTEXT(ctx);
switch ( bufferBit ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
smesa->drawOffset = smesa->readOffset = smesa->frontOffset;
smesa->drawPitch = smesa->readPitch = smesa->frontPitch;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
smesa->drawOffset = smesa->readOffset = smesa->backOffset;
smesa->drawPitch = smesa->readPitch = smesa->backPitch;
break;
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
- case BACK_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
*/
sisCheckTexSizes( ctx );
- if (ctx->Color._DrawDestMask == FRONT_LEFT_BIT &&
+ if (ctx->Color._DrawDestMask == DD_FRONT_LEFT_BIT &&
smesa->driDrawable->numClipRects != 0)
{
multipass_cliprect(ctx, 0);
fxMesa->Color.ClearAlpha,
fxMesa->Depth.Clear);
FX_grColorMaskv_NoLock(ctx, true4);
- if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
+ if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT)
fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
if (!ctx->Depth.Test || !ctx->Depth.Mask)
fxMesa->Glide.grDepthMask(FXFALSE);
fxMesa->Glide.grDepthMask(FXTRUE);
}
FX_grColorMaskv_NoLock(ctx, true4);
- if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
+ if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT)
fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
}
(void) buffer;
switch ( bufferBit ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
break;
default:
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
#endif
- if (bufferBit == FRONT_LEFT_BIT) {
+ if (bufferBit == DD_FRONT_LEFT_BIT) {
vmesa->drawMap = (char *)vmesa->driScreen->pFB;
vmesa->readMap = (char *)vmesa->driScreen->pFB;
vmesa->drawPitch = vmesa->front.pitch;
vmesa->readPitch = vmesa->front.pitch;
}
- else if (bufferBit == BACK_LEFT_BIT) {
+ else if (bufferBit == DD_BACK_LEFT_BIT) {
vmesa->drawMap = vmesa->back.map;
vmesa->readMap = vmesa->back.map;
vmesa->drawPitch = vmesa->back.pitch;
GLFBDevBufferPtr fbdevbuf = GLFBDEV_BUFFER(buffer);
fbdevctx->curBuffer = fbdevbuf;
switch (bufferBit) {
- case FRONT_LEFT_BIT:
+ case DD_FRONT_LEFT_BIT:
fbdevbuf->curBottom = fbdevbuf->frontBottom;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
fbdevbuf->curBottom = fbdevbuf->backBottom;
break;
default:
printf("set read %d\n", bufferBit);
GGIMESADPRINT_CORE("gl_ggiSetBuffer() called\n");
- if (bufferBit == FRONT_LEFT_BIT)
+ if (bufferBit == DD_FRONT_LEFT_BIT)
{
ggiSetReadFrame(ggi_ctx->ggi_visual,
ggiGetDisplayFrame(ggi_ctx->ggi_visual));
ggiGetDisplayFrame(ggi_ctx->ggi_visual));
return GL_TRUE;
}
- else if (bufferBit == BACK_LEFT_BIT)
+ else if (bufferBit == DD_BACK_LEFT_BIT)
{
ggiSetReadFrame(ggi_ctx->ggi_visual,
ggiGetDisplayFrame(ggi_ctx->ggi_visual)?0 : 1);
fxMesa->clearA,
clearD);
fxSetupColorMask(ctx);
- if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) {
+ if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT) {
grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
if (!fxMesa->unitsState.depthTestEnabled) {
grDepthMask(FXTRUE);
}
fxSetupColorMask(ctx);
- if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) {
+ if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT) {
grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
}
return FX_FALLBACK_STENCIL;
}
- if (ctx->Color._DrawDestMask != FRONT_LEFT_BIT && ctx->Color._DrawDestMask != BACK_LEFT_BIT) {
+ if (ctx->Color._DrawDestMask != DD_FRONT_LEFT_BIT &&
+ ctx->Color._DrawDestMask != DD_BACK_LEFT_BIT) {
return FX_FALLBACK_DRAW_BUFFER;
}
fprintf(stderr, "fxDDSetBuffer(%x)\n", (int)bufferBit);
}
- if (bufferBit == FRONT_LEFT_BIT) {
+ if (bufferBit == DD_FRONT_LEFT_BIT) {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
grRenderBuffer(fxMesa->currentFB);
}
- else if (bufferBit == BACK_LEFT_BIT) {
+ else if (bufferBit == DD_BACK_LEFT_BIT) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
grRenderBuffer(fxMesa->currentFB);
}
{
/* separate read buffer not supported */
ASSERT(buffer == ctx->DrawBuffer);
- ASSERT(bufferBit == FRONT_LEFT_BIT);
+ ASSERT(bufferBit == DD_FRONT_LEFT_BIT);
}
GLint depth_size, GLint stencil_size,
GLint accumRedSize, GLint accumGreenSize,
GLint accumBlueSize, GLint accumAlphaSize,
- GLint level )
+ GLint level, GLint numAuxBuffers )
{
GLboolean ximageFlag = GL_TRUE;
XMesaVisual xmvis;
XMesaVisual v = VisualTable[i];
if (v->display == dpy
&& v->mesa_visual.level == level
+ && v->mesa_visual.numAuxBuffers == numAuxBuffers
&& v->ximage_flag == ximageFlag
&& v->mesa_visual.rgbMode == rgbFlag
&& v->mesa_visual.doubleBufferMode == dbFlag
/* add xmvis to the list */
VisualTable[NumVisuals] = xmvis;
NumVisuals++;
+ /* XXX minor hack */
+ xmvis->mesa_visual.numAuxBuffers = numAuxBuffers;
}
return xmvis;
}
0, /* depth bits */
0, /* stencil bits */
0,0,0,0, /* accum bits */
- vislevel /* level */
+ vislevel, /* level */
+ 0 /* numAux */
);
}
else if (is_usable_visual( visinfo )) {
0 * sizeof(GLaccum), /* g */
0 * sizeof(GLaccum), /* b */
0 * sizeof(GLaccum), /* a */
- 0 /* level */
+ 0, /* level */
+ 0 /* numAux */
);
}
else {
8 * sizeof(GLaccum), /* g */
8 * sizeof(GLaccum), /* b */
8 * sizeof(GLaccum), /* a */
- 0 /* level */
+ 0, /* level */
+ 0 /* numAux */
);
}
}
GLint caveat = DONT_CARE;
XMesaVisual xmvis = NULL;
int desiredVisualID = -1;
+ int numAux = 0;
parselist = list;
case GLX_AUX_BUFFERS:
/* ignore */
parselist++;
- parselist++;
+ numAux = *parselist++;
+ if (numAux > MAX_AUX_BUFFERS)
+ return NULL;
break;
case GLX_RED_SIZE:
parselist++;
xmvis = save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag,
stereo_flag, depth_size, stencil_size,
accumRedSize, accumGreenSize,
- accumBlueSize, accumAlphaSize, level );
+ accumBlueSize, accumAlphaSize, level, numAux );
}
return xmvis;
*value = (int) xmvis->mesa_visual.stereoMode;
return 0;
case GLX_AUX_BUFFERS:
- *value = (int) False;
+ *value = xmvis->mesa_visual.numAuxBuffers;
return 0;
case GLX_RED_SIZE:
*value = xmvis->mesa_visual.redBits;
accum_blue_size, accum_alpha_size,
0 );
+ /* XXX minor hack */
v->mesa_visual.level = level;
return v;
}
v->mesa_visual.stencilBits > 0,
v->mesa_visual.accumRedBits > 0,
v->mesa_visual.alphaBits > 0 );
+ /* XXX hack */
+ b->mesa_buffer.UseSoftwareAuxBuffers = GL_TRUE;
if (!initialize_visual_and_buffer( client, v, b, v->mesa_visual.rgbMode,
(XMesaDrawable)w, b->cmap )) {
#include "xmesaP.h"
#include "array_cache/acache.h"
#include "swrast/swrast.h"
+#include "swrast/s_auxbuffer.h"
#include "swrast/s_context.h"
#include "swrast/s_drawpix.h"
#include "swrast/s_alphabuf.h"
/*
* Now determine front vs back color buffer.
*/
- if (bufferBit == FRONT_LEFT_BIT) {
+ if (bufferBit == DD_FRONT_LEFT_BIT) {
target->buffer = target->frontbuffer;
+ xmesa_update_span_funcs(ctx);
}
- else if (bufferBit == BACK_LEFT_BIT) {
+ else if (bufferBit == DD_BACK_LEFT_BIT) {
ASSERT(target->db_state);
if (target->backpixmap) {
/* back buffer is a pixmap */
/* No back buffer!!!! Must be out of memory, use front buffer */
target->buffer = target->frontbuffer;
}
+ xmesa_update_span_funcs(ctx);
}
+ else if (bufferBit & (DD_AUX0_BIT | DD_AUX1_BIT | DD_AUX2_BIT | DD_AUX3_BIT)) {
+ _swrast_use_aux_buffer(ctx, buffer, bufferBit);
+ }
else {
_mesa_problem(ctx, "invalid buffer 0x%x in set_buffer() in xm_dd.c");
return;
}
- xmesa_update_span_funcs(ctx);
}
break;
}
- xmesa_update_span_funcs(ctx);
+ if (ctx->Color._DrawDestMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
+ xmesa_update_span_funcs(ctx);
+ }
}
SWcontext *swrast = SWRAST_CONTEXT(ctx);
int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
+ if ((ctx->Color._DrawDestMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) ==0)
+ return (swrast_line_func) NULL;
if (ctx->RenderMode != GL_RENDER) return (swrast_line_func) NULL;
if (ctx->Line.SmoothFlag) return (swrast_line_func) NULL;
if (ctx->Texture._EnabledUnits) return (swrast_line_func) NULL;
triFuncName = NULL;
#endif
+ if ((ctx->Color._DrawDestMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) ==0)
+ return (swrast_tri_func) NULL;
if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL;
if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL;
if (ctx->Texture._EnabledUnits) return (swrast_tri_func) NULL;
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
/*@{*/
/**
- * Initialization of the context color data.
+ * Initialization of the context's Color attribute group.
*
* \param ctx GL context.
*
if (ctx->Visual.doubleBufferMode) {
ctx->Color.DrawBuffer = GL_BACK;
- ctx->Color._DrawDestMask = BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_BACK_LEFT_BIT;
}
else {
ctx->Color.DrawBuffer = GL_FRONT;
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
}
}
/*
* Mesa 3-D graphics library
- * Version: 6.0.1
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
case GL_FRONT:
/* never an error */
if (ctx->Visual.stereoMode)
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT | FRONT_RIGHT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT | DD_FRONT_RIGHT_BIT;
else
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
break;
case GL_BACK:
if (!ctx->Visual.doubleBufferMode) {
return;
}
if (ctx->Visual.stereoMode)
- ctx->Color._DrawDestMask = BACK_LEFT_BIT | BACK_RIGHT_BIT;
+ ctx->Color._DrawDestMask = DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT;
else
- ctx->Color._DrawDestMask = BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_BACK_LEFT_BIT;
break;
case GL_NONE:
/* never an error */
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_RIGHT)");
return;}
if (ctx->Visual.doubleBufferMode)
- ctx->Color._DrawDestMask = FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
else
- ctx->Color._DrawDestMask = FRONT_RIGHT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_RIGHT_BIT;
break;
case GL_FRONT_RIGHT:
if (!ctx->Visual.stereoMode) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_FRONT_RIGHT)");
return;
}
- ctx->Color._DrawDestMask = FRONT_RIGHT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_RIGHT_BIT;
break;
case GL_BACK_RIGHT:
if (!ctx->Visual.stereoMode || !ctx->Visual.doubleBufferMode) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_BACK_RIGHT)");
return;
}
- ctx->Color._DrawDestMask = BACK_RIGHT_BIT;
+ ctx->Color._DrawDestMask = DD_BACK_RIGHT_BIT;
break;
case GL_BACK_LEFT:
if (!ctx->Visual.doubleBufferMode) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_BACK_LEFT)");
return;
}
- ctx->Color._DrawDestMask = BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_BACK_LEFT_BIT;
break;
case GL_FRONT_AND_BACK:
if (!ctx->Visual.doubleBufferMode) {
return;
}
if (ctx->Visual.stereoMode)
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT
- | FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT
+ | DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
else
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT;
break;
case GL_LEFT:
/* never an error */
if (ctx->Visual.doubleBufferMode)
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT;
else
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
break;
case GL_FRONT_LEFT:
/* never an error */
- ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
+ ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
break;
case GL_AUX0:
- if (ctx->Const.NumAuxBuffers >= 1) {
- ctx->Color._DrawDestMask = AUX0_BIT;
+ if (ctx->Visual.numAuxBuffers >= 1) {
+ ctx->Color._DrawDestMask = DD_AUX0_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX0)" );
}
break;
case GL_AUX1:
- if (ctx->Const.NumAuxBuffers >= 2) {
- ctx->Color._DrawDestMask = AUX1_BIT;
+ if (ctx->Visual.numAuxBuffers >= 2) {
+ ctx->Color._DrawDestMask = DD_AUX1_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX1)" );
}
break;
case GL_AUX2:
- if (ctx->Const.NumAuxBuffers >= 3) {
- ctx->Color._DrawDestMask = AUX2_BIT;
+ if (ctx->Visual.numAuxBuffers >= 3) {
+ ctx->Color._DrawDestMask = DD_AUX2_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX2)" );
}
break;
case GL_AUX3:
- if (ctx->Const.NumAuxBuffers >= 4) {
- ctx->Color._DrawDestMask = AUX3_BIT;
+ if (ctx->Visual.numAuxBuffers >= 4) {
+ ctx->Color._DrawDestMask = DD_AUX3_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX3)" );
case GL_FRONT:
case GL_FRONT_LEFT:
/* Front-Left buffer, always exists */
- ctx->Pixel._ReadSrcMask = FRONT_LEFT_BIT;
+ ctx->Pixel._ReadSrcMask = DD_FRONT_LEFT_BIT;
break;
case GL_BACK:
case GL_BACK_LEFT:
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
- ctx->Pixel._ReadSrcMask = BACK_LEFT_BIT;
+ ctx->Pixel._ReadSrcMask = DD_BACK_LEFT_BIT;
break;
#if _HAVE_FULL_GL
case GL_FRONT_RIGHT:
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
- ctx->Pixel._ReadSrcMask = FRONT_RIGHT_BIT;
+ ctx->Pixel._ReadSrcMask = DD_FRONT_RIGHT_BIT;
break;
case GL_BACK_RIGHT:
if (!ctx->Visual.stereoMode || !ctx->Visual.doubleBufferMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
- ctx->Pixel._ReadSrcMask = BACK_RIGHT_BIT;
+ ctx->Pixel._ReadSrcMask = DD_BACK_RIGHT_BIT;
break;
case GL_AUX0:
- if (ctx->Const.NumAuxBuffers >= 1) {
- ctx->Pixel._ReadSrcMask = AUX0_BIT;
+ if (ctx->Visual.numAuxBuffers >= 1) {
+ ctx->Pixel._ReadSrcMask = DD_AUX0_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX0)" );
}
break;
case GL_AUX1:
- if (ctx->Const.NumAuxBuffers >= 2) {
- ctx->Pixel._ReadSrcMask = AUX1_BIT;
+ if (ctx->Visual.numAuxBuffers >= 2) {
+ ctx->Pixel._ReadSrcMask = DD_AUX1_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX1)" );
}
break;
case GL_AUX2:
- if (ctx->Const.NumAuxBuffers >= 3) {
- ctx->Pixel._ReadSrcMask = AUX2_BIT;
+ if (ctx->Visual.numAuxBuffers >= 3) {
+ ctx->Pixel._ReadSrcMask = DD_AUX2_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX2)" );
}
break;
case GL_AUX3:
- if (ctx->Const.NumAuxBuffers >= 4) {
- ctx->Pixel._ReadSrcMask = AUX3_BIT;
+ if (ctx->Visual.numAuxBuffers >= 4) {
+ ctx->Pixel._ReadSrcMask = DD_AUX3_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX3)" );
/** Maximum pixel map lookup table size */
#define MAX_PIXEL_MAP_TABLE 256
-/** Number of auxillary color buffers */
-#define NUM_AUX_BUFFERS 0
+/** Maximum Number of auxillary color buffers */
+#define MAX_AUX_BUFFERS 4
/** Maximum order (degree) of curves */
#ifdef AMIGA
/*@{*/
/**
- * Allocate a new GLvisual object.
+ * Allocates a GLvisual structure and initializes it via
+ * _mesa_initialize_visual().
*
* \param rgbFlag GL_TRUE for RGB(A) mode, GL_FALSE for Color Index mode.
* \param dbFlag double buffering
* \return pointer to new GLvisual or NULL if requested parameters can't be
* met.
*
- * Allocates a GLvisual structure and initializes it via
- * _mesa_initialize_visual().
+ * \note Need to add params for level and numAuxBuffers (at least)
*/
GLvisual *
_mesa_create_visual( GLboolean rgbFlag,
}
/**
- * Initialize the fields of the given GLvisual.
+ * Makes some sanity checks and fills in the fields of the
+ * GLvisual structure with the given parameters.
*
* \return GL_TRUE on success, or GL_FALSE on failure.
*
* \sa _mesa_create_visual() above for the parameter description.
*
- * Makes some sanity checks and fills in the fields of the
- * GLvisual structure with the given parameters.
+ * \note Need to add params for level and numAuxBuffers (at least)
*/
GLboolean
_mesa_initialize_visual( GLvisual *vis,
GLint accumAlphaBits,
GLint numSamples )
{
- (void) numSamples;
-
assert(vis);
/* This is to catch bad values from device drivers not updated for
vis->numAuxBuffers = 0;
vis->level = 0;
vis->pixmapMode = 0;
+ vis->samples = numSamples;
return GL_TRUE;
}
+
/**
- * Destroy a visual.
+ * Destroy a visual and free its memory.
*
* \param vis visual.
*
/*@{*/
/**
- * Create a new framebuffer.
+ * Allocate a GLframebuffer structure and initializes it via
+ * _mesa_initialize_framebuffer().
*
* A GLframebuffer is a structure which encapsulates the depth, stencil and
* accum buffers and related parameters.
*
* \return pointer to new GLframebuffer struct or NULL if error.
*
- * Allocate a GLframebuffer structure and initializes it via
- * _mesa_initialize_framebuffer().
+ * \note Need to add softwareAuxBuffers parameter.
*/
GLframebuffer *
_mesa_create_framebuffer( const GLvisual *visual,
return buffer;
}
+
/**
- * Initialize a GLframebuffer object.
- *
- * \sa _mesa_create_framebuffer() above for the parameter description.
- *
* Makes some sanity checks and fills in the fields of the
* GLframebuffer structure with the given parameters.
+ *
+ * \sa _mesa_create_framebuffer() above for the parameter description.
*/
void
_mesa_initialize_framebuffer( GLframebuffer *buffer,
GLboolean softwareAccum,
GLboolean softwareAlpha )
{
+ GLboolean softwareAux = GL_FALSE;
assert(buffer);
assert(visual);
buffer->UseSoftwareStencilBuffer = softwareStencil;
buffer->UseSoftwareAccumBuffer = softwareAccum;
buffer->UseSoftwareAlphaBuffers = softwareAlpha;
+ buffer->UseSoftwareAuxBuffers = softwareAux;
}
+
/**
* Free a framebuffer struct and its buffers.
*
}
}
+
/**
* Free the data hanging off of \p buffer, but not \p buffer itself.
*
/* do some implementation tests */
assert( sizeof(GLbyte) == 1 );
- assert( sizeof(GLshort) >= 2 );
- assert( sizeof(GLint) >= 4 );
assert( sizeof(GLubyte) == 1 );
- assert( sizeof(GLushort) >= 2 );
- assert( sizeof(GLuint) >= 4 );
+ assert( sizeof(GLshort) == 2 );
+ assert( sizeof(GLushort) == 2 );
+ assert( sizeof(GLint) == 4 );
+ assert( sizeof(GLuint) == 4 );
_mesa_init_lists();
_glthread_UNLOCK_MUTEX(OneTimeLock);
}
+
/**
* Allocate and initialize a shared context state structure.
- *
- * \return pointer to a gl_shared_state structure on success, or NULL on
- * failure.
- *
* Initializes the display list, texture objects and vertex programs hash
* tables, allocates the texture objects. If it runs out of memory, frees
* everything already allocated before returning NULL.
+ *
+ * \return pointer to a gl_shared_state structure on success, or NULL on
+ * failure.
*/
static GLboolean
alloc_shared_state( GLcontext *ctx )
ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH;
ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH;
ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY;
- ctx->Const.NumAuxBuffers = NUM_AUX_BUFFERS;
ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
struct gl_pixelstore_attrib;
-/* Mask bits sent to the driver Clear() function */
-#define DD_FRONT_LEFT_BIT FRONT_LEFT_BIT /* 1 */
-#define DD_FRONT_RIGHT_BIT FRONT_RIGHT_BIT /* 2 */
-#define DD_BACK_LEFT_BIT BACK_LEFT_BIT /* 4 */
-#define DD_BACK_RIGHT_BIT BACK_RIGHT_BIT /* 8 */
-#define DD_AUX0 AUX0_BIT /* future use */
-#define DD_AUX1 AUX1_BIT /* future use */
-#define DD_AUX2 AUX2_BIT /* future use */
-#define DD_AUX3 AUX3_BIT /* future use */
-#define DD_DEPTH_BIT GL_DEPTH_BUFFER_BIT /* 0x00000100 */
-#define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */
-#define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */
-
-
/**
* Device driver function table.
* Core Mesa uses these function pointers to call into device drivers.
void (*DepthFunc)(GLcontext *ctx, GLenum func);
/** Enable or disable writing into the depth buffer */
void (*DepthMask)(GLcontext *ctx, GLboolean flag);
- /** Specify mapping of depth values from normalized device coordinates to window coordinates */
+ /** Specify mapping of depth values from NDC to window coordinates */
void (*DepthRange)(GLcontext *ctx, GLclampd nearval, GLclampd farval);
/** Specify the current buffer for writing */
void (*DrawBuffer)( GLcontext *ctx, GLenum buffer );
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
*params = ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (ctx->Const.NumAuxBuffers) ? GL_TRUE : GL_FALSE;
+ *params = (ctx->Visual.numAuxBuffers) ? GL_TRUE : GL_FALSE;
break;
case GL_BLEND:
*params = ctx->Color.BlendEnabled;
*params = (GLdouble) ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (GLdouble) ctx->Const.NumAuxBuffers;
+ *params = (GLdouble) ctx->Visual.numAuxBuffers;
break;
case GL_BLEND:
*params = (GLdouble) ctx->Color.BlendEnabled;
*params = (GLfloat) ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (GLfloat) ctx->Const.NumAuxBuffers;
+ *params = (GLfloat) ctx->Visual.numAuxBuffers;
break;
case GL_BLEND:
*params = (GLfloat) ctx->Color.BlendEnabled;
*params = (GLint) ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (GLint) ctx->Const.NumAuxBuffers;
+ *params = (GLint) ctx->Visual.numAuxBuffers;
break;
case GL_BLEND:
*params = (GLint) ctx->Color.BlendEnabled;
FRAG_BIT_TEX7)
+/**
+ * Bits for each basic buffer in a complete framebuffer.
+ * When glDrawBuffer(GL_FRONT_AND_BACK) is called (non-stereo),
+ * _DrawDestMask will be set to (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT),
+ * for example. Also passed to ctx->Driver.Clear() to indicate which
+ * buffers to clear.
+ */
+/*@{*/
+#define DD_FRONT_LEFT_BIT 0x1
+#define DD_FRONT_RIGHT_BIT 0x2
+#define DD_BACK_LEFT_BIT 0x4
+#define DD_BACK_RIGHT_BIT 0x8
+#define DD_AUX0_BIT 0x10
+#define DD_AUX1_BIT 0x20
+#define DD_AUX2_BIT 0x40
+#define DD_AUX3_BIT 0x80
+#define DD_DEPTH_BIT GL_DEPTH_BUFFER_BIT /* 0x00000100 */
+#define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */
+#define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */
+/*@}*/
+
/**
* Maximum number of temporary vertices required for clipping.
};
-/**
- * \name Clipping planes bits
- *
- * Used in gl_colorbuffer_attrib::_DrawDestMask and
- * gl_colorbuffer_attrib::_ReadSrcMask below to identify color buffers.
- */
-/*@{*/
-#define FRONT_LEFT_BIT 0x1
-#define FRONT_RIGHT_BIT 0x2
-#define BACK_LEFT_BIT 0x4
-#define BACK_RIGHT_BIT 0x8
-#define AUX0_BIT 0x10
-#define AUX1_BIT 0x20
-#define AUX2_BIT 0x40
-#define AUX3_BIT 0x80
-/*@}*/
-
-
/**
* Color buffers attributes.
*/
GLubyte ColorMask[4]; /**< Each flag is 0xff or 0x0 */
GLenum DrawBuffer; /**< Which buffer to draw into */
- GLubyte _DrawDestMask; /**< bitwise-OR of FRONT/BACK_LEFT/RIGHT_BITs */
+ GLbitfield _DrawDestMask; /**< bitmask of DD_*_BIT bits */
/**
* \name alpha testing
GLboolean UseSoftwareAccumBuffer;
GLboolean UseSoftwareStencilBuffer;
GLboolean UseSoftwareAlphaBuffers;
+ GLboolean UseSoftwareAuxBuffers;
/** \name Software depth (aka Z) buffer */
/*@{*/
GLchan *BackRightAlpha; /**< array [Width*Height] of GLchan */
/*@}*/
+ GLchan *AuxBuffers[MAX_AUX_BUFFERS];
+
/**
* \name Drawing bounds
*
GLfloat MinLineWidth, MaxLineWidth; /* aliased */
GLfloat MinLineWidthAA, MaxLineWidthAA; /* antialiased */
GLfloat LineWidthGranularity;
- GLuint NumAuxBuffers;
GLuint MaxColorTableSize;
GLuint MaxConvolutionWidth;
GLuint MaxConvolutionHeight;
/***** Initialization *****/
/**********************************************************************/
+
+/**
+ * Initialize the context's PIXEL attribute group.
+ */
void
-_mesa_init_pixel( GLcontext * ctx )
+_mesa_init_pixel( GLcontext *ctx )
{
int i;
if (ctx->Visual.doubleBufferMode) {
ctx->Pixel.ReadBuffer = GL_BACK;
- ctx->Pixel._ReadSrcMask = BACK_LEFT_BIT;
+ ctx->Pixel._ReadSrcMask = DD_BACK_LEFT_BIT;
}
else {
ctx->Pixel.ReadBuffer = GL_FRONT;
- ctx->Pixel._ReadSrcMask = FRONT_LEFT_BIT;
+ ctx->Pixel._ReadSrcMask = DD_FRONT_LEFT_BIT;
}
/* Miscellaneous */
swrast/s_accum.c \
swrast/s_alpha.c \
swrast/s_alphabuf.c \
+ swrast/s_auxbuffer.c \
swrast/s_bitmap.c \
swrast/s_blend.c \
swrast/s_buffers.c \
for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
if (bufferBit & ctx->Color._DrawDestMask) {
GLchan *buffer;
- if (bufferBit == FRONT_LEFT_BIT) {
+ if (bufferBit == DD_FRONT_LEFT_BIT) {
buffer = ctx->DrawBuffer->FrontLeftAlpha;
}
- else if (bufferBit == FRONT_RIGHT_BIT) {
+ else if (bufferBit == DD_FRONT_RIGHT_BIT) {
buffer = ctx->DrawBuffer->FrontRightAlpha;
}
- else if (bufferBit == BACK_LEFT_BIT) {
+ else if (bufferBit == DD_BACK_LEFT_BIT) {
buffer = ctx->DrawBuffer->BackLeftAlpha;
}
else {
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- switch (swrast->CurrentBuffer) {
- case FRONT_LEFT_BIT:
+ switch (swrast->CurrentBufferBit) {
+ case DD_FRONT_LEFT_BIT:
return ctx->DrawBuffer->FrontLeftAlpha;
break;
- case BACK_LEFT_BIT:
+ case DD_BACK_LEFT_BIT:
return ctx->DrawBuffer->BackLeftAlpha;
break;
- case FRONT_RIGHT_BIT:
+ case DD_FRONT_RIGHT_BIT:
return ctx->DrawBuffer->FrontRightAlpha;
break;
- case BACK_RIGHT_BIT:
+ case DD_BACK_RIGHT_BIT:
return ctx->DrawBuffer->BackRightAlpha;
break;
default:
--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.1
+ *
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+
+#include "s_auxbuffer.h"
+#include "s_context.h"
+
+
+
+void
+_swrast_alloc_aux_buffers( GLframebuffer *buffer )
+{
+ GLuint i;
+
+ for (i = 0; i < buffer->Visual.numAuxBuffers; i++) {
+ if (buffer->AuxBuffers[i]) {
+ _mesa_free(buffer->AuxBuffers[i]);
+ buffer->AuxBuffers[i] = NULL;
+ }
+
+ buffer->AuxBuffers[i] = _mesa_malloc(buffer->Width * buffer->Height
+ * 4 * sizeof(GLchan));
+ }
+}
+
+
+
+/* RGBA */
+#define NAME(PREFIX) PREFIX##_aux
+#define SPAN_VARS \
+ const SWcontext *swrast = SWRAST_CONTEXT(ctx);
+#define INIT_PIXEL_PTR(P, X, Y) \
+ GLchan *P = swrast->CurAuxBuffer + ((Y) * ctx->DrawBuffer->Width + (X)) * 4; \
+ assert(swrast->CurAuxBuffer);
+
+#define INC_PIXEL_PTR(P) P += 4
+#if CHAN_TYPE == GL_FLOAT
+#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
+ P[0] = MAX2((R), 0.0F); \
+ P[1] = MAX2((G), 0.0F); \
+ P[2] = MAX2((B), 0.0F); \
+ P[3] = CHAN_MAXF
+#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
+ P[0] = MAX2((R), 0.0F); \
+ P[1] = MAX2((G), 0.0F); \
+ P[2] = MAX2((B), 0.0F); \
+ P[3] = CLAMP((A), 0.0F, CHAN_MAXF)
+#else
+#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
+ P[0] = R; P[1] = G; P[2] = B; P[3] = CHAN_MAX
+#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
+ P[0] = R; P[1] = G; P[2] = B; P[3] = A
+#endif
+#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
+ R = P[0]; G = P[1]; B = P[2]; A = P[3]
+#include "swrast/s_spantemp.h"
+
+
+
+/**
+ * Called from driver's SetBuffer() function to choose an aux buffer.
+ */
+void
+_swrast_use_aux_buffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ switch (bufferBit) {
+ case DD_AUX0_BIT:
+ ASSERT(buffer->Visual.numAuxBuffers >= 1);
+ swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[0];
+ break;
+ case DD_AUX1_BIT:
+ ASSERT(buffer->Visual.numAuxBuffers >= 2);
+ swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[1];
+ break;
+ case DD_AUX2_BIT:
+ ASSERT(buffer->Visual.numAuxBuffers >= 3);
+ swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[2];
+ break;
+ case DD_AUX3_BIT:
+ ASSERT(buffer->Visual.numAuxBuffers >= 4);
+ swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[3];
+ break;
+ default:
+ swrast->CurAuxBuffer = NULL;
+ }
+
+ swrast->Driver.WriteRGBASpan = write_rgba_span_aux;
+ swrast->Driver.WriteRGBSpan = write_rgb_span_aux;
+ swrast->Driver.WriteMonoRGBASpan = write_monorgba_span_aux;
+ swrast->Driver.WriteRGBAPixels = write_rgba_pixels_aux;
+ swrast->Driver.WriteMonoRGBAPixels = write_monorgba_pixels_aux;
+ swrast->Driver.ReadRGBASpan = read_rgba_span_aux;
+ swrast->Driver.ReadRGBAPixels = read_rgba_pixels_aux;
+}
+
--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.1
+ *
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef S_AUXBUFFER_H
+#define S_AUXBUFFER_H
+
+
+#include "context.h"
+
+
+extern void
+_swrast_alloc_aux_buffers( GLframebuffer *buffer );
+
+
+extern void
+_swrast_use_aux_buffer(GLcontext *ctx, GLframebuffer *buffr, GLuint bufferBit);
+
+
+#endif /* S_AUXBUFFER_H */
/*
* Mesa 3-D graphics library
- * Version: 6.0.1
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
#include "s_accum.h"
#include "s_alphabuf.h"
+#include "s_auxbuffer.h"
#include "s_context.h"
#include "s_depth.h"
#include "s_masking.h"
#include "s_stencil.h"
-
-
-/*
+/**
* Clear the color buffer when glColorMask or glIndexMask is in effect.
+ * We'll have specified which color buffer to clear by previously
+ * calling Driver.SetBuffer().
*/
static void
clear_color_buffer_with_masking( GLcontext *ctx )
}
-
-/*
+/**
* Clear a color buffer without index/channel masking.
+ * We'll have specified which color buffer to clear by previously
+ * calling Driver.SetBuffer().
*/
static void
clear_color_buffer(GLcontext *ctx)
}
-
-/*
- * Clear the front/back/left/right color buffers.
- * This function is usually only called if we need to clear the
- * buffers with masking.
+/**
+ * Clear the front/back/left/right/aux color buffers.
+ * This function is usually only called if the device driver can't
+ * clear its own color buffers for some reason (such as with masking).
*/
static void
clear_color_buffers(GLcontext *ctx)
GLuint bufferBit;
/* loop over four possible dest color buffers */
- for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
+ for (bufferBit = 1; bufferBit <= DD_AUX3_BIT; bufferBit <<= 1) {
if (bufferBit & ctx->Color._DrawDestMask) {
(*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
}
-
+/**
+ * Called via the device driver's ctx->Driver.Clear() function if the
+ * device driver can't clear one or more of the buffers itself.
+ * \param mask bitwise-OR of DD_*_BIT flags.
+ * \param all if GL_TRUE, clear whole buffer, else clear specified region.
+ */
void
_swrast_Clear( GLcontext *ctx, GLbitfield mask,
GLboolean all,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
#ifdef DEBUG
{
- GLbitfield legalBits = DD_FRONT_LEFT_BIT |
+ const GLbitfield legalBits =
+ DD_FRONT_LEFT_BIT |
DD_FRONT_RIGHT_BIT |
DD_BACK_LEFT_BIT |
DD_BACK_RIGHT_BIT |
DD_DEPTH_BIT |
DD_STENCIL_BIT |
- DD_ACCUM_BIT;
+ DD_ACCUM_BIT |
+ DD_AUX0_BIT |
+ DD_AUX1_BIT |
+ DD_AUX2_BIT |
+ DD_AUX3_BIT;
assert((mask & (~legalBits)) == 0);
}
#endif
/* do software clearing here */
if (mask) {
- if (mask & ctx->Color._DrawDestMask) clear_color_buffers(ctx);
- if (mask & GL_DEPTH_BUFFER_BIT) _swrast_clear_depth_buffer(ctx);
- if (mask & GL_ACCUM_BUFFER_BIT) _swrast_clear_accum_buffer(ctx);
- if (mask & GL_STENCIL_BUFFER_BIT) _swrast_clear_stencil_buffer(ctx);
- }
-
- /* clear software-based alpha buffer(s) */
- if ( (mask & GL_COLOR_BUFFER_BIT)
- && ctx->DrawBuffer->UseSoftwareAlphaBuffers
- && ctx->Color.ColorMask[ACOMP]) {
- _swrast_clear_alpha_buffers( ctx );
+ if (mask & ctx->Color._DrawDestMask) {
+ clear_color_buffers(ctx);
+ /* clear software-based alpha buffer(s) */
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
+ && ctx->Color.ColorMask[ACOMP]) {
+ _swrast_clear_alpha_buffers( ctx );
+ }
+ }
+ if (mask & DD_DEPTH_BIT) {
+ _swrast_clear_depth_buffer(ctx);
+ }
+ if (mask & DD_ACCUM_BIT) {
+ _swrast_clear_accum_buffer(ctx);
+ }
+ if (mask & DD_STENCIL_BIT) {
+ _swrast_clear_stencil_buffer(ctx);
+ }
}
RENDER_FINISH(swrast,ctx);
}
+/**
+ * Typically called via ctx->Driver.ResizeBuffers().
+ * Reallocate all software-based depth/stencil/accum/etc buffers
+ * to match current window dimensions.
+ */
void
_swrast_alloc_buffers( GLframebuffer *buffer )
{
if (buffer->UseSoftwareAlphaBuffers) {
_swrast_alloc_alpha_buffers( buffer );
}
+ if (buffer->UseSoftwareAuxBuffers) {
+ _swrast_alloc_aux_buffers( buffer );
+ }
}
SWcontext *swrast = SWRAST_CONTEXT(ctx);
/* Do this so the software-emulated alpha plane span functions work! */
- swrast->CurrentBuffer = ctx->Pixel._ReadSrcMask;
+ swrast->CurrentBufferBit = ctx->Pixel._ReadSrcMask;
/* Tell the device driver where to read/write spans */
- (*swrast->Driver.SetBuffer)( ctx, ctx->ReadBuffer, swrast->CurrentBuffer );
+ swrast->Driver.SetBuffer(ctx, ctx->ReadBuffer, swrast->CurrentBufferBit);
}
* we loop over multiple color buffers when needed.
*/
- if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
- swrast->CurrentBuffer = FRONT_LEFT_BIT;
- else if (ctx->Color._DrawDestMask & BACK_LEFT_BIT)
- swrast->CurrentBuffer = BACK_LEFT_BIT;
- else if (ctx->Color._DrawDestMask & FRONT_RIGHT_BIT)
- swrast->CurrentBuffer = FRONT_RIGHT_BIT;
- else if (ctx->Color._DrawDestMask & BACK_RIGHT_BIT)
- swrast->CurrentBuffer = BACK_RIGHT_BIT;
+ if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT)
+ swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT;
+ else if (ctx->Color._DrawDestMask & DD_BACK_LEFT_BIT)
+ swrast->CurrentBufferBit = DD_BACK_LEFT_BIT;
+ else if (ctx->Color._DrawDestMask & DD_FRONT_RIGHT_BIT)
+ swrast->CurrentBufferBit = DD_FRONT_RIGHT_BIT;
+ else if (ctx->Color._DrawDestMask & DD_BACK_RIGHT_BIT)
+ swrast->CurrentBufferBit = DD_BACK_RIGHT_BIT;
+ else if (ctx->Color._DrawDestMask & DD_AUX0_BIT)
+ swrast->CurrentBufferBit = DD_AUX0_BIT;
+ else if (ctx->Color._DrawDestMask & DD_AUX1_BIT)
+ swrast->CurrentBufferBit = DD_AUX1_BIT;
+ else if (ctx->Color._DrawDestMask & DD_AUX2_BIT)
+ swrast->CurrentBufferBit = DD_AUX2_BIT;
+ else if (ctx->Color._DrawDestMask & DD_AUX3_BIT)
+ swrast->CurrentBufferBit = DD_AUX3_BIT;
else
/* glDrawBuffer(GL_NONE) */
- swrast->CurrentBuffer = FRONT_LEFT_BIT; /* we always have this buffer */
+ swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT; /* we always have this buffer */
- (*swrast->Driver.SetBuffer)( ctx, ctx->DrawBuffer, swrast->CurrentBuffer );
+ swrast->Driver.SetBuffer(ctx, ctx->DrawBuffer, swrast->CurrentBufferBit);
}
* MULTI_DRAW_BIT flag. Also set it if we're drawing to no
* buffers or the RGBA or CI mask disables all writes.
*/
- if (ctx->Color._DrawDestMask != FRONT_LEFT_BIT &&
- ctx->Color._DrawDestMask != BACK_LEFT_BIT &&
- ctx->Color._DrawDestMask != FRONT_RIGHT_BIT &&
- ctx->Color._DrawDestMask != BACK_RIGHT_BIT) {
+ if (_mesa_bitcount(ctx->Color._DrawDestMask) != 1) {
/* more than one color buffer designated for writing (or zero buffers) */
RasterMask |= MULTI_DRAW_BIT;
}
swrast->AllowPixelFog = GL_TRUE;
if (ctx->Visual.doubleBufferMode)
- swrast->CurrentBuffer = BACK_LEFT_BIT;
+ swrast->CurrentBufferBit = DD_BACK_LEFT_BIT;
else
- swrast->CurrentBuffer = FRONT_LEFT_BIT;
+ swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT;
/* Optimized Accum buffer */
swrast->_IntegerAccumMode = GL_TRUE;
GLboolean _IntegerAccumMode; /**< Storing unscaled integers? */
GLfloat _IntegerAccumScaler; /**< Implicit scale factor */
+ GLchan *CurAuxBuffer;
/* Working values:
*/
GLuint NewState;
GLuint StateChanges;
GLenum Primitive; /* current primitive being drawn (ala glBegin) */
- GLuint CurrentBuffer; /* exactly one of FRONT_LEFT_BIT, BACK_LEFT_BIT, etc*/
+ GLbitfield CurrentBufferBit; /* exactly one the of DD_*_BIT buffer bits */
/** Mechanism to allow driver (like X11) to register further
* software rasterization routines.
ASSERT(span->end < MAX_WIDTH);
/* Set the current read/draw buffer */
- swrast->CurrentBuffer = bufferBit;
+ swrast->CurrentBufferBit = bufferBit;
(*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
/* make copy of incoming indexes */
ASSERT(span->end < MAX_WIDTH);
/* Set the current read/draw buffer */
- swrast->CurrentBuffer = bufferBit;
+ swrast->CurrentBufferBit = bufferBit;
(*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
/* make copy of incoming colors */
*/
struct swrast_device_driver {
- void (*SetBuffer)( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit);
+ void (*SetBuffer)(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit);
/*
- * Specifies the current buffer for span/pixel writing/reading.
+ * Specifies the current color buffer for span/pixel writing/reading.
* buffer indicates which window to write to / read from. Normally,
* this'll be the buffer currently bound to the context, but it doesn't
* have to be!
- * bufferBit indicates which color buffer, one of:
- * FRONT_LEFT_BIT - this buffer always exists
- * BACK_LEFT_BIT - when double buffering
- * FRONT_RIGHT_BIT - when using stereo
- * BACK_RIGHT_BIT - when using stereo and double buffering
- * AUXn_BIT - if aux buffers are implemented
+ * bufferBit indicates which color buffer, exactly one of:
+ * DD_FRONT_LEFT_BIT - this buffer always exists
+ * DD_BACK_LEFT_BIT - when double buffering
+ * DD_FRONT_RIGHT_BIT - when using stereo
+ * DD_BACK_RIGHT_BIT - when using stereo and double buffering
+ * DD_AUXn_BIT - if aux buffers are implemented
*/