i965/fs: Remove the param_index/param_offset indirection.

Now that ParameterValues doesn't change across the visitor, we don't
need to go through this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Eric Anholt
2012-11-20 16:26:22 -08:00
parent d5efc14635
commit f189570ccf
4 changed files with 10 additions and 46 deletions
+4 -30
View File
@@ -815,10 +815,8 @@ fs_visitor::setup_uniform_values(int loc, const glsl_type *type)
case GLSL_TYPE_INT:
case GLSL_TYPE_BOOL:
for (unsigned int i = 0; i < type->vector_elements; i++) {
unsigned int param = c->prog_data.nr_params++;
this->param_index[param] = loc;
this->param_offset[param] = i;
c->prog_data.param[c->prog_data.nr_params++] =
&fp->Base.Parameters->ParameterValues[loc][i].f;
}
return 1;
@@ -874,9 +872,8 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir)
break;
last_swiz = swiz;
this->param_index[c->prog_data.nr_params] = index;
this->param_offset[c->prog_data.nr_params] = swiz;
c->prog_data.nr_params++;
c->prog_data.param[c->prog_data.nr_params++] =
&fp->Base.Parameters->ParameterValues[index][swiz].f;
}
}
}
@@ -1179,25 +1176,6 @@ fs_visitor::emit_math(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1)
return inst;
}
/**
* To be called after the last _mesa_add_state_reference() call, to
* set up prog_data.param[] for assign_curb_setup() and
* setup_pull_constants().
*/
void
fs_visitor::setup_paramvalues_refs()
{
if (dispatch_width != 8)
return;
/* Set up the pointers to ParamValues now that that array is finalized. */
for (unsigned int i = 0; i < c->prog_data.nr_params; i++) {
c->prog_data.param[i] =
(const float *)fp->Base.Parameters->ParameterValues[this->param_index[i]] +
this->param_offset[i];
}
}
void
fs_visitor::assign_curb_setup()
{
@@ -1528,9 +1506,6 @@ fs_visitor::remove_dead_constants()
if (remapped == -1)
continue;
/* We've already done setup_paramvalues_refs() so no need to worry
* about param_index and param_offset.
*/
c->prog_data.param[remapped] = c->prog_data.param[i];
}
@@ -2506,7 +2481,6 @@ fs_visitor::run()
split_virtual_grfs();
setup_paramvalues_refs();
move_uniform_array_access_to_pull_constants();
setup_pull_constants();
-6
View File
@@ -296,7 +296,6 @@ public:
bool run();
void setup_payload_gen4();
void setup_payload_gen6();
void setup_paramvalues_refs();
void assign_curb_setup();
void calculate_urb_setup();
void assign_urb_setup();
@@ -419,11 +418,6 @@ public:
struct brw_wm_compile *c;
unsigned int sanity_param_count;
/* Delayed setup of c->prog_data.params[] due to realloc of
* ParamValues[] during compile.
*/
int param_index[MAX_UNIFORMS * 4];
int param_offset[MAX_UNIFORMS * 4];
int param_size[MAX_UNIFORMS * 4];
int *virtual_grf_sizes;
+2 -3
View File
@@ -596,9 +596,8 @@ fs_visitor::setup_fp_regs()
for (unsigned p = 0;
p < fp->Base.Parameters->NumParameters; p++) {
for (unsigned int i = 0; i < 4; i++) {
this->param_index[c->prog_data.nr_params] = p;
this->param_offset[c->prog_data.nr_params] = i;
c->prog_data.nr_params++;
c->prog_data.param[c->prog_data.nr_params++] =
&fp->Base.Parameters->ParameterValues[p][i].f;
}
}
}
+4 -7
View File
@@ -1220,13 +1220,10 @@ fs_visitor::rescale_texcoord(ir_texture *ir, fs_reg coordinate,
GLuint index = _mesa_add_state_reference(params,
(gl_state_index *)tokens);
this->param_index[c->prog_data.nr_params] = index;
this->param_offset[c->prog_data.nr_params] = 0;
c->prog_data.nr_params++;
this->param_index[c->prog_data.nr_params] = index;
this->param_offset[c->prog_data.nr_params] = 1;
c->prog_data.nr_params++;
c->prog_data.param[c->prog_data.nr_params++] =
&fp->Base.Parameters->ParameterValues[index][0].f;
c->prog_data.param[c->prog_data.nr_params++] =
&fp->Base.Parameters->ParameterValues[index][1].f;
}
/* The 965 requires the EU to do the normalization of GL rectangle