class function_entry *function; /* Set on OPCODE_CAL or OPCODE_BGNSUB */
};
-class temp_entry : public exec_node {
+class variable_storage : public exec_node {
public:
- temp_entry(ir_variable *var, int file, int index)
+ variable_storage(ir_variable *var, int file, int index)
: file(file), index(index), var(var)
{
/* empty */
int next_temp;
- temp_entry *find_variable_storage(ir_variable *var);
+ variable_storage *find_variable_storage(ir_variable *var);
function_entry *get_function_signature(ir_function_signature *sig);
struct ir_to_mesa_src_reg result;
- /** List of temp_entry */
- exec_list variable_storage;
+ /** List of variable_storage */
+ exec_list variables;
/** List of function_entry */
exec_list function_signatures;
return src_reg;
}
-temp_entry *
+variable_storage *
ir_to_mesa_visitor::find_variable_storage(ir_variable *var)
{
- temp_entry *entry;
+ variable_storage *entry;
- foreach_iter(exec_list_iterator, iter, this->variable_storage) {
- entry = (temp_entry *)iter.get();
+ foreach_iter(exec_list_iterator, iter, this->variables) {
+ entry = (variable_storage *)iter.get();
if (entry->var == var)
return entry;
return base_pos;
}
-static temp_entry *
+static variable_storage *
get_builtin_matrix_ref(void *mem_ctx, struct gl_program *prog, ir_variable *var,
ir_rvalue *array_index)
{
};
unsigned int i;
- temp_entry *entry;
+ variable_storage *entry;
/* C++ gets angry when we try to use an int as a gl_state_index, so we use
* ints for gl_state_index. Make sure they're compatible.
}
tokens[4] = matrices[i].modifier;
- entry = new(mem_ctx) temp_entry(var,
- PROGRAM_STATE_VAR,
- base_pos);
+ entry = new(mem_ctx) variable_storage(var,
+ PROGRAM_STATE_VAR,
+ base_pos);
return entry;
}
ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
{
ir_to_mesa_src_reg src_reg;
- temp_entry *entry = find_variable_storage(ir->var);
+ variable_storage *entry = find_variable_storage(ir->var);
unsigned int loc;
if (!entry) {
ir->var->type->gl_type);
map_sampler(ir->var->location, sampler);
- entry = new(mem_ctx) temp_entry(ir->var, PROGRAM_SAMPLER, sampler);
- this->variable_storage.push_tail(entry);
+ entry = new(mem_ctx) variable_storage(ir->var, PROGRAM_SAMPLER,
+ sampler);
+ this->variables.push_tail(entry);
break;
}
*/
this->prog->Parameters->Parameters[loc].Used = GL_TRUE;
- entry = new(mem_ctx) temp_entry(ir->var, PROGRAM_UNIFORM, loc);
- this->variable_storage.push_tail(entry);
+ entry = new(mem_ctx) variable_storage(ir->var, PROGRAM_UNIFORM, loc);
+ this->variables.push_tail(entry);
break;
case ir_var_in:
case ir_var_out:
assert(ir->var->location != -1);
if (ir->var->mode == ir_var_in ||
ir->var->mode == ir_var_inout) {
- entry = new(mem_ctx) temp_entry(ir->var,
- PROGRAM_INPUT,
- ir->var->location);
+ entry = new(mem_ctx) variable_storage(ir->var,
+ PROGRAM_INPUT,
+ ir->var->location);
if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
ir->var->location >= VERT_ATTRIB_GENERIC0) {
ir->var->location - VERT_ATTRIB_GENERIC0);
}
} else {
- entry = new(mem_ctx) temp_entry(ir->var,
- PROGRAM_OUTPUT,
- ir->var->location);
+ entry = new(mem_ctx) variable_storage(ir->var,
+ PROGRAM_OUTPUT,
+ ir->var->location);
}
break;
case ir_var_auto:
- entry = new(mem_ctx) temp_entry(ir->var, PROGRAM_TEMPORARY,
- this->next_temp);
- this->variable_storage.push_tail(entry);
+ entry = new(mem_ctx) variable_storage(ir->var, PROGRAM_TEMPORARY,
+ this->next_temp);
+ this->variables.push_tail(entry);
next_temp += type_size(ir->var->type);
break;
"gl_TextureMatrix",
strlen("gl_TextureMatrix")) == 0) {
ir_to_mesa_src_reg src_reg;
- struct temp_entry *entry;
+ struct variable_storage *entry;
entry = get_builtin_matrix_ref(this->mem_ctx, this->prog, deref_var->var,
ir->array_index);
/* Allocate storage for all the parameters. */
foreach_iter(exec_list_iterator, iter, sig->parameters) {
ir_variable *param = (ir_variable *)iter.get();
- temp_entry *storage;
+ variable_storage *storage;
storage = find_variable_storage(param);
assert(!storage);
- storage = new(mem_ctx) temp_entry(param, PROGRAM_TEMPORARY,
- this->next_temp);
- this->variable_storage.push_tail(storage);
+ storage = new(mem_ctx) variable_storage(param, PROGRAM_TEMPORARY,
+ this->next_temp);
+ this->variables.push_tail(storage);
this->next_temp += type_size(param->type);
break;
if (param->mode == ir_var_in ||
param->mode == ir_var_inout) {
- temp_entry *storage = find_variable_storage(param);
+ variable_storage *storage = find_variable_storage(param);
assert(storage);
param_rval->accept(this);
if (param->mode == ir_var_out ||
param->mode == ir_var_inout) {
- temp_entry *storage = find_variable_storage(param);
+ variable_storage *storage = find_variable_storage(param);
assert(storage);
ir_to_mesa_src_reg r;