with GLboolean in a few places.
* framebuffers we look at the framebuffer's visual. But for user-
* create framebuffers we look at the number of supported color attachments.
*/
-static GLuint
+static GLbitfield
supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID)
{
- GLuint mask = 0x0;
+ GLbitfield mask = 0x0;
GLint i;
if (framebufferID > 0) {
* Given a GLenum naming one or more color buffers (such as
* GL_FRONT_AND_BACK), return the corresponding bitmask of BUFFER_BIT_* flags.
*/
-static GLuint
+static GLbitfield
draw_buffer_enum_to_bitmask(GLenum buffer)
{
switch (buffer) {
* Given a GLenum naming (a) color buffer(s), return the corresponding
* bitmask of DD_* flags.
*/
-static GLuint
+static GLbitfield
read_buffer_enum_to_bitmask(GLenum buffer)
{
switch (buffer) {
_mesa_DrawBuffer(GLenum buffer)
{
GLuint bufferID;
- GLuint destMask;
+ GLbitfield destMask;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */
destMask = 0x0;
}
else {
- const GLuint supportedMask = supported_buffer_bitmask(ctx, bufferID);
+ const GLbitfield supportedMask = supported_buffer_bitmask(ctx, bufferID);
destMask = draw_buffer_enum_to_bitmask(buffer);
if (destMask == BAD_MASK) {
/* totally bogus buffer */
_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
{
GLint output;
- GLuint usedBufferMask, supportedMask;
GLuint bufferID;
- GLuint destMask[MAX_DRAW_BUFFERS];
+ GLbitfield usedBufferMask, supportedMask;
+ GLbitfield destMask[MAX_DRAW_BUFFERS];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
* (like BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT).
*/
static void
-set_color_output(GLcontext *ctx, GLuint output, GLenum buffer, GLuint destMask)
+set_color_output(GLcontext *ctx, GLuint output, GLenum buffer,
+ GLbitfield destMask)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
*/
void
_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers,
- const GLuint *destMask)
+ const GLbitfield *destMask)
{
- GLuint mask[MAX_DRAW_BUFFERS];
+ GLbitfield mask[MAX_DRAW_BUFFERS];
GLint output;
if (!destMask) {
/* compute destMask values now */
const GLuint bufferID = ctx->DrawBuffer->Name;
- const GLuint supportedMask = supported_buffer_bitmask(ctx, bufferID);
+ const GLbitfield supportedMask = supported_buffer_bitmask(ctx, bufferID);
for (output = 0; output < n; output++) {
mask[output] = draw_buffer_enum_to_bitmask(buffers[output]);
ASSERT(mask[output] != BAD_MASK);
_mesa_ReadBuffer(GLenum buffer)
{
struct gl_framebuffer *fb;
- GLuint srcMask, supportedMask;
+ GLbitfield srcMask, supportedMask;
GLuint bufferID;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
extern void
_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers,
- const GLuint *destMask);
+ const GLbitfield *destMask);
extern void GLAPIENTRY
_mesa_ReadBuffer( GLenum mode );
* the corresponding renderbuffer.
*/
static struct gl_renderbuffer *
-get_renderbuffer(struct gl_framebuffer *fb, GLuint bufferBit)
+get_renderbuffer(struct gl_framebuffer *fb, GLbitfield bufferBit)
{
GLuint index;
for (index = 0; index < BUFFER_COUNT; index++) {
* color buffers (for example).
*/
for (output = 0; output < ctx->Const.MaxDrawBuffers; output++) {
- GLuint bufferMask = fb->_ColorDrawBufferMask[output];
+ GLbitfield bufferMask = fb->_ColorDrawBufferMask[output];
GLuint count = 0;
GLuint bufferBit;
/* for each bit that's set in the bufferMask... */
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
_mesa_update_lighting( GLcontext *ctx )
{
struct gl_light *light;
- ctx->Light._NeedEyeCoords = 0;
+ ctx->Light._NeedEyeCoords = GL_FALSE;
ctx->Light._Flags = 0;
if (!ctx->Light.Enabled)
const GLuint oldneedeyecoords = ctx->_NeedEyeCoords;
(void) new_state;
- ctx->_NeedEyeCoords = 0;
+ ctx->_NeedEyeCoords = GL_FALSE;
if (ctx->_ForceEyeCoords ||
(ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) ||
ctx->Point._Attenuated ||
ctx->Light._NeedEyeCoords)
- ctx->_NeedEyeCoords = 1;
+ ctx->_NeedEyeCoords = GL_TRUE;
if (ctx->Light.Enabled &&
!_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top))
- ctx->_NeedEyeCoords = 1;
+ ctx->_NeedEyeCoords = GL_TRUE;
/* Check if the truth-value interpretations of the bitfields have
}
/* Miscellaneous */
- ctx->Light._NeedEyeCoords = 0;
- ctx->_NeedEyeCoords = 0;
+ ctx->Light._NeedEyeCoords = GL_FALSE;
+ ctx->_NeedEyeCoords = GL_FALSE;
ctx->_ModelViewInvScale = 1.0;
}
* \name Derived fields
*/
/*@{*/
- GLuint _Flags; /**< State */
+ GLbitfield _Flags; /**< State */
GLfloat _Position[4]; /**< position in eye/obj coordinates */
GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */
GLboolean AlphaTest;
GLboolean AutoNormal;
GLboolean Blend;
- GLuint ClipPlanes;
+ GLbitfield ClipPlanes;
GLboolean ColorMaterial;
GLboolean ColorTable; /* SGI_color_table */
GLboolean PostColorMatrixColorTable; /* SGI_color_table */
GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */
GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */
GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */
- GLuint ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
+ GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
GLboolean ColorMaterialEnabled;
struct gl_light EnabledList; /**< List sentinel */
/*@{*/
GLboolean _NeedEyeCoords;
GLboolean _NeedVertices; /**< Use fast shader? */
- GLuint _Flags; /**< LIGHT_* flags, see above */
+ GLbitfield _Flags; /**< LIGHT_* flags, see above */
GLfloat _BaseColor[2][3];
/*@}*/
};
*/
struct gl_texture_unit
{
- GLuint Enabled; /**< bitmask of TEXTURE_*_BIT flags */
- GLuint _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */
+ GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */
+ GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */
GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
GLfloat EnvColor[4];
- GLuint TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */
+ GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */
/** \name Tex coord generation mode
* Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */
/*@{*/
GLenum GenModeR;
GLenum GenModeQ;
/*@}*/
- GLuint _GenBitS;
- GLuint _GenBitT;
- GLuint _GenBitR;
- GLuint _GenBitQ;
- GLuint _GenFlags; /**< bitwise or of GenBit[STRQ] */
+ GLbitfield _GenBitS;
+ GLbitfield _GenBitT;
+ GLbitfield _GenBitR;
+ GLbitfield _GenBitQ;
+ GLbitfield _GenFlags; /**< bitwise or of GenBit[STRQ] */
GLfloat ObjectPlaneS[4];
GLfloat ObjectPlaneT[4];
GLfloat ObjectPlaneR[4];
* name multitexture
*/
/**@{*/
- GLuint CurrentUnit; /**< Active texture unit */
- GLuint _EnabledUnits; /**< one bit set for each really-enabled unit */
- GLuint _EnabledCoordUnits; /**< one bit per enabled coordinate unit */
- GLuint _GenFlags; /**< for texgen */
- GLuint _TexGenEnabled;
- GLuint _TexMatEnabled;
+ GLuint CurrentUnit; /**< Active texture unit */
+ GLbitfield _EnabledUnits; /**< one bit set for each really-enabled unit */
+ GLbitfield _EnabledCoordUnits; /**< one bit per enabled coordinate unit */
+ GLbitfield _GenFlags; /**< for texgen */
+ GLbitfield _TexGenEnabled;
+ GLbitfield _TexMatEnabled;
/**@}*/
struct gl_texture_unit Unit[MAX_TEXTURE_UNITS];
GLenum MatrixMode; /**< Matrix mode */
GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */
GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */
- GLuint ClipPlanesEnabled; /**< on/off bitmask */
+ GLbitfield ClipPlanesEnabled; /**< on/off bitmask */
GLboolean Normalize; /**< Normalize all normals? */
GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */
GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */
GLsizei Stride; /**< user-specified stride */
GLsizei StrideB; /**< actual stride in bytes */
const GLubyte *Ptr; /**< Points to array data */
- GLuint Enabled; /**< one of the _NEW_ARRAY_ bits */
+ GLbitfield Enabled; /**< one of the _NEW_ARRAY_ bits */
GLboolean Normalized; /**< GL_ARB_vertex_program */
/**< GL_ARB_vertex_buffer_object */
struct gl_buffer_object *BufferObj;
GLuint _MaxElement;
- GLuint Flags;
+ GLbitfield Flags;
};
GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */
GLuint LockCount; /**< GL_EXT_compiled_vertex_array */
- GLuint _Enabled; /**< _NEW_ARRAY_* - bit set if array enabled */
- GLuint NewState; /**< _NEW_ARRAY_* */
+ GLbitfield _Enabled; /**< _NEW_ARRAY_* - bit set if array enabled */
+ GLbitfield NewState; /**< _NEW_ARRAY_* */
#if FEATURE_ARB_vertex_buffer_object
struct gl_buffer_object *NullBufferObj;
struct gl_feedback
{
GLenum Type;
- GLuint _Mask; /* FB_* bits */
+ GLbitfield _Mask; /* FB_* bits */
GLfloat *Buffer;
GLuint BufferSize;
GLuint Count;
struct vp_instruction *Instructions; /* Compiled instructions */
GLboolean IsNVProgram; /* GL_NV_vertex_program ? */
GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */
- GLuint InputsRead; /* Bitmask of which input regs are read */
- GLuint OutputsWritten; /* Bitmask of which output regs are written to */
+ GLbitfield InputsRead; /* Bitmask of which input regs are read */
+ GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */
struct program_parameter_list *Parameters; /**< array [NumParameters] */
void *TnlData; /* should probably use Base.DriverData */
};
{
struct program Base; /**< base class */
struct fp_instruction *Instructions; /**< Compiled instructions */
- GLuint InputsRead; /**< Bitmask of which input regs are read */
- GLuint OutputsWritten; /**< Bitmask of which output regs are written to */
- GLuint TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_INDEX bitmask */
+ GLbitfield InputsRead; /**< Bitmask of which input regs are read */
+ GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */
+ GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_INDEX bitmask */
GLuint NumAluInstructions; /**< GL_ARB_fragment_program */
GLuint NumTexInstructions;
GLuint NumTexIndirections;
GLenum ColorReadBuffer;
/* These are computed from ColorDrawBuffer and ColorReadBuffer */
- GLuint _ColorDrawBufferMask[MAX_DRAW_BUFFERS]; /* Mask of BUFFER_BIT_* flags */
- GLuint _ColorReadBufferMask; /* Zero or one of BUFFER_BIT_ flags */
+ GLbitfield _ColorDrawBufferMask[MAX_DRAW_BUFFERS]; /* Mask of BUFFER_BIT_* flags */
+ GLbitfield _ColorReadBufferMask; /* Zero or one of BUFFER_BIT_ flags */
/* These are computed from _Draw/ReadBufferMask, above. */
GLuint _NumColorDrawBuffers[MAX_DRAW_BUFFERS];
{
Node *node;
GLuint id;
- GLuint flags;
+ GLbitfield flags;
};
GLenum ErrorValue; /**< Last error code */
GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
- GLuint NewState; /**< bitwise-or of _NEW_* flags */
+ GLbitfield NewState; /**< bitwise-or of _NEW_* flags */
/** \name Derived state */
/*@{*/
- GLuint _TriangleCaps; /**< bitwise-or of DD_* flags */
- GLuint _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
+ GLbitfield _TriangleCaps; /**< bitwise-or of DD_* flags */
+ GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
GLfloat _EyeZDir[3];
GLfloat _ModelViewInvScale;
- GLuint _NeedEyeCoords;
- GLuint _ForceEyeCoords;
+ GLboolean _NeedEyeCoords;
+ GLboolean _ForceEyeCoords;
GLboolean _RotateMode;
GLenum _CurrentProgram; /* currently executing program */
}
#define TEXTURE_UNKNOWN_INDEX 7
-static GLuint translate_tex_src_bit( GLuint bit )
+static GLuint translate_tex_src_bit( GLbitfield bit )
{
switch (bit) {
case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX;
case GL_S:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bits;
+ GLbitfield bits;
switch (mode) {
case GL_OBJECT_LINEAR:
bits = TEXGEN_OBJ_LINEAR;
case GL_T:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bitt;
+ GLbitfield bitt;
switch (mode) {
case GL_OBJECT_LINEAR:
bitt = TEXGEN_OBJ_LINEAR;
case GL_R:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bitr;
+ GLbitfield bitr;
switch (mode) {
case GL_OBJECT_LINEAR:
bitr = TEXGEN_OBJ_LINEAR;
case GL_Q:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bitq;
+ GLbitfield bitq;
switch (mode) {
case GL_OBJECT_LINEAR:
bitq = TEXGEN_OBJ_LINEAR;
*/
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint enableBits;
+ GLbitfield enableBits;
texUnit->_Current = NULL;
texUnit->_ReallyEnabled = 0;
static void
_swrast_update_rasterflags( GLcontext *ctx )
{
- GLuint rasterMask = 0;
+ GLbitfield rasterMask = 0;
if (ctx->Color.AlphaEnabled) rasterMask |= ALPHATEST_BIT;
if (ctx->Color.BlendEnabled) rasterMask |= BLEND_BIT;
* This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
* which of the x/xStep variables are relevant.
*/
- GLuint interpMask;
+ GLbitfield interpMask;
/* For horizontal spans, step is the partial derivative wrt X.
* For lines, step is the delta from one fragment to the next.
* This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
* which of the fragment arrays in the span_arrays struct are relevant.
*/
- GLuint arrayMask;
+ GLbitfield arrayMask;
/**
* We store the arrays of fragment values in a separate struct so
/** Derived values, invalidated on statechanges, updated from
* _swrast_validate_derived():
*/
- GLuint _RasterMask;
+ GLbitfield _RasterMask;
GLfloat _MinMagThresh[MAX_TEXTURE_IMAGE_UNITS];
GLfloat _BackfaceSign;
GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */
/* Working values:
*/
GLuint StippleCounter; /**< Line stipple counter */
- GLuint NewState;
+ GLbitfield NewState;
GLuint StateChanges;
GLenum Primitive; /* current primitive being drawn (ala glBegin) */
/** Function pointers for dispatch behind public entrypoints. */
/*@{*/
- void (*InvalidateState)( GLcontext *ctx, GLuint new_state );
+ void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state );
swrast_point_func Point;
swrast_line_func Line;
* General solution
*/
{
- const GLuint interpMask = span.interpMask;
- const GLuint arrayMask = span.arrayMask;
+ const GLbitfield interpMask = span.interpMask;
+ const GLbitfield arrayMask = span.arrayMask;
GLint row, skipPixels = 0;
/* if the span is wider than MAX_WIDTH we have to do it in chunks */
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_framebuffer *fb = ctx->DrawBuffer;
const GLuint output = 0;
- const GLuint origInterpMask = span->interpMask;
- const GLuint origArrayMask = span->arrayMask;
+ const GLbitfield origInterpMask = span->interpMask;
+ const GLbitfield origArrayMask = span->arrayMask;
GLuint buf;
ASSERT(span->end <= MAX_WIDTH);
{
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLuint origInterpMask = span->interpMask;
- const GLuint origArrayMask = span->arrayMask;
+ const GLbitfield origInterpMask = span->interpMask;
+ const GLbitfield origArrayMask = span->arrayMask;
ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE ||
span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);