summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-03-10 15:54:28 -0600
committerBrian Paul <brianp@vmware.com>2009-03-10 18:27:48 -0600
commit76ff6d40f489f845ddf2ef33a3e5570f4544b7e9 (patch)
tree79d5980f371d15fda6c9743050c429a11f0a79d9 /src/mesa/drivers/dri
parent9c781de015f32b2caadd5a6d999cc6885188a4a4 (diff)
i965: minor code clean-ups, comments
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_glsl.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
index ac7de6f95b..b37c51b329 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
@@ -189,21 +189,23 @@ static void prealloc_reg(struct brw_wm_compile *c)
/* constants */
{
- int nr_params = c->fp->program.Base.Parameters->NumParameters;
- struct gl_program_parameter_list *plist =
+ const int nr_params = c->fp->program.Base.Parameters->NumParameters;
+ const struct gl_program_parameter_list *plist =
c->fp->program.Base.Parameters;
int index = 0;
- c->prog_data.nr_params = 4*nr_params;
+
+ c->prog_data.nr_params = 4 * nr_params;
for (i = 0; i < nr_params; i++) {
- for (j = 0; j < 4; j++, index++) {
- reg = brw_vec1_grf(c->reg_index + index/8,
- index%8);
- c->prog_data.param[index] =
- &plist->ParameterValues[i][j];
- set_reg(c, PROGRAM_STATE_VAR, i, j, reg);
+ for (j = 0; j < 4; j++, index++) {
+ reg = brw_vec1_grf(c->reg_index + index/8, index%8);
+ /* Save pointer to parameter/constant value.
+ * Constants will be copied in prepare_constant_buffer()
+ */
+ c->prog_data.param[index] = &plist->ParameterValues[i][j];
+ set_reg(c, PROGRAM_STATE_VAR, i, j, reg);
}
}
- c->nr_creg = 2*((4*nr_params+15)/16);
+ c->nr_creg = 2 * ((4 * nr_params + 15) / 16);
c->reg_index += c->nr_creg;
}