Replace GLuint with GLbitfield where appropriate. Also replace GLuint

with GLboolean in a few places.
This commit is contained in:
Brian Paul
2005-09-15 05:00:45 +00:00
parent 0f540f4b04
commit e00ac11d4d
11 changed files with 80 additions and 79 deletions

View File

@@ -183,10 +183,10 @@ _mesa_Clear( GLbitfield mask )
* framebuffers we look at the framebuffer's visual. But for user- * framebuffers we look at the framebuffer's visual. But for user-
* create framebuffers we look at the number of supported color attachments. * create framebuffers we look at the number of supported color attachments.
*/ */
static GLuint static GLbitfield
supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID) supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID)
{ {
GLuint mask = 0x0; GLbitfield mask = 0x0;
GLint i; GLint i;
if (framebufferID > 0) { if (framebufferID > 0) {
@@ -223,7 +223,7 @@ supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID)
* Given a GLenum naming one or more color buffers (such as * Given a GLenum naming one or more color buffers (such as
* GL_FRONT_AND_BACK), return the corresponding bitmask of BUFFER_BIT_* flags. * GL_FRONT_AND_BACK), return the corresponding bitmask of BUFFER_BIT_* flags.
*/ */
static GLuint static GLbitfield
draw_buffer_enum_to_bitmask(GLenum buffer) draw_buffer_enum_to_bitmask(GLenum buffer)
{ {
switch (buffer) { switch (buffer) {
@@ -276,7 +276,7 @@ draw_buffer_enum_to_bitmask(GLenum buffer)
* Given a GLenum naming (a) color buffer(s), return the corresponding * Given a GLenum naming (a) color buffer(s), return the corresponding
* bitmask of DD_* flags. * bitmask of DD_* flags.
*/ */
static GLuint static GLbitfield
read_buffer_enum_to_bitmask(GLenum buffer) read_buffer_enum_to_bitmask(GLenum buffer)
{ {
switch (buffer) { switch (buffer) {
@@ -331,7 +331,7 @@ void GLAPIENTRY
_mesa_DrawBuffer(GLenum buffer) _mesa_DrawBuffer(GLenum buffer)
{ {
GLuint bufferID; GLuint bufferID;
GLuint destMask; GLbitfield destMask;
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */
@@ -345,7 +345,7 @@ _mesa_DrawBuffer(GLenum buffer)
destMask = 0x0; destMask = 0x0;
} }
else { else {
const GLuint supportedMask = supported_buffer_bitmask(ctx, bufferID); const GLbitfield supportedMask = supported_buffer_bitmask(ctx, bufferID);
destMask = draw_buffer_enum_to_bitmask(buffer); destMask = draw_buffer_enum_to_bitmask(buffer);
if (destMask == BAD_MASK) { if (destMask == BAD_MASK) {
/* totally bogus buffer */ /* totally bogus buffer */
@@ -378,9 +378,9 @@ void GLAPIENTRY
_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
{ {
GLint output; GLint output;
GLuint usedBufferMask, supportedMask;
GLuint bufferID; GLuint bufferID;
GLuint destMask[MAX_DRAW_BUFFERS]; GLbitfield usedBufferMask, supportedMask;
GLbitfield destMask[MAX_DRAW_BUFFERS];
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -445,7 +445,8 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
* (like BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT). * (like BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT).
*/ */
static void 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; struct gl_framebuffer *fb = ctx->DrawBuffer;
@@ -478,15 +479,15 @@ set_color_output(GLcontext *ctx, GLuint output, GLenum buffer, GLuint destMask)
*/ */
void void
_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers, _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; GLint output;
if (!destMask) { if (!destMask) {
/* compute destMask values now */ /* compute destMask values now */
const GLuint bufferID = ctx->DrawBuffer->Name; 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++) { for (output = 0; output < n; output++) {
mask[output] = draw_buffer_enum_to_bitmask(buffers[output]); mask[output] = draw_buffer_enum_to_bitmask(buffers[output]);
ASSERT(mask[output] != BAD_MASK); ASSERT(mask[output] != BAD_MASK);
@@ -525,7 +526,7 @@ void GLAPIENTRY
_mesa_ReadBuffer(GLenum buffer) _mesa_ReadBuffer(GLenum buffer)
{ {
struct gl_framebuffer *fb; struct gl_framebuffer *fb;
GLuint srcMask, supportedMask; GLbitfield srcMask, supportedMask;
GLuint bufferID; GLuint bufferID;
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);

View File

@@ -5,7 +5,7 @@
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 6.3 * Version: 6.5
* *
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
* *
@@ -54,7 +54,7 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers);
extern void extern void
_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers, _mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers,
const GLuint *destMask); const GLbitfield *destMask);
extern void GLAPIENTRY extern void GLAPIENTRY
_mesa_ReadBuffer( GLenum mode ); _mesa_ReadBuffer( GLenum mode );

View File

@@ -362,7 +362,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb)
* the corresponding renderbuffer. * the corresponding renderbuffer.
*/ */
static struct gl_renderbuffer * static struct gl_renderbuffer *
get_renderbuffer(struct gl_framebuffer *fb, GLuint bufferBit) get_renderbuffer(struct gl_framebuffer *fb, GLbitfield bufferBit)
{ {
GLuint index; GLuint index;
for (index = 0; index < BUFFER_COUNT; index++) { for (index = 0; index < BUFFER_COUNT; index++) {
@@ -403,7 +403,7 @@ _mesa_update_framebuffer(GLcontext *ctx)
* color buffers (for example). * color buffers (for example).
*/ */
for (output = 0; output < ctx->Const.MaxDrawBuffers; output++) { for (output = 0; output < ctx->Const.MaxDrawBuffers; output++) {
GLuint bufferMask = fb->_ColorDrawBufferMask[output]; GLbitfield bufferMask = fb->_ColorDrawBufferMask[output];
GLuint count = 0; GLuint count = 0;
GLuint bufferBit; GLuint bufferBit;
/* for each bit that's set in the bufferMask... */ /* for each bit that's set in the bufferMask... */

View File

@@ -1,6 +1,6 @@
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 6.3 * Version: 6.5
* *
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
* *
@@ -963,7 +963,7 @@ void
_mesa_update_lighting( GLcontext *ctx ) _mesa_update_lighting( GLcontext *ctx )
{ {
struct gl_light *light; struct gl_light *light;
ctx->Light._NeedEyeCoords = 0; ctx->Light._NeedEyeCoords = GL_FALSE;
ctx->Light._Flags = 0; ctx->Light._Flags = 0;
if (!ctx->Light.Enabled) if (!ctx->Light.Enabled)
@@ -1127,17 +1127,17 @@ _mesa_update_tnl_spaces( GLcontext *ctx, GLuint new_state )
const GLuint oldneedeyecoords = ctx->_NeedEyeCoords; const GLuint oldneedeyecoords = ctx->_NeedEyeCoords;
(void) new_state; (void) new_state;
ctx->_NeedEyeCoords = 0; ctx->_NeedEyeCoords = GL_FALSE;
if (ctx->_ForceEyeCoords || if (ctx->_ForceEyeCoords ||
(ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) || (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) ||
ctx->Point._Attenuated || ctx->Point._Attenuated ||
ctx->Light._NeedEyeCoords) ctx->Light._NeedEyeCoords)
ctx->_NeedEyeCoords = 1; ctx->_NeedEyeCoords = GL_TRUE;
if (ctx->Light.Enabled && if (ctx->Light.Enabled &&
!_math_matrix_is_length_preserving(ctx->ModelviewMatrixStack.Top)) !_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 /* Check if the truth-value interpretations of the bitfields have
@@ -1294,8 +1294,8 @@ _mesa_init_lighting( GLcontext *ctx )
} }
/* Miscellaneous */ /* Miscellaneous */
ctx->Light._NeedEyeCoords = 0; ctx->Light._NeedEyeCoords = GL_FALSE;
ctx->_NeedEyeCoords = 0; ctx->_NeedEyeCoords = GL_FALSE;
ctx->_ModelViewInvScale = 1.0; ctx->_ModelViewInvScale = 1.0;
} }

View File

@@ -443,7 +443,7 @@ struct gl_light
* \name Derived fields * \name Derived fields
*/ */
/*@{*/ /*@{*/
GLuint _Flags; /**< State */ GLbitfield _Flags; /**< State */
GLfloat _Position[4]; /**< position in eye/obj coordinates */ GLfloat _Position[4]; /**< position in eye/obj coordinates */
GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */ GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */
@@ -597,7 +597,7 @@ struct gl_enable_attrib
GLboolean AlphaTest; GLboolean AlphaTest;
GLboolean AutoNormal; GLboolean AutoNormal;
GLboolean Blend; GLboolean Blend;
GLuint ClipPlanes; GLbitfield ClipPlanes;
GLboolean ColorMaterial; GLboolean ColorMaterial;
GLboolean ColorTable; /* SGI_color_table */ GLboolean ColorTable; /* SGI_color_table */
GLboolean PostColorMatrixColorTable; /* SGI_color_table */ GLboolean PostColorMatrixColorTable; /* SGI_color_table */
@@ -821,7 +821,7 @@ struct gl_light_attrib
GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */ GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */
GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */ GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */
GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */ 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; GLboolean ColorMaterialEnabled;
struct gl_light EnabledList; /**< List sentinel */ struct gl_light EnabledList; /**< List sentinel */
@@ -832,7 +832,7 @@ struct gl_light_attrib
/*@{*/ /*@{*/
GLboolean _NeedEyeCoords; GLboolean _NeedEyeCoords;
GLboolean _NeedVertices; /**< Use fast shader? */ GLboolean _NeedVertices; /**< Use fast shader? */
GLuint _Flags; /**< LIGHT_* flags, see above */ GLbitfield _Flags; /**< LIGHT_* flags, see above */
GLfloat _BaseColor[2][3]; GLfloat _BaseColor[2][3];
/*@}*/ /*@}*/
}; };
@@ -1364,12 +1364,12 @@ struct gl_tex_env_combine_state
*/ */
struct gl_texture_unit struct gl_texture_unit
{ {
GLuint Enabled; /**< bitmask of TEXTURE_*_BIT flags */ GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */
GLuint _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */ GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */
GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */ GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
GLfloat EnvColor[4]; GLfloat EnvColor[4];
GLuint TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */ GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */
/** \name Tex coord generation mode /** \name Tex coord generation mode
* Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */ * Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */
/*@{*/ /*@{*/
@@ -1378,11 +1378,11 @@ struct gl_texture_unit
GLenum GenModeR; GLenum GenModeR;
GLenum GenModeQ; GLenum GenModeQ;
/*@}*/ /*@}*/
GLuint _GenBitS; GLbitfield _GenBitS;
GLuint _GenBitT; GLbitfield _GenBitT;
GLuint _GenBitR; GLbitfield _GenBitR;
GLuint _GenBitQ; GLbitfield _GenBitQ;
GLuint _GenFlags; /**< bitwise or of GenBit[STRQ] */ GLbitfield _GenFlags; /**< bitwise or of GenBit[STRQ] */
GLfloat ObjectPlaneS[4]; GLfloat ObjectPlaneS[4];
GLfloat ObjectPlaneT[4]; GLfloat ObjectPlaneT[4];
GLfloat ObjectPlaneR[4]; GLfloat ObjectPlaneR[4];
@@ -1447,11 +1447,11 @@ struct gl_texture_attrib
*/ */
/**@{*/ /**@{*/
GLuint CurrentUnit; /**< Active texture unit */ GLuint CurrentUnit; /**< Active texture unit */
GLuint _EnabledUnits; /**< one bit set for each really-enabled unit */ GLbitfield _EnabledUnits; /**< one bit set for each really-enabled unit */
GLuint _EnabledCoordUnits; /**< one bit per enabled coordinate unit */ GLbitfield _EnabledCoordUnits; /**< one bit per enabled coordinate unit */
GLuint _GenFlags; /**< for texgen */ GLbitfield _GenFlags; /**< for texgen */
GLuint _TexGenEnabled; GLbitfield _TexGenEnabled;
GLuint _TexMatEnabled; GLbitfield _TexMatEnabled;
/**@}*/ /**@}*/
struct gl_texture_unit Unit[MAX_TEXTURE_UNITS]; struct gl_texture_unit Unit[MAX_TEXTURE_UNITS];
@@ -1479,7 +1479,7 @@ struct gl_transform_attrib
GLenum MatrixMode; /**< Matrix mode */ GLenum MatrixMode; /**< Matrix mode */
GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */ GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */
GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */ GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */
GLuint ClipPlanesEnabled; /**< on/off bitmask */ GLbitfield ClipPlanesEnabled; /**< on/off bitmask */
GLboolean Normalize; /**< Normalize all normals? */ GLboolean Normalize; /**< Normalize all normals? */
GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */ GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */
GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */
@@ -1562,14 +1562,14 @@ struct gl_client_array
GLsizei Stride; /**< user-specified stride */ GLsizei Stride; /**< user-specified stride */
GLsizei StrideB; /**< actual stride in bytes */ GLsizei StrideB; /**< actual stride in bytes */
const GLubyte *Ptr; /**< Points to array data */ 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 */ GLboolean Normalized; /**< GL_ARB_vertex_program */
/**< GL_ARB_vertex_buffer_object */ /**< GL_ARB_vertex_buffer_object */
struct gl_buffer_object *BufferObj; struct gl_buffer_object *BufferObj;
GLuint _MaxElement; GLuint _MaxElement;
GLuint Flags; GLbitfield Flags;
}; };
@@ -1593,8 +1593,8 @@ struct gl_array_attrib
GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */
GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ GLuint LockCount; /**< GL_EXT_compiled_vertex_array */
GLuint _Enabled; /**< _NEW_ARRAY_* - bit set if array enabled */ GLbitfield _Enabled; /**< _NEW_ARRAY_* - bit set if array enabled */
GLuint NewState; /**< _NEW_ARRAY_* */ GLbitfield NewState; /**< _NEW_ARRAY_* */
#if FEATURE_ARB_vertex_buffer_object #if FEATURE_ARB_vertex_buffer_object
struct gl_buffer_object *NullBufferObj; struct gl_buffer_object *NullBufferObj;
@@ -1611,7 +1611,7 @@ struct gl_array_attrib
struct gl_feedback struct gl_feedback
{ {
GLenum Type; GLenum Type;
GLuint _Mask; /* FB_* bits */ GLbitfield _Mask; /* FB_* bits */
GLfloat *Buffer; GLfloat *Buffer;
GLuint BufferSize; GLuint BufferSize;
GLuint Count; GLuint Count;
@@ -1778,8 +1778,8 @@ struct vertex_program
struct vp_instruction *Instructions; /* Compiled instructions */ struct vp_instruction *Instructions; /* Compiled instructions */
GLboolean IsNVProgram; /* GL_NV_vertex_program ? */ GLboolean IsNVProgram; /* GL_NV_vertex_program ? */
GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */ GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */
GLuint InputsRead; /* Bitmask of which input regs are read */ GLbitfield InputsRead; /* Bitmask of which input regs are read */
GLuint OutputsWritten; /* Bitmask of which output regs are written to */ GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */
struct program_parameter_list *Parameters; /**< array [NumParameters] */ struct program_parameter_list *Parameters; /**< array [NumParameters] */
void *TnlData; /* should probably use Base.DriverData */ void *TnlData; /* should probably use Base.DriverData */
}; };
@@ -1790,9 +1790,9 @@ struct fragment_program
{ {
struct program Base; /**< base class */ struct program Base; /**< base class */
struct fp_instruction *Instructions; /**< Compiled instructions */ struct fp_instruction *Instructions; /**< Compiled instructions */
GLuint InputsRead; /**< Bitmask of which input regs are read */ GLbitfield InputsRead; /**< Bitmask of which input regs are read */
GLuint OutputsWritten; /**< Bitmask of which output regs are written to */ GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */
GLuint TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_INDEX bitmask */ GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_INDEX bitmask */
GLuint NumAluInstructions; /**< GL_ARB_fragment_program */ GLuint NumAluInstructions; /**< GL_ARB_fragment_program */
GLuint NumTexInstructions; GLuint NumTexInstructions;
GLuint NumTexIndirections; GLuint NumTexIndirections;
@@ -2204,8 +2204,8 @@ struct gl_framebuffer
GLenum ColorReadBuffer; GLenum ColorReadBuffer;
/* These are computed from ColorDrawBuffer and ColorReadBuffer */ /* These are computed from ColorDrawBuffer and ColorReadBuffer */
GLuint _ColorDrawBufferMask[MAX_DRAW_BUFFERS]; /* Mask of BUFFER_BIT_* flags */ GLbitfield _ColorDrawBufferMask[MAX_DRAW_BUFFERS]; /* Mask of BUFFER_BIT_* flags */
GLuint _ColorReadBufferMask; /* Zero or one of BUFFER_BIT_ flags */ GLbitfield _ColorReadBufferMask; /* Zero or one of BUFFER_BIT_ flags */
/* These are computed from _Draw/ReadBufferMask, above. */ /* These are computed from _Draw/ReadBufferMask, above. */
GLuint _NumColorDrawBuffers[MAX_DRAW_BUFFERS]; GLuint _NumColorDrawBuffers[MAX_DRAW_BUFFERS];
@@ -2633,7 +2633,7 @@ struct mesa_display_list
{ {
Node *node; Node *node;
GLuint id; GLuint id;
GLuint flags; GLbitfield flags;
}; };
@@ -2829,16 +2829,16 @@ struct __GLcontextRec
GLenum ErrorValue; /**< Last error code */ GLenum ErrorValue; /**< Last error code */
GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ 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 */ /** \name Derived state */
/*@{*/ /*@{*/
GLuint _TriangleCaps; /**< bitwise-or of DD_* flags */ GLbitfield _TriangleCaps; /**< bitwise-or of DD_* flags */
GLuint _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
GLfloat _EyeZDir[3]; GLfloat _EyeZDir[3];
GLfloat _ModelViewInvScale; GLfloat _ModelViewInvScale;
GLuint _NeedEyeCoords; GLboolean _NeedEyeCoords;
GLuint _ForceEyeCoords; GLboolean _ForceEyeCoords;
GLboolean _RotateMode; GLboolean _RotateMode;
GLenum _CurrentProgram; /* currently executing program */ GLenum _CurrentProgram; /* currently executing program */

View File

@@ -169,7 +169,7 @@ static GLuint translate_mode( GLenum mode )
} }
#define TEXTURE_UNKNOWN_INDEX 7 #define TEXTURE_UNKNOWN_INDEX 7
static GLuint translate_tex_src_bit( GLuint bit ) static GLuint translate_tex_src_bit( GLbitfield bit )
{ {
switch (bit) { switch (bit) {
case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX; case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX;

View File

@@ -2155,7 +2155,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
case GL_S: case GL_S:
if (pname==GL_TEXTURE_GEN_MODE) { if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params; GLenum mode = (GLenum) (GLint) *params;
GLuint bits; GLbitfield bits;
switch (mode) { switch (mode) {
case GL_OBJECT_LINEAR: case GL_OBJECT_LINEAR:
bits = TEXGEN_OBJ_LINEAR; bits = TEXGEN_OBJ_LINEAR;
@@ -2212,7 +2212,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
case GL_T: case GL_T:
if (pname==GL_TEXTURE_GEN_MODE) { if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params; GLenum mode = (GLenum) (GLint) *params;
GLuint bitt; GLbitfield bitt;
switch (mode) { switch (mode) {
case GL_OBJECT_LINEAR: case GL_OBJECT_LINEAR:
bitt = TEXGEN_OBJ_LINEAR; bitt = TEXGEN_OBJ_LINEAR;
@@ -2268,7 +2268,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
case GL_R: case GL_R:
if (pname==GL_TEXTURE_GEN_MODE) { if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params; GLenum mode = (GLenum) (GLint) *params;
GLuint bitr; GLbitfield bitr;
switch (mode) { switch (mode) {
case GL_OBJECT_LINEAR: case GL_OBJECT_LINEAR:
bitr = TEXGEN_OBJ_LINEAR; bitr = TEXGEN_OBJ_LINEAR;
@@ -2321,7 +2321,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
case GL_Q: case GL_Q:
if (pname==GL_TEXTURE_GEN_MODE) { if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params; GLenum mode = (GLenum) (GLint) *params;
GLuint bitq; GLbitfield bitq;
switch (mode) { switch (mode) {
case GL_OBJECT_LINEAR: case GL_OBJECT_LINEAR:
bitq = TEXGEN_OBJ_LINEAR; bitq = TEXGEN_OBJ_LINEAR;
@@ -2937,7 +2937,7 @@ update_texture_state( GLcontext *ctx )
*/ */
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
GLuint enableBits; GLbitfield enableBits;
texUnit->_Current = NULL; texUnit->_Current = NULL;
texUnit->_ReallyEnabled = 0; texUnit->_ReallyEnabled = 0;

View File

@@ -54,7 +54,7 @@
static void static void
_swrast_update_rasterflags( GLcontext *ctx ) _swrast_update_rasterflags( GLcontext *ctx )
{ {
GLuint rasterMask = 0; GLbitfield rasterMask = 0;
if (ctx->Color.AlphaEnabled) rasterMask |= ALPHATEST_BIT; if (ctx->Color.AlphaEnabled) rasterMask |= ALPHATEST_BIT;
if (ctx->Color.BlendEnabled) rasterMask |= BLEND_BIT; if (ctx->Color.BlendEnabled) rasterMask |= BLEND_BIT;

View File

@@ -139,7 +139,7 @@ struct sw_span {
* This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
* which of the x/xStep variables are relevant. * which of the x/xStep variables are relevant.
*/ */
GLuint interpMask; GLbitfield interpMask;
/* For horizontal spans, step is the partial derivative wrt X. /* For horizontal spans, step is the partial derivative wrt X.
* For lines, step is the delta from one fragment to the next. * For lines, step is the delta from one fragment to the next.
@@ -185,7 +185,7 @@ struct sw_span {
* This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
* which of the fragment arrays in the span_arrays struct are relevant. * 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 * We store the arrays of fragment values in a separate struct so
@@ -279,7 +279,7 @@ typedef struct
/** Derived values, invalidated on statechanges, updated from /** Derived values, invalidated on statechanges, updated from
* _swrast_validate_derived(): * _swrast_validate_derived():
*/ */
GLuint _RasterMask; GLbitfield _RasterMask;
GLfloat _MinMagThresh[MAX_TEXTURE_IMAGE_UNITS]; GLfloat _MinMagThresh[MAX_TEXTURE_IMAGE_UNITS];
GLfloat _BackfaceSign; GLfloat _BackfaceSign;
GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */
@@ -296,7 +296,7 @@ typedef struct
/* Working values: /* Working values:
*/ */
GLuint StippleCounter; /**< Line stipple counter */ GLuint StippleCounter; /**< Line stipple counter */
GLuint NewState; GLbitfield NewState;
GLuint StateChanges; GLuint StateChanges;
GLenum Primitive; /* current primitive being drawn (ala glBegin) */ GLenum Primitive; /* current primitive being drawn (ala glBegin) */
@@ -315,7 +315,7 @@ typedef struct
/** Function pointers for dispatch behind public entrypoints. */ /** 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_point_func Point;
swrast_line_func Line; swrast_line_func Line;

View File

@@ -812,8 +812,8 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
* General solution * General solution
*/ */
{ {
const GLuint interpMask = span.interpMask; const GLbitfield interpMask = span.interpMask;
const GLuint arrayMask = span.arrayMask; const GLbitfield arrayMask = span.arrayMask;
GLint row, skipPixels = 0; GLint row, skipPixels = 0;
/* if the span is wider than MAX_WIDTH we have to do it in chunks */ /* if the span is wider than MAX_WIDTH we have to do it in chunks */

View File

@@ -775,8 +775,8 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
const SWcontext *swrast = SWRAST_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_framebuffer *fb = ctx->DrawBuffer; const struct gl_framebuffer *fb = ctx->DrawBuffer;
const GLuint output = 0; const GLuint output = 0;
const GLuint origInterpMask = span->interpMask; const GLbitfield origInterpMask = span->interpMask;
const GLuint origArrayMask = span->arrayMask; const GLbitfield origArrayMask = span->arrayMask;
GLuint buf; GLuint buf;
ASSERT(span->end <= MAX_WIDTH); ASSERT(span->end <= MAX_WIDTH);
@@ -1078,8 +1078,8 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
{ {
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
SWcontext *swrast = SWRAST_CONTEXT(ctx); SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLuint origInterpMask = span->interpMask; const GLbitfield origInterpMask = span->interpMask;
const GLuint origArrayMask = span->arrayMask; const GLbitfield origArrayMask = span->arrayMask;
ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE ||
span->primitive == GL_POLYGON || span->primitive == GL_BITMAP); span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);