mesa: replace GLuint with GLbitfield to be clearer about usage

Also, fix up some comments to be doxygen style.
This commit is contained in:
Brian Paul
2008-10-07 11:22:47 -06:00
parent 23cc303994
commit 239617fbe2
7 changed files with 22 additions and 20 deletions

View File

@@ -3073,7 +3073,7 @@ struct __GLcontextRec
GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLbitfield NewState; /**< bitwise-or of _NEW_* flags */
GLuint varying_vp_inputs;
GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */
/** \name Derived state */
/*@{*/

View File

@@ -532,7 +532,7 @@ _mesa_update_state( GLcontext *ctx )
*/
void
_mesa_set_varying_vp_inputs( GLcontext *ctx,
unsigned varying_inputs )
GLbitfield varying_inputs )
{
if (ctx->varying_vp_inputs != varying_inputs) {
ctx->varying_vp_inputs = varying_inputs;

View File

@@ -39,6 +39,6 @@ _mesa_update_state_locked( GLcontext *ctx );
void
_mesa_set_varying_vp_inputs( GLcontext *ctx,
unsigned varying_inputs );
GLbitfield varying_inputs );
#endif

View File

@@ -192,7 +192,8 @@ static GLuint translate_tex_src_bit( GLbitfield bit )
#define VERT_BIT_TEX_ANY (0xff << VERT_ATTRIB_TEX0)
#define VERT_RESULT_TEX_ANY (0xff << VERT_RESULT_TEX0)
/* Identify all possible varying inputs. The fragment program will
/**
* Identify all possible varying inputs. The fragment program will
* never reference non-varying inputs, but will track them via state
* constants instead.
*
@@ -200,15 +201,15 @@ static GLuint translate_tex_src_bit( GLbitfield bit )
* has access to. The bitmask is later reduced to just those which
* are actually referenced.
*/
static GLuint get_fp_input_mask( GLcontext *ctx )
static GLbitfield get_fp_input_mask( GLcontext *ctx )
{
GLuint fp_inputs = 0;
GLbitfield fp_inputs = 0x0;
if (!ctx->VertexProgram._Enabled ||
!ctx->VertexProgram._Current) {
/* Fixed function logic */
GLuint varying_inputs = ctx->varying_vp_inputs;
GLbitfield varying_inputs = ctx->varying_vp_inputs;
/* First look at what values may be computed by the generated
* vertex program:
@@ -235,7 +236,7 @@ static GLuint get_fp_input_mask( GLcontext *ctx )
}
else {
/* calculate from vp->outputs */
GLuint vp_outputs = ctx->VertexProgram._Current->Base.OutputsWritten;
GLbitfield vp_outputs = ctx->VertexProgram._Current->Base.OutputsWritten;
if (vp_outputs & (1 << VERT_RESULT_COL0)) fp_inputs |= FRAG_BIT_COL0;
if (vp_outputs & (1 << VERT_RESULT_COL1)) fp_inputs |= FRAG_BIT_COL1;
@@ -255,8 +256,8 @@ static GLuint get_fp_input_mask( GLcontext *ctx )
static void make_state_key( GLcontext *ctx, struct state_key *key )
{
GLuint i, j;
GLuint inputs_referenced = FRAG_BIT_COL0;
GLuint inputs_available = get_fp_input_mask( ctx );
GLbitfield inputs_referenced = FRAG_BIT_COL0;
GLbitfield inputs_available = get_fp_input_mask( ctx );
memset(key, 0, sizeof(*key));
@@ -311,7 +312,8 @@ static void make_state_key( GLcontext *ctx, struct state_key *key )
key->inputs_available = (inputs_available & inputs_referenced);
}
/* Use uregs to represent registers internally, translate to Mesa's
/**
* Use uregs to represent registers internally, translate to Mesa's
* expected formats on emit.
*
* NOTE: These are passed by value extensively in this file rather
@@ -344,16 +346,16 @@ static const struct ureg undef = {
};
/* State used to build the fragment program:
/** State used to build the fragment program:
*/
struct texenv_fragment_program {
struct gl_fragment_program *program;
GLcontext *ctx;
struct state_key *state;
GLbitfield alu_temps; /* Track texture indirections, see spec. */
GLbitfield temps_output; /* Track texture indirections, see spec. */
GLbitfield temp_in_use; /* Tracks temporary regs which are in use. */
GLbitfield alu_temps; /**< Track texture indirections, see spec. */
GLbitfield temps_output; /**< Track texture indirections, see spec. */
GLbitfield temp_in_use; /**< Tracks temporary regs which are in use. */
GLboolean error;
struct ureg src_texture[MAX_TEXTURE_UNITS];
@@ -361,11 +363,11 @@ struct texenv_fragment_program {
* else undef.
*/
struct ureg src_previous; /* Reg containing color from previous
struct ureg src_previous; /**< Reg containing color from previous
* stage. May need to be decl'd.
*/
GLuint last_tex_stage; /* Number of last enabled texture unit */
GLuint last_tex_stage; /**< Number of last enabled texture unit */
struct ureg half;
struct ureg one;

View File

@@ -127,7 +127,7 @@ static void recalculate_input_bindings( GLcontext *ctx )
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec;
const struct gl_client_array **inputs = &exec->array.inputs[0];
GLuint const_inputs = 0;
GLbitfield const_inputs = 0x0;
GLuint i;
exec->array.program_mode = get_program_mode(ctx);

View File

@@ -150,7 +150,7 @@ static void vbo_exec_bind_arrays( GLcontext *ctx )
GLubyte *data = exec->vtx.buffer_map;
const GLuint *map;
GLuint attr;
GLuint varying_inputs = 0;
GLbitfield varying_inputs = 0x0;
/* Install the default (ie Current) attributes first, then overlay
* all active ones.

View File

@@ -118,7 +118,7 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
GLuint data = node->buffer_offset;
const GLuint *map;
GLuint attr;
GLuint varying_inputs = 0;
GLbitfield varying_inputs = 0x0;
/* Install the default (ie Current) attributes first, then overlay
* all active ones.