mesa: replace GLuint with GLbitfield to be clearer about usage
Also, fix up some comments to be doxygen style.
This commit is contained in:
@@ -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 */
|
||||
/*@{*/
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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.
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user