added support for GL_ARB_draw_buffers

This commit is contained in:
Brian Paul
2004-10-02 16:39:09 +00:00
parent 289ffee2a0
commit 53f82c5aad
60 changed files with 2152 additions and 1816 deletions
+1
View File
@@ -126,6 +126,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->ColorMaterial = NULL;
driver->CullFace = NULL;
driver->DrawBuffer = _swrast_DrawBuffer;
driver->DrawBuffers = _swrast_DrawBuffers;
driver->FrontFace = NULL;
driver->DepthFunc = NULL;
driver->DepthMask = NULL;
+2 -2
View File
@@ -384,7 +384,7 @@ void i810XMesaSetBackClipRects( i810ContextPtr imesa )
static void i810XMesaWindowMoved( i810ContextPtr imesa )
{
switch (imesa->glCtx->Color._DrawDestMask) {
switch (imesa->glCtx->Color._DrawDestMask[0]) {
case DD_FRONT_LEFT_BIT:
i810XMesaSetFrontClipRects( imesa );
break;
@@ -448,7 +448,7 @@ i810UpdatePageFlipping( i810ContextPtr imesa )
GLcontext *ctx = imesa->glCtx;
int front = 0;
switch (ctx->Color._DrawDestMask) {
switch (ctx->Color._DrawDestMask[0]) {
case DD_FRONT_LEFT_BIT:
front = 1;
break;
+1 -1
View File
@@ -225,7 +225,7 @@ void i810PageFlip( const __DRIdrawablePrivate *dPriv )
}
/* i810SetDrawBuffer( imesa->glCtx, imesa->glCtx->Color.DriverDrawBuffer );*/
i810DrawBuffer( imesa->glCtx, imesa->glCtx->Color.DrawBuffer );
i810DrawBuffer( imesa->glCtx, imesa->glCtx->Color.DrawBuffer[0] );
imesa->upload_cliprects = GL_TRUE;
imesa->lastSwap = tmp;
return;
+1 -1
View File
@@ -284,7 +284,7 @@ void i810DrawBuffer(GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
front = 1;
break;
+1 -1
View File
@@ -468,7 +468,7 @@ void i830XMesaSetBackClipRects( i830ContextPtr imesa )
static void i830XMesaWindowMoved( i830ContextPtr imesa )
{
switch (imesa->glCtx->Color._DrawDestMask) {
switch (imesa->glCtx->Color._DrawDestMask[0]) {
case DD_FRONT_LEFT_BIT:
i830XMesaSetFrontClipRects( imesa );
break;
+1 -1
View File
@@ -803,7 +803,7 @@ static void i830DrawBuffer(GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
I830_FIREVERTICES(imesa);
I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS);
+2 -2
View File
@@ -491,7 +491,7 @@ void intelSetBackClipRects( intelContextPtr intel )
void intelWindowMoved( intelContextPtr intel )
{
switch (intel->ctx.Color._DrawDestMask) {
switch (intel->ctx.Color._DrawDestMask[0]) {
case DD_FRONT_LEFT_BIT:
intelSetFrontClipRects( intel );
break;
@@ -683,5 +683,5 @@ void intelInitState( GLcontext *ctx )
ctx->Stencil.ZPassFunc[0]);
ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer );
ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
}
+1 -1
View File
@@ -43,7 +43,7 @@ static void intelDrawBuffer(GLcontext *ctx, GLenum mode )
intelScreenPrivate *screen = intel->intelScreen;
int front = 0;
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
front = 1;
FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE );
+1 -1
View File
@@ -69,7 +69,7 @@ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags )
if ( mmesa->lastStamp != dPriv->lastStamp ) {
mmesa->lastStamp = dPriv->lastStamp;
if (mmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT)
if (mmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT)
mach64SetCliprects( mmesa->glCtx, GL_BACK_LEFT );
else
mach64SetCliprects( mmesa->glCtx, GL_FRONT_LEFT );
+1 -1
View File
@@ -729,7 +729,7 @@ static void mach64DDDrawBuffer( GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE );
mach64SetCliprects( ctx, GL_FRONT_LEFT );
+1 -1
View File
@@ -822,7 +822,7 @@ static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
+1 -1
View File
@@ -52,7 +52,7 @@ r128UpdatePageFlipping( r128ContextPtr rmesa )
rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
use_back = (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT);
use_back = (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT);
use_back ^= (rmesa->sarea->pfCurrentPage == 1);
if ( R128_DEBUG & DEBUG_VERBOSE_API )
+1 -1
View File
@@ -713,7 +713,7 @@ static void r128DDDrawBuffer( GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
+2 -2
View File
@@ -53,7 +53,7 @@ r200UpdatePageFlipping( r200ContextPtr rmesa )
int use_back;
rmesa->doPageFlip = rmesa->sarea->pfState;
use_back = (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT);
use_back = (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT);
use_back ^= (rmesa->sarea->pfCurrentPage == 1);
if (use_back) {
@@ -101,7 +101,7 @@ void r200GetLock( r200ContextPtr rmesa, GLuint flags )
if ( rmesa->lastStamp != dPriv->lastStamp ) {
r200UpdatePageFlipping( rmesa );
if (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT)
if (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT)
r200SetCliprects( rmesa, GL_BACK_LEFT );
else
r200SetCliprects( rmesa, GL_FRONT_LEFT );
+1 -1
View File
@@ -1751,7 +1751,7 @@ static void r200DrawBuffer( GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE );
r200SetCliprects( rmesa, GL_FRONT_LEFT );
+2 -2
View File
@@ -56,7 +56,7 @@ radeonUpdatePageFlipping( radeonContextPtr rmesa )
rmesa->doPageFlip = rmesa->sarea->pfState;
use_back = (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT);
use_back = (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT);
use_back ^= (rmesa->sarea->pfCurrentPage == 1);
if ( RADEON_DEBUG & DEBUG_VERBOSE )
@@ -108,7 +108,7 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags )
if ( rmesa->lastStamp != dPriv->lastStamp ) {
radeonUpdatePageFlipping( rmesa );
if (rmesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT)
if (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT)
radeonSetCliprects( rmesa, GL_BACK_LEFT );
else
radeonSetCliprects( rmesa, GL_FRONT_LEFT );
+1 -1
View File
@@ -1612,7 +1612,7 @@ static void radeonDrawBuffer( GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE );
radeonSetCliprects( rmesa, GL_FRONT_LEFT );
+1 -1
View File
@@ -598,7 +598,7 @@ static void savageXMesaWindowMoved( savageContextPtr imesa )
if (0)
fprintf(stderr, "savageXMesaWindowMoved\n\n");
switch (imesa->glCtx->Color._DrawDestMask) {
switch (imesa->glCtx->Color._DrawDestMask[0]) {
case DD_FRONT_LEFT_BIT:
savageXMesaSetFrontClipRects( imesa );
break;
+2 -2
View File
@@ -638,7 +638,7 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
imesa->IsDouble = GL_FALSE;
@@ -1768,7 +1768,7 @@ void savageDDInitState( savageContextPtr imesa ) {
imesa->regs.s4.zBufOffset.ni.zDepthSelect = 1;
}
if (imesa->glCtx->Color._DrawDestMask == DD_BACK_LEFT_BIT) {
if (imesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT) {
if(imesa->IsFullScreen)
{
imesa->toggle = TARGET_BACK;
+1 -1
View File
@@ -65,7 +65,7 @@ sisGetLock( sisContextPtr smesa, GLuint flags )
if ( smesa->lastStamp != dPriv->lastStamp ) {
sisUpdateBufferSize( smesa );
sisUpdateClipping( smesa->glCtx );
sisDDDrawBuffer( smesa->glCtx, smesa->glCtx->Color.DrawBuffer );
sisDDDrawBuffer( smesa->glCtx, smesa->glCtx->Color.DrawBuffer[0] );
smesa->lastStamp = dPriv->lastStamp;
}
+1 -1
View File
@@ -510,7 +510,7 @@ void sisDDDrawBuffer( GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
case DD_BACK_LEFT_BIT:
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
+1 -1
View File
@@ -805,7 +805,7 @@ static void sisRenderStart( GLcontext *ctx )
GLuint AGPParseSet = smesa->AGPParseSet;
GLboolean tex_fallback = GL_FALSE;
if (ctx->Color._DrawDestMask == DD_FRONT_LEFT_BIT &&
if (ctx->Color._DrawDestMask[0] == DD_FRONT_LEFT_BIT &&
smesa->driDrawable->numClipRects != 0)
{
multipass_cliprect(ctx, 0);
+6 -6
View File
@@ -255,7 +255,7 @@ tdfx_bitmap_R5G6B5(GLcontext * ctx, GLint px, GLint py,
* to the front or back buffer. This compile-time test seems to do
* the job for now.
*/
const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT)
? (fxMesa->screen_width) : (info.strideInBytes / 2);
GLint row;
/* compute dest address of bottom-left pixel in bitmap */
@@ -407,7 +407,7 @@ tdfx_bitmap_R8G8B8A8(GLcontext * ctx, GLint px, GLint py,
GLuint *dst;
GLint row;
if (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT) {
if (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT) {
dstStride = fxMesa->screen_width;
dst =
(GLuint *) info.lfbPtr + (winY - py) * dstStride + (winX +
@@ -508,7 +508,7 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y,
fxMesa->ReadBuffer,
GR_LFBWRITEMODE_ANY,
GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer ==
const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer[0] ==
GL_FRONT) ? (fxMesa->screen_width) : (info.strideInBytes / 2);
const GLushort *src = (const GLushort *) info.lfbPtr
+ scrY * srcStride + scrX;
@@ -567,7 +567,7 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
GR_LFBWRITEMODE_ANY,
GR_ORIGIN_UPPER_LEFT, FXFALSE, &info))
{
const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT)
? (fxMesa->screen_width) : (info.strideInBytes / 4);
const GLuint *src = (const GLuint *) info.lfbPtr
+ scrY * srcStride + scrX;
@@ -646,7 +646,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
}
/* look for clipmasks, giveup if region obscured */
if (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT) {
if (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT) {
if (!inClipRects_Region(fxMesa, scrX, scrY, width, height)) {
UNLOCK_HARDWARE(fxMesa);
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
@@ -661,7 +661,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
GR_LFBWRITEMODE_8888,
GR_ORIGIN_UPPER_LEFT, FXTRUE, &info))
{
const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT)
? (fxMesa->screen_width * 4) : (info.strideInBytes);
GLubyte *dst = (GLubyte *) info.lfbPtr
+ scrY * dstStride + scrX * 4;
+2 -2
View File
@@ -278,7 +278,7 @@ static void tdfxClear( GLcontext *ctx,
fxMesa->Color.ClearAlpha,
fxMesa->Depth.Clear);
FX_grColorMaskv_NoLock(ctx, true4);
if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT)
if (ctx->Color._DrawDestMask[0] & DD_FRONT_LEFT_BIT)
fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
if (!ctx->Depth.Test || !ctx->Depth.Mask)
fxMesa->Glide.grDepthMask(FXFALSE);
@@ -298,7 +298,7 @@ static void tdfxClear( GLcontext *ctx,
fxMesa->Glide.grDepthMask(FXTRUE);
}
FX_grColorMaskv_NoLock(ctx, true4);
if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT)
if (ctx->Color._DrawDestMask[0] & DD_FRONT_LEFT_BIT)
fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
}
+1 -1
View File
@@ -49,7 +49,7 @@
#define LOCAL_VARS \
__DRIdrawablePrivate *dPriv = fxMesa->driDrawable; \
tdfxScreenPrivate *fxPriv = fxMesa->fxScreen; \
GLuint pitch = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT) \
GLuint pitch = (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT) \
? (fxMesa->screen_width * BYTESPERPIXEL) : \
(info.strideInBytes); \
GLuint height = fxMesa->height; \
+1 -1
View File
@@ -1033,7 +1033,7 @@ static void tdfxDDDrawBuffer( GLcontext *ctx, GLenum mode )
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask ) {
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
+1 -1
View File
@@ -719,7 +719,7 @@ void viaXMesaWindowMoved(viaContextPtr vmesa)
GLuint side = 0;
__DRIdrawablePrivate *dPriv = vmesa->driDrawable;
switch (vmesa->glCtx->Color._DrawDestMask) {
switch (vmesa->glCtx->Color._DrawDestMask[0]) {
case __GL_FRONT_BUFFER_MASK:
viaXMesaSetFrontClipRects(vmesa);
break;
+11 -11
View File
@@ -463,7 +463,7 @@ void viaPageFlip(const __DRIdrawablePrivate *dPriv)
if(vmesa->currentPage) {
vmesa->currentPage = 0;
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
ctx->Driver.DrawBuffer(ctx, GL_BACK);
}
else {
@@ -472,7 +472,7 @@ void viaPageFlip(const __DRIdrawablePrivate *dPriv)
}
else {
vmesa->currentPage = 1;
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
ctx->Driver.DrawBuffer(ctx, GL_BACK);
}
else {
@@ -1112,7 +1112,7 @@ void viaFillStencilDepthBuffer(viaContextPtr vmesa, GLuint pixel)
}
}
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
viaFlushPrimsLocked(vmesa);
}
}
@@ -1180,7 +1180,7 @@ void viaFillStencilBuffer(viaContextPtr vmesa, GLuint pixel)
}
}
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
viaFlushPrimsLocked(vmesa);
}
}
@@ -1265,7 +1265,7 @@ void viaFillDepthBuffer(viaContextPtr vmesa, GLuint pixel)
}
}
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
viaFlushPrimsLocked(vmesa);
}
}
@@ -1556,9 +1556,9 @@ int flush_agp(viaContextPtr vmesa, drm_via_flush_agp_t* agpCmd)
/*=* [DBG] make draw to front buffer *=*/
if(DRAW_FRONT)
vmesa->glCtx->Color._DrawDestMask = __GL_FRONT_BUFFER_MASK;
vmesa->glCtx->Color._DrawDestMask[0] = __GL_FRONT_BUFFER_MASK;
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
*vb++ = HC_HEADER2;
*vb++ = (HC_ParaType_NotTex << 16);
@@ -1807,9 +1807,9 @@ int flush_agp_saam(viaContextPtr vmesa, drm_via_flush_agp_t* agpCmd)
/*=* [DBG] make draw to front buffer *=*/
if(DRAW_FRONT)
vmesa->glCtx->Color._DrawDestMask = __GL_FRONT_BUFFER_MASK;
vmesa->glCtx->Color._DrawDestMask[0] = __GL_FRONT_BUFFER_MASK;
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
*vb++ = HC_HEADER2;
*vb++ = (HC_ParaType_NotTex << 16);
@@ -2035,7 +2035,7 @@ int flush_sys(viaContextPtr vmesa, drm_via_flush_sys_t* buf)
/*=* [DBG] make draw to front buffer *=*/
if(DRAW_FRONT)
vmesa->glCtx->Color._DrawDestMask = __GL_FRONT_BUFFER_MASK;
vmesa->glCtx->Color._DrawDestMask[0] = __GL_FRONT_BUFFER_MASK;
/*=* John Sheng [2003.6.20] fix pci *=*/
@@ -2064,7 +2064,7 @@ int flush_sys(viaContextPtr vmesa, drm_via_flush_sys_t* buf)
*vmesa->regTranSpace = 0x46800408;
vmesa->VQEnable = 0;
}
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
*vb++ = HC_HEADER2;
*vb++ = (HC_ParaType_NotTex << 16);
+2 -2
View File
@@ -163,7 +163,7 @@
GLushort p; \
char *buf, *read_buf; \
p = 0; \
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) { \
if (vmesa->glCtx->Color._DrawDestMask[0][0] == __GL_BACK_BUFFER_MASK) { \
buf = (char *)(vmesa->drawMap); \
read_buf = (char *)(vmesa->readMap); \
} \
@@ -224,7 +224,7 @@
GLuint p; \
char *buf, *read_buf; \
p = 0; \
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) { \
if (vmesa->glCtx->Color._DrawDestMask[0][0] == __GL_BACK_BUFFER_MASK) { \
buf = (char *)(vmesa->drawMap); \
read_buf = (char *)(vmesa->readMap); \
} \
+2 -2
View File
@@ -336,7 +336,7 @@ static void viaBitmap( GLcontext *ctx, GLint px, GLint py,
/*=* John Sheng [2003.7.18] texenv *=*/
/*if (!vmesa->drawMap && !vmesa->readMap) {*/
if (1) {
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
viaDrawBuffer(ctx, GL_BACK);
}
else {
@@ -497,7 +497,7 @@ void viaInitState(GLcontext *ctx)
vmesa->regCmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Z;
vmesa->regEnable = HC_HenCW_MASK;
if (vmesa->glCtx->Color._DrawDestMask == __GL_BACK_BUFFER_MASK) {
if (vmesa->glCtx->Color._DrawDestMask[0] == __GL_BACK_BUFFER_MASK) {
vmesa->drawMap = vmesa->back.map;
vmesa->readMap = vmesa->back.map;
}
+2 -2
View File
@@ -1944,8 +1944,8 @@ fx_check_IsInHardware(GLcontext * ctx)
return FX_FALLBACK_STENCIL;
}
if (ctx->Color._DrawDestMask != DD_FRONT_LEFT_BIT &&
ctx->Color._DrawDestMask != DD_BACK_LEFT_BIT) {
if (ctx->Color._DrawDestMask[0] != DD_FRONT_LEFT_BIT &&
ctx->Color._DrawDestMask[0] != DD_BACK_LEFT_BIT) {
return FX_FALLBACK_DRAW_BUFFER;
}
+2 -1
View File
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.1
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -1667,6 +1667,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
_mesa_enable_1_3_extensions(mesaCtx);
_mesa_enable_1_4_extensions(mesaCtx);
_mesa_enable_1_5_extensions(mesaCtx);
_mesa_enable_2_0_extensions(mesaCtx);
/* finish up xmesa context initializations */
c->swapbytes = CHECK_BYTE_ORDER(v) ? GL_FALSE : GL_TRUE;
+3 -3
View File
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.1
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -986,7 +986,7 @@ xmesa_CopyPixels( GLcontext *ctx,
if (swrast->NewState)
_swrast_validate_derived( ctx );
if (ctx->Color.DrawBuffer == GL_FRONT &&
if (ctx->Color.DrawBuffer[0] == GL_FRONT &&
ctx->Pixel.ReadBuffer == GL_FRONT &&
drawBuffer && /* buffer != 0 means it's a Window or Pixmap */
readBuffer &&
@@ -1104,7 +1104,7 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state )
break;
}
if (ctx->Color._DrawDestMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
if (ctx->Color._DrawDestMask[0] & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
xmesa_update_span_funcs(ctx);
}
}
+3 -4
View File
@@ -1,9 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 5.1
* Version: 6.3
*
* 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"),
@@ -492,7 +491,7 @@ static swrast_line_func get_line_func( GLcontext *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)
if ((ctx->Color._DrawDestMask[0] & (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;
+3 -4
View File
@@ -1,9 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 5.1
* Version: 6.3
*
* 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"),
@@ -1313,7 +1312,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
triFuncName = NULL;
#endif
if ((ctx->Color._DrawDestMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) ==0)
if ((ctx->Color._DrawDestMask[0] & (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;
+26 -7
View File
@@ -5560,6 +5560,31 @@
<!-- No new functions, types, enums. -->
</category>
<category name="GL_ARB_draw_buffers" number="37">
<enum name="MAX_DRAW_BUFFERS_ARB" value="0x8824"/>
<enum name="DRAW_BUFFER0_ARB" value="0x8825"/>
<enum name="DRAW_BUFFER1_ARB" value="0x8826"/>
<enum name="DRAW_BUFFER2_ARB" value="0x8827"/>
<enum name="DRAW_BUFFER3_ARB" value="0x8828"/>
<enum name="DRAW_BUFFER4_ARB" value="0x8829"/>
<enum name="DRAW_BUFFER5_ARB" value="0x882A"/>
<enum name="DRAW_BUFFER6_ARB" value="0x882B"/>
<enum name="DRAW_BUFFER7_ARB" value="0x882C"/>
<enum name="DRAW_BUFFER8_ARB" value="0x882D"/>
<enum name="DRAW_BUFFER9_ARB" value="0x882E"/>
<enum name="DRAW_BUFFER10_ARB" value="0x882F"/>
<enum name="DRAW_BUFFER11_ARB" value="0x8830"/>
<enum name="DRAW_BUFFER12_ARB" value="0x8831"/>
<enum name="DRAW_BUFFER13_ARB" value="0x8832"/>
<enum name="DRAW_BUFFER14_ARB" value="0x8833"/>
<enum name="DRAW_BUFFER15_ARB" value="0x8834"/>
<function name="DrawBuffersARB" offset="413">
<param name="n" type="GLsizei" counter="true"/>
<param name="bufs" type="const GLenum *" count="n"/>
<!-- no GLX yet -->
</function>
</category>
<!-- Non-ARB extensions sorted by extension number. -->
@@ -8601,7 +8626,7 @@
</category>
<category name="GL_ATI_draw_buffers" number="277">
<function name="DrawBuffersATI" offset="?">
<function name="DrawBuffersATI" alias="DrawBuffersARB">
<param name="n" type="GLsizei" counter="true"/>
<param name="bufs" type="const GLenum *" count="n"/>
<!-- GLX protocol is not fully defined for this extension. -->
@@ -8763,10 +8788,4 @@
</function>
</category>
<category name="unused">
<function name="__unused413" offset="413">
<glx ignore="true"/>
</function>
</category>
</OpenGLAPI>
+1 -1
View File
@@ -442,7 +442,7 @@
#define _gloffset_MultTransposeMatrixfARB 410
#define _gloffset_MultTransposeMatrixdARB 411
#define _gloffset_SampleCoverageARB 412
#define _gloffset___unused413 413
#define _gloffset_DrawBuffersARB 413
#define _gloffset_PolygonOffsetEXT 414
#define _gloffset_GetTexFilterFuncSGIS 415
#define _gloffset_TexFilterFuncSGIS 416
+1 -1
View File
@@ -448,7 +448,7 @@ struct _glapi_table
void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 410 */
void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 411 */
void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 412 */
void (GLAPIENTRYP __unused413)(void); /* 413 */
void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 413 */
void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 414 */
void (GLAPIENTRYP GetTexFilterFuncSGIS)(GLenum target, GLenum filter, GLfloat * weights); /* 415 */
void (GLAPIENTRYP TexFilterFuncSGIS)(GLenum target, GLenum filter, GLsizei n, const GLfloat * weights); /* 416 */
+9 -3
View File
@@ -2136,9 +2136,9 @@ KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert)
DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert));
}
KEYWORD1 void KEYWORD2 NAME(__unused413)(void)
KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs)
{
DISPATCH(__unused413, (), (F, "gl__unused413();\n"));
DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs));
}
KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
@@ -4636,6 +4636,11 @@ KEYWORD1 void KEYWORD2 NAME(SamplePatternEXT)(GLenum pattern)
DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternEXT(0x%x);\n", pattern));
}
KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
{
DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
}
KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparateATI)(GLenum modeRGB, GLenum modeA)
{
DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateATI(0x%x, 0x%x);\n", modeRGB, modeA));
@@ -5083,7 +5088,7 @@ static void * DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(MultTransposeMatrixfARB),
TABLE_ENTRY(MultTransposeMatrixdARB),
TABLE_ENTRY(SampleCoverageARB),
TABLE_ENTRY(__unused413),
TABLE_ENTRY(DrawBuffersARB),
TABLE_ENTRY(PolygonOffsetEXT),
TABLE_ENTRY(GetTexFilterFuncSGIS),
TABLE_ENTRY(TexFilterFuncSGIS),
@@ -5696,6 +5701,7 @@ static const void * const UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(DrawRangeElementsEXT),
TABLE_ENTRY(SampleMaskEXT),
TABLE_ENTRY(SamplePatternEXT),
TABLE_ENTRY(DrawBuffersATI),
TABLE_ENTRY(BlendEquationSeparateATI),
TABLE_ENTRY(BlendFuncSeparateINGR),
TABLE_ENTRY(PointParameterfSGIS),
+1425 -1423
View File
File diff suppressed because it is too large Load Diff
+5 -6
View File
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.2
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -830,7 +830,8 @@ _mesa_PopAttrib(void)
(GLboolean) (color->ColorMask[1] != 0),
(GLboolean) (color->ColorMask[2] != 0),
(GLboolean) (color->ColorMask[3] != 0));
_mesa_DrawBuffer(color->DrawBuffer);
_mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers,
color->DrawBuffer);
_mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
_mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef);
_mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled);
@@ -928,9 +929,8 @@ _mesa_PopAttrib(void)
/* lighting enable */
_mesa_set_enable(ctx, GL_LIGHTING, light->Enabled);
/* per-light state */
if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE)
_math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE)
_math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
for (i = 0; i < MAX_LIGHTS; i++) {
GLenum lgt = (GLenum) (GL_LIGHT0 + i);
@@ -1079,7 +1079,6 @@ _mesa_PopAttrib(void)
const struct gl_transform_attrib *xform;
xform = (const struct gl_transform_attrib *) attr->data;
_mesa_MatrixMode(xform->MatrixMode);
if (ctx->ProjectionMatrixStack.Top->flags & MAT_DIRTY)
_math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
+4 -5
View File
@@ -549,7 +549,6 @@ void _mesa_init_color( GLcontext * ctx )
ctx->Color.ColorMask[3] = 0xff;
ctx->Color.ClearIndex = 0;
ASSIGN_4V( ctx->Color.ClearColor, 0, 0, 0, 0 );
ctx->Color.DrawBuffer = GL_FRONT;
ctx->Color.AlphaEnabled = GL_FALSE;
ctx->Color.AlphaFunc = GL_ALWAYS;
ctx->Color.AlphaRef = 0;
@@ -568,12 +567,12 @@ void _mesa_init_color( GLcontext * ctx )
ctx->Color.DitherFlag = GL_TRUE;
if (ctx->Visual.doubleBufferMode) {
ctx->Color.DrawBuffer = GL_BACK;
ctx->Color._DrawDestMask = DD_BACK_LEFT_BIT;
ctx->Color.DrawBuffer[0] = GL_BACK;
ctx->Color._DrawDestMask[0] = DD_BACK_LEFT_BIT;
}
else {
ctx->Color.DrawBuffer = GL_FRONT;
ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
ctx->Color.DrawBuffer[0] = GL_FRONT;
ctx->Color._DrawDestMask[0] = DD_FRONT_LEFT_BIT;
}
}
+200 -193
View File
@@ -149,7 +149,7 @@ _mesa_Clear( GLbitfield mask )
*/
ddMask = 0;
if (mask & GL_COLOR_BUFFER_BIT)
ddMask |= ctx->Color._DrawDestMask;
ddMask |= ctx->Color._DrawDestMask[0];
if ((mask & GL_DEPTH_BUFFER_BIT) && ctx->Visual.depthBits > 0)
ddMask |= GL_DEPTH_BUFFER_BIT;
if ((mask & GL_STENCIL_BUFFER_BIT) && ctx->Visual.stencilBits > 0)
@@ -164,6 +164,121 @@ _mesa_Clear( GLbitfield mask )
}
/**
* Return bitmask of DD_* flags indicating which color buffers are
* available to the rendering context;
*/
static GLuint
supported_buffer_bitmask(const GLcontext *ctx)
{
GLuint mask = DD_FRONT_LEFT_BIT; /* always have this */
GLuint i;
if (ctx->Visual.stereoMode) {
mask |= DD_FRONT_RIGHT_BIT;
if (ctx->Visual.doubleBufferMode) {
mask |= DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT;
}
}
else if (ctx->Visual.doubleBufferMode) {
mask |= DD_BACK_LEFT_BIT;
}
for (i = 0; i < ctx->Visual.numAuxBuffers; i++) {
mask |= (DD_AUX0_BIT << i);
}
return mask;
}
/**
* Helper routine used by glDrawBuffer and glDrawBuffersARB.
* Given a GLenum naming (a) color buffer(s), return the corresponding
* bitmask of DD_* flags.
*/
static GLuint
draw_buffer_enum_to_bitmask(GLenum buffer)
{
switch (buffer) {
case GL_FRONT:
return DD_FRONT_LEFT_BIT | DD_FRONT_RIGHT_BIT;
case GL_BACK:
return DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT;
case GL_NONE:
return 0;
case GL_RIGHT:
return DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
case GL_FRONT_RIGHT:
return DD_FRONT_RIGHT_BIT;
case GL_BACK_RIGHT:
return DD_BACK_RIGHT_BIT;
case GL_BACK_LEFT:
return DD_BACK_LEFT_BIT;
case GL_FRONT_AND_BACK:
return DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT
| DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
case GL_LEFT:
return DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT;
case GL_FRONT_LEFT:
return DD_FRONT_LEFT_BIT;
case GL_AUX0:
return DD_AUX0_BIT;
case GL_AUX1:
return DD_AUX1_BIT;
case GL_AUX2:
return DD_AUX2_BIT;
case GL_AUX3:
return DD_AUX3_BIT;
default:
/* error */
return ~0;
}
}
/**
* Helper routine used by glReadBuffer.
* Given a GLenum naming (a) color buffer(s), return the corresponding
* bitmask of DD_* flags.
*/
static GLuint
read_buffer_enum_to_bitmask(GLenum buffer)
{
switch (buffer) {
case GL_FRONT:
return DD_FRONT_LEFT_BIT;
case GL_BACK:
return DD_BACK_LEFT_BIT;
case GL_RIGHT:
return DD_FRONT_RIGHT_BIT;
case GL_FRONT_RIGHT:
return DD_FRONT_RIGHT_BIT;
case GL_BACK_RIGHT:
return DD_BACK_RIGHT_BIT;
case GL_BACK_LEFT:
return DD_BACK_LEFT_BIT;
case GL_LEFT:
return DD_FRONT_LEFT_BIT;
case GL_FRONT_LEFT:
return DD_FRONT_LEFT_BIT;
case GL_AUX0:
return DD_AUX0_BIT;
case GL_AUX1:
return DD_AUX1_BIT;
case GL_AUX2:
return DD_AUX2_BIT;
case GL_AUX3:
return DD_AUX3_BIT;
default:
/* error */
return ~0;
}
}
/**
* Specify which color buffers to draw into.
*
@@ -179,6 +294,7 @@ _mesa_Clear( GLbitfield mask )
void GLAPIENTRY
_mesa_DrawBuffer( GLenum mode )
{
GLenum destMask, supportedMask;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */
@@ -188,124 +304,22 @@ _mesa_DrawBuffer( GLenum mode )
/*
* Do error checking and compute the _DrawDestMask bitfield.
*/
switch (mode) {
case GL_FRONT:
/* never an error */
if (ctx->Visual.stereoMode)
ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT | DD_FRONT_RIGHT_BIT;
else
ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
break;
case GL_BACK:
if (!ctx->Visual.doubleBufferMode) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_BACK)");
return;
}
if (ctx->Visual.stereoMode)
ctx->Color._DrawDestMask = DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT;
else
ctx->Color._DrawDestMask = DD_BACK_LEFT_BIT;
break;
case GL_NONE:
/* never an error */
ctx->Color._DrawDestMask = 0;
break;
#if _HAVE_FULL_GL
case GL_RIGHT:
if (!ctx->Visual.stereoMode) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_RIGHT)");
return;}
if (ctx->Visual.doubleBufferMode)
ctx->Color._DrawDestMask = DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
else
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 = 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 = 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 = DD_BACK_LEFT_BIT;
break;
case GL_FRONT_AND_BACK:
if (!ctx->Visual.doubleBufferMode) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_FRONT_AND_BACK)");
return;
}
if (ctx->Visual.stereoMode)
ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT
| DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
else
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 = DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT;
else
ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
break;
case GL_FRONT_LEFT:
/* never an error */
ctx->Color._DrawDestMask = DD_FRONT_LEFT_BIT;
break;
case GL_AUX0:
if (ctx->Visual.numAuxBuffers >= 1) {
ctx->Color._DrawDestMask = DD_AUX0_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX0)" );
return;
}
break;
case GL_AUX1:
if (ctx->Visual.numAuxBuffers >= 2) {
ctx->Color._DrawDestMask = DD_AUX1_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX1)" );
return;
}
break;
case GL_AUX2:
if (ctx->Visual.numAuxBuffers >= 3) {
ctx->Color._DrawDestMask = DD_AUX2_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX2)" );
return;
}
break;
case GL_AUX3:
if (ctx->Visual.numAuxBuffers >= 4) {
ctx->Color._DrawDestMask = DD_AUX3_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer(GL_AUX3)" );
return;
}
break;
#endif
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawBuffer" );
return;
destMask = draw_buffer_enum_to_bitmask(mode);
if (destMask == ~0) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(mode)");
return;
}
ctx->Color.DrawBuffer = mode;
supportedMask = supported_buffer_bitmask(ctx);
destMask &= supportedMask;
if (destMask == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(mode)");
return;
}
ctx->Color.DrawBuffer[0] = mode;
ctx->Color._DrawDestMask[0] = destMask;
ctx->NewState |= _NEW_COLOR;
/*
@@ -316,6 +330,60 @@ _mesa_DrawBuffer( GLenum mode )
}
/**
* Called by glDrawBuffersARB; specifies the destination color buffers
* for N fragment program color outputs.
*/
void GLAPIENTRY
_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
{
GLint i;
GLuint usedBufferMask, supportedMask;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (n < 1 || n > ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)" );
return;
}
supportedMask = supported_buffer_bitmask(ctx);
usedBufferMask = 0;
for (i = 0; i < n; i++) {
GLuint destMask = draw_buffer_enum_to_bitmask(buffers[i]);
if (destMask == ~0) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)");
return;
}
destMask &= supportedMask;
if (destMask == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glDrawBuffersARB(unsupported buffer)");
return;
}
if (destMask & usedBufferMask) {
/* can't use a dest buffer more than once! */
_mesa_error(ctx, GL_INVALID_OPERATION,
"glDrawBuffersARB(duplicated buffer)");
return;
}
/* update bitmask */
usedBufferMask |= destMask;
/* save state */
ctx->Color.DrawBuffer[i] = buffers[i];
ctx->Color._DrawDestMask[i] = destMask;
}
ctx->NewState |= _NEW_COLOR;
/*
* Call device driver function.
*/
if (ctx->Driver.DrawBuffers)
(*ctx->Driver.DrawBuffers)(ctx, n, buffers);
}
/**
* Set the color buffer source for reading pixels.
*
@@ -330,89 +398,24 @@ _mesa_DrawBuffer( GLenum mode )
void GLAPIENTRY
_mesa_ReadBuffer( GLenum mode )
{
GLuint srcMask, supportedMask;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
/*
* Do error checking and compute ctx->Pixel._ReadSrcMask.
*/
switch (mode) {
case GL_LEFT:
case GL_FRONT:
case GL_FRONT_LEFT:
/* Front-Left buffer, always exists */
ctx->Pixel._ReadSrcMask = DD_FRONT_LEFT_BIT;
break;
case GL_BACK:
case GL_BACK_LEFT:
/* Back-Left buffer, requires double buffering */
if (!ctx->Visual.doubleBufferMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
ctx->Pixel._ReadSrcMask = DD_BACK_LEFT_BIT;
break;
#if _HAVE_FULL_GL
case GL_FRONT_RIGHT:
case GL_RIGHT:
if (!ctx->Visual.stereoMode) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
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 = DD_BACK_RIGHT_BIT;
break;
case GL_AUX0:
if (ctx->Visual.numAuxBuffers >= 1) {
ctx->Pixel._ReadSrcMask = DD_AUX0_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX0)" );
return;
}
break;
case GL_AUX1:
if (ctx->Visual.numAuxBuffers >= 2) {
ctx->Pixel._ReadSrcMask = DD_AUX1_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX1)" );
return;
}
break;
case GL_AUX2:
if (ctx->Visual.numAuxBuffers >= 3) {
ctx->Pixel._ReadSrcMask = DD_AUX2_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX2)" );
return;
}
break;
case GL_AUX3:
if (ctx->Visual.numAuxBuffers >= 4) {
ctx->Pixel._ReadSrcMask = DD_AUX3_BIT;
}
else {
_mesa_error( ctx, GL_INVALID_OPERATION, "glReadBuffer(GL_AUX3)" );
return;
}
break;
#endif
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glReadBuffer" );
return;
srcMask = read_buffer_enum_to_bitmask(mode);
if (srcMask == ~0) {
_mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(mode)");
return;
}
supportedMask = supported_buffer_bitmask(ctx);
if ((srcMask & supportedMask) == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(mode)");
return;
}
ctx->Pixel._ReadSrcMask = srcMask;
ctx->Pixel.ReadBuffer = mode;
ctx->NewState |= _NEW_PIXEL;
@@ -423,6 +426,7 @@ _mesa_ReadBuffer( GLenum mode )
(*ctx->Driver.ReadBuffer)(ctx, mode);
}
#if _HAVE_FULL_GL
/**
@@ -485,6 +489,7 @@ _mesa_ResizeBuffersMESA( void )
}
}
/*
* XXX move somewhere else someday?
*/
@@ -550,6 +555,8 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
ctx->Driver.Scissor( ctx, x, y, width, height );
}
/**********************************************************************/
/** \name State management */
/*@{*/
+3
View File
@@ -49,6 +49,9 @@ _mesa_Clear( GLbitfield mask );
extern void GLAPIENTRY
_mesa_DrawBuffer( GLenum mode );
extern void GLAPIENTRY
_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers);
extern void GLAPIENTRY
_mesa_ReadBuffer( GLenum mode );
+15
View File
@@ -202,6 +202,13 @@
/*@}*/
/** For GL_ARB_draw_buffers */
/*@{*/
#define MAX_DRAW_BUFFERS 1
/*@}*/
/**
* \name Mesa-specific parameters
*/
@@ -283,4 +290,12 @@
/*@}*/
/**
* Maximum number of temporary vertices required for clipping.
*
* Used in array_cache and tnl modules.
*/
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
#endif /* CONFIG_H */
+7 -2
View File
@@ -1050,7 +1050,7 @@ _mesa_init_constants( GLcontext *ctx )
assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
/* Constants, may be overriden by device drivers */
/* Constants, may be overriden (usually only reduced) by device drivers */
ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
@@ -1077,8 +1077,10 @@ _mesa_init_constants( GLcontext *ctx )
ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
ctx->Const.MaxLights = MAX_LIGHTS;
ctx->Const.MaxSpotExponent = 128.0;
ctx->Const.MaxShininess = 128.0;
ctx->Const.MaxSpotExponent = 128.0;
ctx->Const.MaxViewportWidth = MAX_WIDTH;
ctx->Const.MaxViewportHeight = MAX_HEIGHT;
#if FEATURE_ARB_vertex_program
ctx->Const.MaxVertexProgramInstructions = MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS;
ctx->Const.MaxVertexProgramAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
@@ -1110,6 +1112,9 @@ _mesa_init_constants( GLcontext *ctx )
ctx->Const.CheckArrayBounds = GL_FALSE;
#endif
ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS;
/* sanity checks */
ASSERT(ctx->Const.MaxTextureUnits == MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits));
}
+2
View File
@@ -615,6 +615,8 @@ struct dd_function_table {
void (*DepthRange)(GLcontext *ctx, GLclampd nearval, GLclampd farval);
/** Specify the current buffer for writing */
void (*DrawBuffer)( GLcontext *ctx, GLenum buffer );
/** Specify the buffers for writing for fragment programs*/
void (*DrawBuffers)( GLcontext *ctx, GLsizei n, const GLenum *buffers );
/** Enable or disable server-side gl capabilities */
void (*Enable)(GLcontext *ctx, GLenum cap, GLboolean state);
/** Specify fog parameters */
+34
View File
@@ -314,6 +314,8 @@ typedef enum {
/* GL_ARB_occlusion_query */
OPCODE_BEGIN_QUERY_ARB,
OPCODE_END_QUERY_ARB,
/* GL_ARB_draw_buffers */
OPCODE_DRAW_BUFFERS_ARB,
/* Vertex attributes -- fallback for when optimized display
* list build isn't active.
@@ -782,6 +784,7 @@ _mesa_init_lists( void )
InstSize[OPCODE_BEGIN_QUERY_ARB] = 3;
InstSize[OPCODE_END_QUERY_ARB] = 2;
#endif
InstSize[OPCODE_DRAW_BUFFERS_ARB] = 2 + MAX_DRAW_BUFFERS;
InstSize[OPCODE_ATTR_1F] = 3;
InstSize[OPCODE_ATTR_2F] = 4;
InstSize[OPCODE_ATTR_3F] = 5;
@@ -4683,6 +4686,27 @@ save_EndQueryARB(GLenum target)
#endif /* FEATURE_ARB_occlusion_query */
static void GLAPIENTRY
save_DrawBuffersARB(GLsizei count, const GLenum *buffers)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = ALLOC_INSTRUCTION( ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS );
if (n) {
GLint i;
n[1].i = count;
if (count > MAX_DRAW_BUFFERS)
count = MAX_DRAW_BUFFERS;
for (i = 0; i < count; i++) {
n[2 + i].e = buffers[i];
}
}
if (ctx->ExecuteFlag) {
(*ctx->Exec->DrawBuffersARB)(count, buffers);
}
}
static void save_Attr1f( GLenum attr, GLfloat x )
{
@@ -6043,6 +6067,15 @@ execute_list( GLcontext *ctx, GLuint list )
ctx->Exec->EndQueryARB(n[1].e);
break;
#endif
case OPCODE_DRAW_BUFFERS_ARB:
{
GLenum buffers[MAX_DRAW_BUFFERS];
GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS);
for (i = 0; i < count; i++)
buffers[i] = n[2 + i].e;
ctx->Exec->DrawBuffersARB(n[1].i, buffers);
}
break;
case OPCODE_ATTR_1F:
(*ctx->Exec->VertexAttrib1fNV)(n[1].e, n[2].f);
break;
@@ -7635,6 +7668,7 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
table->GetQueryObjectivARB = _mesa_GetQueryObjectivARB;
table->GetQueryObjectuivARB = _mesa_GetQueryObjectuivARB;
#endif
table->DrawBuffersARB = save_DrawBuffersARB;
/* 299. GL_EXT_blend_equation_separate */
table->BlendEquationSeparateEXT = save_BlendEquationSeparateEXT;
+19 -1
View File
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.2
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -45,6 +45,7 @@ static const struct {
int flag_offset;
} default_extensions[] = {
{ OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) },
{ OFF, "GL_ARB_draw_buffers", F(ARB_draw_buffers) },
{ OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) },
{ OFF, "GL_MESAX_half_float_pixel", F(ARB_half_float_pixel) },
{ OFF, "GL_ARB_imaging", F(ARB_imaging) },
@@ -166,6 +167,7 @@ void
_mesa_enable_sw_extensions(GLcontext *ctx)
{
ctx->Extensions.ARB_depth_texture = GL_TRUE;
ctx->Extensions.ARB_draw_buffers = GL_TRUE;
#if FEATURE_ARB_fragment_program
ctx->Extensions.ARB_fragment_program = GL_TRUE;
#endif
@@ -330,6 +332,22 @@ _mesa_enable_1_5_extensions(GLcontext *ctx)
}
/**
* Enable all OpenGL 2.0 features and extensions.
* A convenience function to be called by drivers.
*/
void
_mesa_enable_2_0_extensions(GLcontext *ctx)
{
ctx->Extensions.ARB_draw_buffers = GL_TRUE;
ctx->Extensions.ARB_point_sprite = GL_TRUE;
ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
/* Also, shading language */
}
/**
* Either enable or disable the named extension.
*/
+4 -2
View File
@@ -10,9 +10,9 @@
/*
* Mesa 3-D graphics library
* Version: 5.1
* Version: 6.3
*
* Copyright (C) 1999-2003 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"),
@@ -50,6 +50,8 @@ extern void _mesa_enable_1_4_extensions(GLcontext *ctx);
extern void _mesa_enable_1_5_extensions(GLcontext *ctx);
extern void _mesa_enable_2_0_extensions(GLcontext *ctx);
extern void _mesa_enable_extension(GLcontext *ctx, const char *name);
extern void _mesa_disable_extension(GLcontext *ctx, const char *name);
+143 -6
View File
@@ -5,7 +5,7 @@
/*
* Mesa 3-D graphics library
* Version: 6.2
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -380,7 +380,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_BOOL(ctx->Color.DrawBuffer);
*params = ENUM_TO_BOOL(ctx->Color.DrawBuffer[0]);
break;
case GL_EDGE_FLAG:
FLUSH_CURRENT(ctx, 0);
@@ -1691,6 +1691,38 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
#endif
case GL_MAX_DRAW_BUFFERS_ARB:
CHECK_EXTENSION_B(ARB_draw_buffers, pname);
*params = INT_TO_BOOL(ctx->Const.MaxDrawBuffers);
break;
case GL_DRAW_BUFFER0_ARB:
case GL_DRAW_BUFFER1_ARB:
case GL_DRAW_BUFFER2_ARB:
case GL_DRAW_BUFFER3_ARB:
case GL_DRAW_BUFFER4_ARB:
case GL_DRAW_BUFFER5_ARB:
case GL_DRAW_BUFFER6_ARB:
case GL_DRAW_BUFFER7_ARB:
case GL_DRAW_BUFFER8_ARB:
case GL_DRAW_BUFFER9_ARB:
case GL_DRAW_BUFFER10_ARB:
case GL_DRAW_BUFFER11_ARB:
case GL_DRAW_BUFFER12_ARB:
case GL_DRAW_BUFFER13_ARB:
case GL_DRAW_BUFFER14_ARB:
case GL_DRAW_BUFFER15_ARB:
CHECK_EXTENSION_B(ARB_draw_buffers, pname);
{
GLuint i = pname - GL_DRAW_BUFFER0_ARB;
if (i >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetBooleanv(GL_DRAW_BUFFERx_ARB)");
return;
}
*params = INT_TO_BOOL(ctx->Color.DrawBuffer[i]);
}
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
}
@@ -1947,7 +1979,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_DOUBLE(ctx->Color.DrawBuffer);
*params = ENUM_TO_DOUBLE(ctx->Color.DrawBuffer[0]);
break;
case GL_EDGE_FLAG:
FLUSH_CURRENT(ctx, 0);
@@ -3253,6 +3285,38 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
break;
#endif
case GL_MAX_DRAW_BUFFERS_ARB:
CHECK_EXTENSION_D(ARB_draw_buffers, pname);
*params = (GLdouble) ctx->Const.MaxDrawBuffers;
break;
case GL_DRAW_BUFFER0_ARB:
case GL_DRAW_BUFFER1_ARB:
case GL_DRAW_BUFFER2_ARB:
case GL_DRAW_BUFFER3_ARB:
case GL_DRAW_BUFFER4_ARB:
case GL_DRAW_BUFFER5_ARB:
case GL_DRAW_BUFFER6_ARB:
case GL_DRAW_BUFFER7_ARB:
case GL_DRAW_BUFFER8_ARB:
case GL_DRAW_BUFFER9_ARB:
case GL_DRAW_BUFFER10_ARB:
case GL_DRAW_BUFFER11_ARB:
case GL_DRAW_BUFFER12_ARB:
case GL_DRAW_BUFFER13_ARB:
case GL_DRAW_BUFFER14_ARB:
case GL_DRAW_BUFFER15_ARB:
CHECK_EXTENSION_D(ARB_draw_buffers, pname);
{
GLuint i = pname - GL_DRAW_BUFFER0_ARB;
if (i >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetDoublev(GL_DRAW_BUFFERx_ARB)");
return;
}
*params = (GLdouble) ctx->Color.DrawBuffer[i];
}
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev(pname=0x%x)", pname);
}
@@ -3509,7 +3573,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_FLOAT(ctx->Color.DrawBuffer);
*params = ENUM_TO_FLOAT(ctx->Color.DrawBuffer[0]);
break;
case GL_EDGE_FLAG:
FLUSH_CURRENT(ctx, 0);
@@ -4791,6 +4855,38 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
#endif
case GL_MAX_DRAW_BUFFERS_ARB:
CHECK_EXTENSION_F(ARB_draw_buffers, pname);
*params = (GLfloat) ctx->Const.MaxDrawBuffers;
break;
case GL_DRAW_BUFFER0_ARB:
case GL_DRAW_BUFFER1_ARB:
case GL_DRAW_BUFFER2_ARB:
case GL_DRAW_BUFFER3_ARB:
case GL_DRAW_BUFFER4_ARB:
case GL_DRAW_BUFFER5_ARB:
case GL_DRAW_BUFFER6_ARB:
case GL_DRAW_BUFFER7_ARB:
case GL_DRAW_BUFFER8_ARB:
case GL_DRAW_BUFFER9_ARB:
case GL_DRAW_BUFFER10_ARB:
case GL_DRAW_BUFFER11_ARB:
case GL_DRAW_BUFFER12_ARB:
case GL_DRAW_BUFFER13_ARB:
case GL_DRAW_BUFFER14_ARB:
case GL_DRAW_BUFFER15_ARB:
CHECK_EXTENSION_F(ARB_draw_buffers, pname);
{
GLuint i = pname - GL_DRAW_BUFFER0_ARB;
if (i >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFloatv(GL_DRAW_BUFFERx_ARB)");
return;
}
*params = (GLfloat) ctx->Color.DrawBuffer[i];
}
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(0x%x)", pname);
}
@@ -5048,7 +5144,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = (GLint) ctx->Color.DrawBuffer;
*params = (GLint) ctx->Color.DrawBuffer[0];
break;
case GL_EDGE_FLAG:
FLUSH_CURRENT(ctx, 0);
@@ -6367,6 +6463,38 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
#endif
case GL_MAX_DRAW_BUFFERS_ARB:
CHECK_EXTENSION_I(ARB_draw_buffers, pname);
*params = ctx->Const.MaxDrawBuffers;
break;
case GL_DRAW_BUFFER0_ARB:
case GL_DRAW_BUFFER1_ARB:
case GL_DRAW_BUFFER2_ARB:
case GL_DRAW_BUFFER3_ARB:
case GL_DRAW_BUFFER4_ARB:
case GL_DRAW_BUFFER5_ARB:
case GL_DRAW_BUFFER6_ARB:
case GL_DRAW_BUFFER7_ARB:
case GL_DRAW_BUFFER8_ARB:
case GL_DRAW_BUFFER9_ARB:
case GL_DRAW_BUFFER10_ARB:
case GL_DRAW_BUFFER11_ARB:
case GL_DRAW_BUFFER12_ARB:
case GL_DRAW_BUFFER13_ARB:
case GL_DRAW_BUFFER14_ARB:
case GL_DRAW_BUFFER15_ARB:
CHECK_EXTENSION_I(ARB_draw_buffers, pname);
{
GLuint i = pname - GL_DRAW_BUFFER0_ARB;
if (i >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetIntegerv(GL_DRAW_BUFFERx_ARB)");
return;
}
*params = (GLint) ctx->Color.DrawBuffer[i];
}
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
}
@@ -6489,6 +6617,7 @@ _mesa_GetString( GLenum name )
static const char *version_1_3 = "1.3 Mesa " MESA_VERSION_STRING;
static const char *version_1_4 = "1.4 Mesa " MESA_VERSION_STRING;
static const char *version_1_5 = "1.5 Mesa " MESA_VERSION_STRING;
static const char *version_2_0 = "1.5 Mesa " MESA_VERSION_STRING;/*XXX FIX*/
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
@@ -6533,7 +6662,15 @@ _mesa_GetString( GLenum name )
if (ctx->Extensions.ARB_occlusion_query &&
ctx->Extensions.ARB_vertex_buffer_object &&
ctx->Extensions.EXT_shadow_funcs) {
return (const GLubyte *) version_1_5;
if (ctx->Extensions.ARB_draw_buffers &&
ctx->Extensions.ARB_point_sprite &&
ctx->Extensions.ARB_texture_non_power_of_two &&
ctx->Extensions.EXT_stencil_two_side) {
return (const GLubyte *) version_2_0;
}
else {
return (const GLubyte *) version_1_5;
}
}
else {
return (const GLubyte *) version_1_4;
+8 -4
View File
@@ -246,10 +246,14 @@ typedef GLushort GLhalfARB;
#endif
/* XXX temporary hack - remove when glext.h is updated */
#ifndef GL_POINT_SPRITE_COORD_ORIGIN
#define GL_POINT_SPRITE_COORD_ORIGIN 0x10000
#define GL_LOWER_LEFT 0x10001
#define GL_UPPER_LEFT 0x10002
#ifndef GL_CURRENT_PROGRAM
#define GL_CURRENT_PROGRAM 0x8B8D
#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
#define GL_LOWER_LEFT 0x8CA1
#define GL_UPPER_LEFT 0x8CA2
#define GL_STENCIL_BACK_REF 0x8CA3
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
#endif
+142 -76
View File
@@ -7,7 +7,7 @@
/*
* Mesa 3-D graphics library
* Version: 6.1
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -150,71 +150,89 @@ struct gl_texture_format;
/**
* These define the aliases between numbered vertex attributes and
* conventional OpenGL vertex attributes. We use these values in
* quite a few places.
*
* New in Mesa 4.1.
* Indexes for vertex program attributes.
* GL_NV_vertex_program aliases generic attributes over the conventional
* attributes. In GL_ARB_vertex_program shader the aliasing is optional.
* In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the
* generic attributes are distinct/separate).
*/
enum {
VERT_ATTRIB_POS = 0,
VERT_ATTRIB_WEIGHT = 1,
VERT_ATTRIB_NORMAL = 2,
VERT_ATTRIB_COLOR0 = 3,
VERT_ATTRIB_COLOR1 = 4,
VERT_ATTRIB_FOG = 5,
VERT_ATTRIB_SIX = 6,
VERT_ATTRIB_SEVEN = 7,
VERT_ATTRIB_TEX0 = 8,
VERT_ATTRIB_TEX1 = 9,
VERT_ATTRIB_TEX2 = 10,
VERT_ATTRIB_TEX3 = 11,
VERT_ATTRIB_TEX4 = 12,
VERT_ATTRIB_TEX5 = 13,
VERT_ATTRIB_TEX6 = 14,
VERT_ATTRIB_TEX7 = 15,
VERT_ATTRIB_MAX = 16
} ;
VERT_ATTRIB_POS = 0,
VERT_ATTRIB_WEIGHT = 1,
VERT_ATTRIB_NORMAL = 2,
VERT_ATTRIB_COLOR0 = 3,
VERT_ATTRIB_COLOR1 = 4,
VERT_ATTRIB_FOG = 5,
VERT_ATTRIB_SIX = 6,
VERT_ATTRIB_SEVEN = 7,
VERT_ATTRIB_TEX0 = 8,
VERT_ATTRIB_TEX1 = 9,
VERT_ATTRIB_TEX2 = 10,
VERT_ATTRIB_TEX3 = 11,
VERT_ATTRIB_TEX4 = 12,
VERT_ATTRIB_TEX5 = 13,
VERT_ATTRIB_TEX6 = 14,
VERT_ATTRIB_TEX7 = 15,
VERT_ATTRIB_GENERIC0 = 16,
VERT_ATTRIB_GENERIC1 = 17,
VERT_ATTRIB_GENERIC2 = 18,
VERT_ATTRIB_GENERIC3 = 19,
VERT_ATTRIB_MAX = 16
};
/* These are used in bitfields in many places */
#define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
#define VERT_BIT_SIX (1 << VERT_ATTRIB_SIX)
#define VERT_BIT_SEVEN (1 << VERT_ATTRIB_SEVEN)
#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
/**
* Bitflags for vertex attributes.
* These are used in bitfields in many places.
*/
/*@{*/
#define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
#define VERT_BIT_SIX (1 << VERT_ATTRIB_SIX)
#define VERT_BIT_SEVEN (1 << VERT_ATTRIB_SEVEN)
#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
#define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0)
#define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1)
#define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2)
#define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3)
#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u)))
#define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g)))
/*@}*/
/* Fragment programs use a different but related set of attributes:
/**
* Indexes for fragment program input attributes.
*/
enum {
FRAG_ATTRIB_WPOS = 0,
FRAG_ATTRIB_COL0 = 1,
FRAG_ATTRIB_COL1 = 2,
FRAG_ATTRIB_FOGC = 3,
FRAG_ATTRIB_TEX0 = 4,
FRAG_ATTRIB_TEX1 = 5,
FRAG_ATTRIB_TEX2 = 6,
FRAG_ATTRIB_TEX3 = 7,
FRAG_ATTRIB_TEX4 = 8,
FRAG_ATTRIB_TEX5 = 9,
FRAG_ATTRIB_TEX6 = 10,
FRAG_ATTRIB_TEX7 = 11
};
/* Fragment input registers / attributes */
#define FRAG_ATTRIB_WPOS 0
#define FRAG_ATTRIB_COL0 1
#define FRAG_ATTRIB_COL1 2
#define FRAG_ATTRIB_FOGC 3
#define FRAG_ATTRIB_TEX0 4
#define FRAG_ATTRIB_TEX1 5
#define FRAG_ATTRIB_TEX2 6
#define FRAG_ATTRIB_TEX3 7
#define FRAG_ATTRIB_TEX4 8
#define FRAG_ATTRIB_TEX5 9
#define FRAG_ATTRIB_TEX6 10
#define FRAG_ATTRIB_TEX7 11
/* Bitmasks for the above */
/*
* Bitflags for fragment attributes.
*/
/*@{*/
#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS)
#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
@@ -236,6 +254,7 @@ enum {
FRAG_BIT_TEX5| \
FRAG_BIT_TEX6| \
FRAG_BIT_TEX7)
/*@}*/
/**
@@ -260,14 +279,6 @@ enum {
/*@}*/
/**
* Maximum number of temporary vertices required for clipping.
*
* Used in array_cache and tnl modules.
*/
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
/**
* Data structure for color tables
*/
@@ -433,7 +444,7 @@ struct gl_accum_attrib {
/**
* Color buffers attributes.
* Color buffer attributes.
*/
struct gl_colorbuffer_attrib {
GLuint ClearIndex; /**< Index to use for glClear */
@@ -442,8 +453,8 @@ struct gl_colorbuffer_attrib {
GLuint IndexMask; /**< Color index write mask */
GLubyte ColorMask[4]; /**< Each flag is 0xff or 0x0 */
GLenum DrawBuffer; /**< Which buffer to draw into */
GLbitfield _DrawDestMask; /**< bitmask of DD_*_BIT bits */
GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */
GLbitfield _DrawDestMask[MAX_DRAW_BUFFERS];/**< bitmask of DD_*_BIT bits */
/**
* \name alpha testing
@@ -698,6 +709,9 @@ struct gl_histogram_attrib {
};
/**
* Color Min/max state.
*/
struct gl_minmax_attrib {
GLenum Format;
GLboolean Sink;
@@ -705,6 +719,9 @@ struct gl_minmax_attrib {
};
/**
* Image convolution state.
*/
struct gl_convolution_attrib {
GLenum Format;
GLenum InternalFormat;
@@ -714,10 +731,16 @@ struct gl_convolution_attrib {
};
/**
* Light state flags.
*/
/*@{*/
#define LIGHT_SPOT 0x1
#define LIGHT_LOCAL_VIEWER 0x2
#define LIGHT_POSITIONAL 0x4
#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
/*@}*/
/**
* Lighting attributes.
@@ -767,6 +790,9 @@ struct gl_line_attrib {
};
/**
* Display list state.
*/
struct gl_list_attrib {
GLuint ListBase;
};
@@ -787,6 +813,9 @@ struct gl_list_extensions {
};
/**
* Multisample state
*/
struct gl_multisample_attrib {
GLboolean Enabled;
GLboolean SampleAlphaToCoverage;
@@ -944,27 +973,45 @@ struct gl_stencil_attrib {
#define NUM_TEXTURE_TARGETS 5 /* 1D, 2D, 3D, CUBE and RECT */
/**
* An index for each type of texture object
*/
/*@{*/
#define TEXTURE_1D_INDEX 0
#define TEXTURE_2D_INDEX 1
#define TEXTURE_3D_INDEX 2
#define TEXTURE_CUBE_INDEX 3
#define TEXTURE_RECT_INDEX 4
/*@}*/
/* Texture.Unit[]._ReallyEnabled flags: */
/**
* Bit flags for each type of texture object
* Used for Texture.Unit[]._ReallyEnabled flags.
*/
/*@{*/
#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
/*@}*/
/* TexGenEnabled flags */
/**
* TexGenEnabled flags.
*/
/*@{*/
#define S_BIT 1
#define T_BIT 2
#define R_BIT 4
#define Q_BIT 8
/*@}*/
/* Bitmap versions of the GL_ constants. */
/**
* Bit flag versions of the corresponding GL_ constants.
*/
/*@{*/
#define TEXGEN_SPHERE_MAP 0x1
#define TEXGEN_OBJ_LINEAR 0x2
#define TEXGEN_EYE_LINEAR 0x4
@@ -978,6 +1025,8 @@ struct gl_stencil_attrib {
TEXGEN_REFLECTION_MAP_NV | \
TEXGEN_NORMAL_MAP_NV | \
TEXGEN_EYE_LINEAR)
/*@}*/
/* A selection of state flags to make driver and module's lives easier. */
#define ENABLE_TEXGEN0 0x1
@@ -1133,6 +1182,11 @@ struct gl_texture_image {
/*@}*/
};
/**
* Indexes for cube map faces.
*/
/*@{*/
#define FACE_POS_X 0
#define FACE_NEG_X 1
#define FACE_POS_Y 2
@@ -1140,6 +1194,8 @@ struct gl_texture_image {
#define FACE_POS_Z 4
#define FACE_NEG_Z 5
#define MAX_FACES 6
/*@}*/
/**
* Texture object record
@@ -1195,6 +1251,7 @@ struct gl_texture_object {
/*@}*/
};
/**
* Texture combine environment state.
*
@@ -1215,6 +1272,7 @@ struct gl_tex_env_combine_state {
GLuint _NumArgsA; /**< Number of inputs used for the combine mode. */
};
/**
* Texture unit record
*/
@@ -1414,7 +1472,7 @@ struct gl_client_array {
/**
* Array attributes.
* Vertex array state
*/
struct gl_array_attrib {
struct gl_client_array Vertex; /**< client data descriptors */
@@ -1444,6 +1502,9 @@ struct gl_array_attrib {
};
/**
* Feedback buffer state
*/
struct gl_feedback {
GLenum Type;
GLuint _Mask; /* FB_* bits */
@@ -1454,7 +1515,7 @@ struct gl_feedback {
/**
* Selection attributes.
* Selection buffer state
*/
struct gl_selection {
GLuint *Buffer; /**< selection buffer */
@@ -1494,7 +1555,7 @@ struct gl_2d_map
/**
* All evaluator control points
* All evaluator control point state
*/
struct gl_evaluators
{
@@ -1561,7 +1622,7 @@ enum register_file
};
/* Vertex and fragment instructions */
/** Vertex and fragment instructions */
struct vp_instruction;
struct fp_instruction;
@@ -1633,7 +1694,7 @@ struct program_state {
/**
* State vars for GL_NV_vertex_program
* State vars for GL_ARB/GL_NV_vertex_program
*/
struct vertex_program_state
{
@@ -1650,6 +1711,7 @@ struct vertex_program_state
/* Only used during program execution (may be moved someday): */
GLfloat Temporaries[MAX_NV_VERTEX_PROGRAM_TEMPS][4];
GLfloat Inputs[MAX_NV_VERTEX_PROGRAM_INPUTS][4];
GLuint InputsSize[MAX_NV_VERTEX_PROGRAM_INPUTS];
GLfloat Outputs[MAX_NV_VERTEX_PROGRAM_OUTPUTS][4];
GLint AddressReg[4];
@@ -1826,6 +1888,7 @@ struct gl_constants
GLuint MaxLights;
GLfloat MaxShininess; /* GL_NV_light_max_exponent */
GLfloat MaxSpotExponent; /* GL_NV_light_max_exponent */
GLuint MaxViewportWidth, MaxViewportHeight;
/* GL_ARB_vertex_program */
GLuint MaxVertexProgramInstructions;
GLuint MaxVertexProgramAttribs;
@@ -1848,6 +1911,8 @@ struct gl_constants
GLuint MaxProgramMatrixStackDepth;
/* vertex array / buffer object bounds checking */
GLboolean CheckArrayBounds;
/* GL_ARB_draw_buffers */
GLuint MaxDrawBuffers;
};
@@ -1864,6 +1929,7 @@ struct gl_extensions
/*@{*/
GLboolean dummy; /* don't remove this! */
GLboolean ARB_depth_texture;
GLboolean ARB_draw_buffers;
GLboolean ARB_fragment_program;
GLboolean ARB_half_float_pixel;
GLboolean ARB_imaging;
+4
View File
@@ -724,6 +724,7 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->UnmapBufferARB = _mesa_UnmapBufferARB;
#endif
/* ARB 29. GL_ARB_occlusion_query */
#if FEATURE_ARB_occlusion_query
exec->GenQueriesARB = _mesa_GenQueriesARB;
exec->DeleteQueriesARB = _mesa_DeleteQueriesARB;
@@ -734,6 +735,9 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->GetQueryObjectivARB = _mesa_GetQueryObjectivARB;
exec->GetQueryObjectuivARB = _mesa_GetQueryObjectuivARB;
#endif
/* ARB 37. GL_ARB_draw_buffers */
exec->DrawBuffersARB = _mesa_DrawBuffersARB;
}
/*@}*/
+1 -1
View File
@@ -112,7 +112,7 @@ _swrast_clear_alpha_buffers( GLcontext *ctx )
/* loop over four possible alpha buffers */
for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) {
if (bufferBit & ctx->Color._DrawDestMask) {
if (bufferBit & ctx->Color._DrawDestMask[0]) {
GLchan *buffer;
if (bufferBit == DD_FRONT_LEFT_BIT) {
buffer = ctx->DrawBuffer->FrontLeftAlpha;
+21 -11
View File
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.1
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -147,7 +147,7 @@ clear_color_buffers(GLcontext *ctx)
/* loop over four possible dest color buffers */
for (bufferBit = 1; bufferBit <= DD_AUX3_BIT; bufferBit <<= 1) {
if (bufferBit & ctx->Color._DrawDestMask) {
if (bufferBit & ctx->Color._DrawDestMask[0]) {
(*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
if (colorMask != 0xffffffff) {
@@ -199,7 +199,7 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask,
/* do software clearing here */
if (mask) {
if (mask & ctx->Color._DrawDestMask) {
if (mask & ctx->Color._DrawDestMask[0]) {
clear_color_buffers(ctx);
/* clear software-based alpha buffer(s) */
if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
@@ -260,6 +260,16 @@ _swrast_DrawBuffer( GLcontext *ctx, GLenum mode )
}
/*
* Fallback for ctx->Driver.DrawBuffers()
*/
void
_swrast_DrawBuffers( GLcontext *ctx, GLsizei n, const GLenum *buffers )
{
_swrast_use_draw_buffer(ctx);
}
/*
* Setup things so that we read/write spans from the user-designated
* read buffer (set via glReadPixels). We usually just have to call
@@ -297,21 +307,21 @@ _swrast_use_draw_buffer( GLcontext *ctx )
* we loop over multiple color buffers when needed.
*/
if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT)
if (ctx->Color._DrawDestMask[0] & DD_FRONT_LEFT_BIT)
swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT;
else if (ctx->Color._DrawDestMask & DD_BACK_LEFT_BIT)
else if (ctx->Color._DrawDestMask[0] & DD_BACK_LEFT_BIT)
swrast->CurrentBufferBit = DD_BACK_LEFT_BIT;
else if (ctx->Color._DrawDestMask & DD_FRONT_RIGHT_BIT)
else if (ctx->Color._DrawDestMask[0] & DD_FRONT_RIGHT_BIT)
swrast->CurrentBufferBit = DD_FRONT_RIGHT_BIT;
else if (ctx->Color._DrawDestMask & DD_BACK_RIGHT_BIT)
else if (ctx->Color._DrawDestMask[0] & DD_BACK_RIGHT_BIT)
swrast->CurrentBufferBit = DD_BACK_RIGHT_BIT;
else if (ctx->Color._DrawDestMask & DD_AUX0_BIT)
else if (ctx->Color._DrawDestMask[0] & DD_AUX0_BIT)
swrast->CurrentBufferBit = DD_AUX0_BIT;
else if (ctx->Color._DrawDestMask & DD_AUX1_BIT)
else if (ctx->Color._DrawDestMask[0] & DD_AUX1_BIT)
swrast->CurrentBufferBit = DD_AUX1_BIT;
else if (ctx->Color._DrawDestMask & DD_AUX2_BIT)
else if (ctx->Color._DrawDestMask[0] & DD_AUX2_BIT)
swrast->CurrentBufferBit = DD_AUX2_BIT;
else if (ctx->Color._DrawDestMask & DD_AUX3_BIT)
else if (ctx->Color._DrawDestMask[0] & DD_AUX3_BIT)
swrast->CurrentBufferBit = DD_AUX3_BIT;
else
/* glDrawBuffer(GL_NONE) */
+2 -2
View File
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.1
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -93,7 +93,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
* MULTI_DRAW_BIT flag. Also set it if we're drawing to no
* buffers or the RGBA or CI mask disables all writes.
*/
if (_mesa_bitcount(ctx->Color._DrawDestMask) != 1) {
if (_mesa_bitcount(ctx->Color._DrawDestMask[0]) != 1) {
/* more than one color buffer designated for writing (or zero buffers) */
rasterMask |= MULTI_DRAW_BIT;
}
+3 -3
View File
@@ -158,7 +158,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
/* If read and draw buffer are different we must do buffer switching */
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer[0]
|| ctx->DrawBuffer != ctx->ReadBuffer;
@@ -326,7 +326,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
/* If read and draw buffer are different we must do buffer switching */
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer[0]
|| ctx->DrawBuffer != ctx->ReadBuffer;
if (overlapping) {
@@ -466,7 +466,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
_swrast_span_default_fog(ctx, &span);
/* If read and draw buffer are different we must do buffer switching */
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer[0]
|| ctx->DrawBuffer != ctx->ReadBuffer;
if (overlapping) {
+2 -2
View File
@@ -749,7 +749,7 @@ multi_write_index_span( GLcontext *ctx, struct sw_span *span )
/* loop over four possible dest color buffers */
for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) {
if (bufferBit & ctx->Color._DrawDestMask) {
if (bufferBit & ctx->Color._DrawDestMask[0]) {
GLuint indexTmp[MAX_WIDTH];
ASSERT(span->end < MAX_WIDTH);
@@ -806,7 +806,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
/* loop over four possible dest color buffers */
for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) {
if (bufferBit & ctx->Color._DrawDestMask) {
if (bufferBit & ctx->Color._DrawDestMask[0]) {
GLchan rgbaTmp[MAX_WIDTH][4];
ASSERT(span->end < MAX_WIDTH);
+5 -1
View File
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.1
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -141,6 +141,10 @@ extern void
_swrast_DrawBuffer( GLcontext *ctx, GLenum mode );
extern void
_swrast_DrawBuffers( GLcontext *ctx, GLsizei n, const GLenum *buffers );
/* Reset the stipple counter
*/
extern void