summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-03-21 17:05:03 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-03-21 17:05:03 +0000
commit894844a8d956a0ee5f95836331dc318f49fdb845 (patch)
tree92aab765e7c82edf310ce1a5d3f1b25cfabc5156 /src/mesa/main
parent009501642533c7378fc4f061f1abe2ed4473a3f6 (diff)
Implemented support for software-based AUX color buffers.
Only available with Xlib driver for now. Assorted clean-ups related to Draw/ReadBuffer(). Renamed FRONT_LEFT_BIT -> DD_FRONT_LEFT_BIT, etc.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/blend.c10
-rw-r--r--src/mesa/main/buffers.c72
-rw-r--r--src/mesa/main/config.h4
-rw-r--r--src/mesa/main/context.c52
-rw-r--r--src/mesa/main/dd.h20
-rw-r--r--src/mesa/main/get.c10
-rw-r--r--src/mesa/main/mtypes.h45
-rw-r--r--src/mesa/main/pixel.c10
8 files changed, 110 insertions, 113 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 6741238aae..fde542c4b9 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -5,9 +5,9 @@
/*
* 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"),
@@ -532,7 +532,7 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
/*@{*/
/**
- * Initialization of the context color data.
+ * Initialization of the context's Color attribute group.
*
* \param ctx GL context.
*
@@ -569,11 +569,11 @@ void _mesa_init_color( GLcontext * ctx )
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;
}
}
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 30fa433280..488125c4db 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -5,7 +5,7 @@
/*
* Mesa 3-D graphics library
- * Version: 6.0.1
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -192,9 +192,9 @@ _mesa_DrawBuffer( GLenum mode )
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) {
@@ -202,9 +202,9 @@ _mesa_DrawBuffer( GLenum mode )
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 */
@@ -216,30 +216,30 @@ _mesa_DrawBuffer( GLenum mode )
_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) {
@@ -247,25 +247,25 @@ _mesa_DrawBuffer( GLenum mode )
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)" );
@@ -273,8 +273,8 @@ _mesa_DrawBuffer( GLenum mode )
}
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)" );
@@ -282,8 +282,8 @@ _mesa_DrawBuffer( GLenum mode )
}
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)" );
@@ -291,8 +291,8 @@ _mesa_DrawBuffer( GLenum mode )
}
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)" );
@@ -344,7 +344,7 @@ _mesa_ReadBuffer( GLenum mode )
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:
@@ -353,7 +353,7 @@ _mesa_ReadBuffer( GLenum mode )
_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:
@@ -362,18 +362,18 @@ _mesa_ReadBuffer( GLenum mode )
_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)" );
@@ -381,8 +381,8 @@ _mesa_ReadBuffer( GLenum mode )
}
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)" );
@@ -390,8 +390,8 @@ _mesa_ReadBuffer( GLenum mode )
}
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)" );
@@ -399,8 +399,8 @@ _mesa_ReadBuffer( GLenum mode )
}
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)" );
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 74ebb469af..20206482c9 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -71,8 +71,8 @@
/** 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
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 951763642b..2328b3726e 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -418,7 +418,8 @@ __glCoreNopDispatch(void)
/*@{*/
/**
- * 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
@@ -439,8 +440,7 @@ __glCoreNopDispatch(void)
* \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,
@@ -475,14 +475,14 @@ _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,
@@ -502,8 +502,6 @@ _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
@@ -555,12 +553,14 @@ _mesa_initialize_visual( GLvisual *vis,
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.
*
@@ -581,7 +581,8 @@ _mesa_destroy_visual( GLvisual *vis )
/*@{*/
/**
- * 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.
@@ -594,8 +595,7 @@ _mesa_destroy_visual( GLvisual *vis )
*
* \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,
@@ -614,13 +614,12 @@ _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,
@@ -630,6 +629,7 @@ _mesa_initialize_framebuffer( GLframebuffer *buffer,
GLboolean softwareAccum,
GLboolean softwareAlpha )
{
+ GLboolean softwareAux = GL_FALSE;
assert(buffer);
assert(visual);
@@ -658,8 +658,10 @@ _mesa_initialize_framebuffer( GLframebuffer *buffer,
buffer->UseSoftwareStencilBuffer = softwareStencil;
buffer->UseSoftwareAccumBuffer = softwareAccum;
buffer->UseSoftwareAlphaBuffers = softwareAlpha;
+ buffer->UseSoftwareAuxBuffers = softwareAux;
}
+
/**
* Free a framebuffer struct and its buffers.
*
@@ -674,6 +676,7 @@ _mesa_destroy_framebuffer( GLframebuffer *buffer )
}
}
+
/**
* Free the data hanging off of \p buffer, but not \p buffer itself.
*
@@ -757,11 +760,11 @@ one_time_init( GLcontext *ctx )
/* 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();
@@ -799,15 +802,15 @@ one_time_init( GLcontext *ctx )
_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 )
@@ -1033,7 +1036,6 @@ _mesa_init_constants( 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;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index f1b49b7a30..b2b0bbd237 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -5,9 +5,9 @@
/*
* 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"),
@@ -35,20 +35,6 @@
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.
@@ -629,7 +615,7 @@ struct dd_function_table {
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 );
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index fac3f072bc..e4e60abe7e 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -5,7 +5,7 @@
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -212,7 +212,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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;
@@ -1767,7 +1767,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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;
@@ -3317,7 +3317,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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;
@@ -4844,7 +4844,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0dcf54baf7..b74eeaccca 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -236,6 +236,27 @@ enum {
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.
@@ -410,24 +431,6 @@ struct gl_accum_attrib {
/**
- * \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.
*/
struct gl_colorbuffer_attrib {
@@ -438,7 +441,7 @@ struct gl_colorbuffer_attrib {
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
@@ -1709,6 +1712,7 @@ struct gl_frame_buffer
GLboolean UseSoftwareAccumBuffer;
GLboolean UseSoftwareStencilBuffer;
GLboolean UseSoftwareAlphaBuffers;
+ GLboolean UseSoftwareAuxBuffers;
/** \name Software depth (aka Z) buffer */
/*@{*/
@@ -1733,6 +1737,8 @@ struct gl_frame_buffer
GLchan *BackRightAlpha; /**< array [Width*Height] of GLchan */
/*@}*/
+ GLchan *AuxBuffers[MAX_AUX_BUFFERS];
+
/**
* \name Drawing bounds
*
@@ -1770,7 +1776,6 @@ struct gl_constants
GLfloat MinLineWidth, MaxLineWidth; /* aliased */
GLfloat MinLineWidthAA, MaxLineWidthAA; /* antialiased */
GLfloat LineWidthGranularity;
- GLuint NumAuxBuffers;
GLuint MaxColorTableSize;
GLuint MaxConvolutionWidth;
GLuint MaxConvolutionHeight;
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 8e2b55fc34..c4fa17f22f 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -1683,8 +1683,12 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state )
/***** Initialization *****/
/**********************************************************************/
+
+/**
+ * Initialize the context's PIXEL attribute group.
+ */
void
-_mesa_init_pixel( GLcontext * ctx )
+_mesa_init_pixel( GLcontext *ctx )
{
int i;
@@ -1815,11 +1819,11 @@ _mesa_init_pixel( GLcontext * ctx )
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 */