}
}
-static unsigned long t_src_class(enum register_file file)
+static unsigned long t_src_class(gl_register_file file)
{
switch(file){
return mask & VSF_FLAG_ALL;
}
-static unsigned long t_dst_class(enum register_file file)
+static unsigned long t_dst_class(gl_register_file file)
{
switch (file) {
return dst->Index;
}
-static unsigned long t_src_class(enum register_file file)
+static unsigned long t_src_class(gl_register_file file)
{
switch (file) {
case PROGRAM_TEMPORARY:
* be "uniform" variables since they can only be set outside glBegin/End.
* They're also all stored in the same Parameters array.
*/
-enum register_file
-{
- PROGRAM_TEMPORARY = 0, /**< machine->Temporary[] */
- PROGRAM_LOCAL_PARAM = 1, /**< gl_program->LocalParams[] */
- PROGRAM_ENV_PARAM = 2, /**< gl_program->Parameters[] */
- PROGRAM_STATE_VAR = 3, /**< gl_program->Parameters[] */
- PROGRAM_INPUT = 4, /**< machine->Inputs[] */
- PROGRAM_OUTPUT = 5, /**< machine->Outputs[] */
- PROGRAM_NAMED_PARAM = 6, /**< gl_program->Parameters[] */
- PROGRAM_CONSTANT = 7, /**< gl_program->Parameters[] */
- PROGRAM_UNIFORM = 8, /**< gl_program->Parameters[] */
- PROGRAM_VARYING = 9, /**< machine->Inputs[]/Outputs[] */
- PROGRAM_WRITE_ONLY = 10, /**< A dummy, write-only register */
- PROGRAM_ADDRESS = 11, /**< machine->AddressReg */
- PROGRAM_SAMPLER = 12, /**< for shader samplers, compile-time only */
- PROGRAM_UNDEFINED = 13, /**< Invalid value */
+typedef enum
+{
+ PROGRAM_TEMPORARY, /**< machine->Temporary[] */
+ PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
+ PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */
+ PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */
+ PROGRAM_INPUT, /**< machine->Inputs[] */
+ PROGRAM_OUTPUT, /**< machine->Outputs[] */
+ PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */
+ PROGRAM_CONSTANT, /**< gl_program->Parameters[] */
+ PROGRAM_UNIFORM, /**< gl_program->Parameters[] */
+ PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */
+ PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */
+ PROGRAM_ADDRESS, /**< machine->AddressReg */
+ PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */
+ PROGRAM_UNDEFINED, /**< Invalid/TBD value */
PROGRAM_FILE_MAX
-};
+} gl_register_file;
/** Vertex and fragment instructions */
static GLuint
parse_masked_dst_reg (GLcontext * ctx, const GLubyte ** inst,
struct var_cache **vc_head, struct arb_program *Program,
- enum register_file *File, GLuint *Index, GLint *WriteMask)
+ gl_register_file *File, GLuint *Index, GLint *WriteMask)
{
GLuint tmp, result;
struct var_cache *dst;
parse_src_reg (GLcontext * ctx, const GLubyte ** inst,
struct var_cache **vc_head,
struct arb_program *Program,
- enum register_file * File, GLint * Index,
+ gl_register_file * File, GLint * Index,
GLboolean *IsRelOffset )
{
struct var_cache *src;
return 1;
}
- *File = (enum register_file) src->param_binding_type;
+ *File = (gl_register_file) src->param_binding_type;
switch (*(*inst)++) {
case ARRAY_INDEX_ABSOLUTE:
if (parse_param_use (ctx, inst, vc_head, Program, &src))
return 1;
- *File = (enum register_file) src->param_binding_type;
+ *File = (gl_register_file) src->param_binding_type;
*Index = src->param_binding_begin;
break;
}
/* XXX: We have to handle offsets someplace in here! -- or are those above? */
case vt_param:
- *File = (enum register_file) src->param_binding_type;
+ *File = (gl_register_file) src->param_binding_type;
*Index = src->param_binding_begin;
break;
}
if (*File == PROGRAM_STATE_VAR) {
- enum register_file file;
+ gl_register_file file;
/* If we're referencing the Program->Parameters[] array, check if the
* parameter is really a constant/literal. If so, set File to CONSTANT.
struct arb_program *program,
struct prog_src_register *reg)
{
- enum register_file file;
+ gl_register_file file;
GLint index;
GLubyte negateMask;
GLubyte swizzle[4];
struct arb_program *program,
struct prog_src_register *reg)
{
- enum register_file file;
+ gl_register_file file;
GLint index;
GLubyte negateMask;
GLubyte swizzle[4];
{
GLint mask;
GLuint idx;
- enum register_file file;
+ gl_register_file file;
if (parse_masked_dst_reg (ctx, inst, vc_head, program, &file, &idx, &mask))
return 1;
{
GLubyte swizzle[4];
GLubyte negateMask;
- enum register_file file;
+ gl_register_file file;
GLint index;
if (parse_src_reg(ctx, inst, vc_head, Program, &file, &index, &rel))
GLubyte swizzle[4];
GLubyte negateMask;
GLboolean relAddr;
- enum register_file file;
+ gl_register_file file;
GLint index;
if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg))
extern void
-_mesa_get_program_register(GLcontext *ctx, enum register_file file,
+_mesa_get_program_register(GLcontext *ctx, gl_register_file file,
GLuint index, GLfloat val[4]);
extern GLboolean
*/
GLint
_mesa_add_parameter(struct gl_program_parameter_list *paramList,
- enum register_file type, const char *name,
+ gl_register_file type, const char *name,
GLuint size, GLenum datatype, const GLfloat *values,
const gl_state_index state[STATE_LENGTH],
GLbitfield flags)
*/
GLuint
_mesa_longest_parameter_name(const struct gl_program_parameter_list *list,
- enum register_file type)
+ gl_register_file type)
{
GLuint i, maxLen = 0;
if (!list)
*/
GLuint
_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list,
- enum register_file type)
+ gl_register_file type)
{
GLuint i, count = 0;
if (list) {
struct gl_program_parameter
{
const char *Name; /**< Null-terminated string */
- enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */
+ gl_register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */
GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */
GLuint Size; /**< Number of components (1..4) */
GLboolean Used; /**< Helper flag for GLSL uniform tracking */
extern GLint
_mesa_add_parameter(struct gl_program_parameter_list *paramList,
- enum register_file type, const char *name,
+ gl_register_file type, const char *name,
GLuint size, GLenum datatype, const GLfloat *values,
const gl_state_index state[STATE_LENGTH],
GLbitfield flags);
extern GLuint
_mesa_longest_parameter_name(const struct gl_program_parameter_list *list,
- enum register_file type);
+ gl_register_file type);
extern GLuint
_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list,
- enum register_file type);
+ gl_register_file type);
#endif /* PROG_PARAMETER_H */
* Return string name for given program/register file.
*/
static const char *
-file_string(enum register_file f, gl_prog_print_mode mode)
+file_string(gl_register_file f, gl_prog_print_mode mode)
{
switch (f) {
case PROGRAM_TEMPORARY:
* \param prog pointer to containing program
*/
static const char *
-reg_string(enum register_file f, GLint index, gl_prog_print_mode mode,
+reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
GLboolean relAddr, const struct gl_program *prog)
{
static char str[100];
const struct gl_program *prog)
{
_mesa_fprintf(f, "%s%s",
- reg_string((enum register_file) dstReg->File,
+ reg_string((gl_register_file) dstReg->File,
dstReg->Index, mode, dstReg->RelAddr, prog),
_mesa_writemask_string(dstReg->WriteMask));
#if 0
_mesa_fprintf(f, "%s[%d]%s",
- file_string((enum register_file) dstReg->File, mode),
+ file_string((gl_register_file) dstReg->File, mode),
dstReg->Index,
_mesa_writemask_string(dstReg->WriteMask));
#endif
_mesa_fprintf(f, "%s%s%s%s",
abs,
- reg_string((enum register_file) srcReg->File,
+ reg_string((gl_register_file) srcReg->File,
srcReg->Index, mode, srcReg->RelAddr, prog),
_mesa_swizzle_string(srcReg->Swizzle,
srcReg->NegateBase, GL_FALSE),
abs);
#if 0
_mesa_fprintf(f, "%s[%d]%s",
- file_string((enum register_file) srcReg->File, mode),
+ file_string((gl_register_file) srcReg->File, mode),
srcReg->Index,
_mesa_swizzle_string(srcReg->Swizzle,
srcReg->NegateBase, GL_FALSE));
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
_mesa_fprintf(f, ", ");
_mesa_fprintf(f, "%s[%d]%s",
- file_string((enum register_file) inst->SrcReg[0].File,
+ file_string((gl_register_file) inst->SrcReg[0].File,
mode),
inst->SrcReg[0].Index,
_mesa_swizzle_string(inst->SrcReg[0].Swizzle,
_mesa_fprintf(f, " ");
fprint_dst_reg(f, &inst->DstReg, mode, prog);
_mesa_fprintf(f, ", %s[%d], %s",
- file_string((enum register_file) inst->SrcReg[0].File,
+ file_string((gl_register_file) inst->SrcReg[0].File,
mode),
inst->SrcReg[0].Index,
_mesa_swizzle_string(inst->SrcReg[0].Swizzle,
* So, rewrite the program to use a temporary register in this case.
*/
void
-_mesa_remove_output_reads(struct gl_program *prog, enum register_file type)
+_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type)
{
GLuint i;
GLint outputMap[VERT_RESULT_MAX];
_mesa_count_texture_instructions(struct gl_program *prog);
extern void
-_mesa_remove_output_reads(struct gl_program *prog, enum register_file type);
+_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type);
#endif /* PROGRAMOPT_H */
slang_ir_node *varDecl, *n;
slang_ir_storage *store;
GLint arrayLen, size, totalSize; /* if array then totalSize > size */
- enum register_file file;
+ gl_register_file file;
/*assert(!var->declared);*/
var->declared = GL_TRUE;
static struct prog_instruction *
emit_arl_load(slang_emit_info *emitInfo,
- enum register_file file, GLint index, GLuint swizzle)
+ gl_register_file file, GLint index, GLuint swizzle)
{
struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ARL);
inst->SrcReg[0].File = file;
void
_slang_init_ir_storage(slang_ir_storage *st,
- enum register_file file, GLint index, GLint size,
+ gl_register_file file, GLint index, GLint size,
GLuint swizzle)
{
st->File = file;
* Return a new slang_ir_storage object.
*/
slang_ir_storage *
-_slang_new_ir_storage(enum register_file file, GLint index, GLint size)
+_slang_new_ir_storage(gl_register_file file, GLint index, GLint size)
{
slang_ir_storage *st;
st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage));
* Return a new slang_ir_storage object.
*/
slang_ir_storage *
-_slang_new_ir_storage_swz(enum register_file file, GLint index, GLint size,
+_slang_new_ir_storage_swz(gl_register_file file, GLint index, GLint size,
GLuint swizzle)
{
slang_ir_storage *st;
slang_ir_storage *
-_slang_new_ir_storage_indirect(enum register_file file,
+_slang_new_ir_storage_indirect(gl_register_file file,
GLint index,
GLint size,
- enum register_file indirectFile,
+ gl_register_file indirectFile,
GLint indirectIndex,
GLuint indirectSwizzle)
{
*/
struct slang_ir_storage_
{
- enum register_file File; /**< PROGRAM_TEMPORARY, PROGRAM_INPUT, etc */
+ gl_register_file File; /**< PROGRAM_TEMPORARY, PROGRAM_INPUT, etc */
GLint Index; /**< -1 means unallocated */
GLint Size; /**< number of floats or ints */
GLuint Swizzle; /**< Swizzle AND writemask info */
GLboolean RelAddr; /* we'll remove this eventually */
GLboolean IsIndirect;
- enum register_file IndirectFile;
+ gl_register_file IndirectFile;
GLint IndirectIndex;
GLuint IndirectSwizzle;
GLuint TexTarget; /**< If File==PROGRAM_SAMPLER, one of TEXTURE_x_INDEX */
extern void
_slang_init_ir_storage(slang_ir_storage *st,
- enum register_file file, GLint index, GLint size,
+ gl_register_file file, GLint index, GLint size,
GLuint swizzle);
extern slang_ir_storage *
-_slang_new_ir_storage(enum register_file file, GLint index, GLint size);
+_slang_new_ir_storage(gl_register_file file, GLint index, GLint size);
extern slang_ir_storage *
-_slang_new_ir_storage_swz(enum register_file file, GLint index, GLint size,
+_slang_new_ir_storage_swz(gl_register_file file, GLint index, GLint size,
GLuint swizzle);
extern slang_ir_storage *
extern slang_ir_storage *
-_slang_new_ir_storage_indirect(enum register_file file,
+_slang_new_ir_storage_indirect(gl_register_file file,
GLint index,
GLint size,
- enum register_file indirectFile,
+ gl_register_file indirectFile,
GLint indirectIndex,
GLuint indirectSwizzle);
*/
static GLuint
map_register_file(
- enum register_file file,
+ gl_register_file file,
GLuint index,
const GLuint immediateMapping[],
GLboolean indirectAccess )