diff options
author | Kenneth Graunke <[email protected]> | 2013-09-13 14:34:48 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-09-16 18:25:07 -0700 |
commit | d385edf4c32bf92daa415d32fc1e70934cfca268 (patch) | |
tree | 7277268818af8a22e970a64889edf7c0372ac87e | |
parent | 24765c58bd7b041f92ff51ec354f5d6b0ce35daa (diff) |
i965: Introduce a prog_data temporary in gen6_upload_wm_push_constants.
This saves a bit of typing and shortens a few lines.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_wm_state.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index af1c044589a..1fa5d95d505 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -41,6 +41,8 @@ gen6_upload_wm_push_constants(struct brw_context *brw) /* BRW_NEW_FRAGMENT_PROGRAM */ const struct brw_fragment_program *fp = brw_fragment_program_const(brw->fragment_program); + /* CACHE_NEW_WM_PROG */ + const struct brw_wm_prog_data *prog_data = brw->wm.prog_data; /* Updates the ParameterValues[i] pointers for all parameters of the * basic type of PROGRAM_STATE_VAR. @@ -48,25 +50,23 @@ gen6_upload_wm_push_constants(struct brw_context *brw) /* XXX: Should this happen somewhere before to get our state flag set? */ _mesa_load_state_parameters(ctx, fp->program.Base.Parameters); - /* CACHE_NEW_WM_PROG */ - if (brw->wm.prog_data->nr_params != 0) { + if (prog_data->nr_params != 0) { float *constants; unsigned int i; constants = brw_state_batch(brw, AUB_TRACE_WM_CONSTANTS, - brw->wm.prog_data->nr_params * - sizeof(float), + prog_data->nr_params * sizeof(float), 32, &brw->wm.base.push_const_offset); - for (i = 0; i < brw->wm.prog_data->nr_params; i++) { - constants[i] = *brw->wm.prog_data->param[i]; + for (i = 0; i < prog_data->nr_params; i++) { + constants[i] = *prog_data->param[i]; } if (0) { printf("WM constants:\n"); - for (i = 0; i < brw->wm.prog_data->nr_params; i++) { + for (i = 0; i < prog_data->nr_params; i++) { if ((i & 7) == 0) - printf("g%d: ", brw->wm.prog_data->first_curbe_grf + i / 8); + printf("g%d: ", prog_data->first_curbe_grf + i / 8); printf("%8f ", constants[i]); if ((i & 7) == 7) printf("\n"); |