diff options
author | Kenneth Graunke <[email protected]> | 2013-09-13 15:13:49 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-09-19 10:52:57 -0700 |
commit | 72340839cae5db8630256f48868d8ce4a526a687 (patch) | |
tree | 86924947f50faa89a8a836dbe0d47ab673af82b3 /src/mesa/drivers | |
parent | 254891b3fcd8ecfcea746f3bae4b274328981201 (diff) |
i965: Generalize brw_vec4_upload_binding_table() beyond vec4 stages.
Instead of passing in a brw_vec4_prog_data structure, we can simply
pass the one field it needs: the number of entries in the binding table.
We also need to pass in the shader time surface index rather than
hardcoding SURF_INDEX_VEC4_SHADER_TIME.
Since the resulting function is stage-agnostic, this patch removes
"vec4_" from the name.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_gs_surface_state.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_state.h | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 21 |
3 files changed, 19 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c index bae60154d45..ad4c0035e8f 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c @@ -106,8 +106,9 @@ brw_gs_upload_binding_table(struct brw_context *brw) const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base; /* BRW_NEW_SURFACES and BRW_NEW_GS_CONSTBUF */ - brw_vec4_upload_binding_table(brw, BRW_NEW_GS_BINDING_TABLE, stage_state, - prog_data); + brw_upload_binding_table(brw, BRW_NEW_GS_BINDING_TABLE, stage_state, + prog_data->binding_table_size, + SURF_INDEX_VEC4_SHADER_TIME); } const struct brw_tracked_state brw_gs_binding_table = { diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 14f5feb0c61..ec64328f38b 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -240,10 +240,11 @@ brw_upload_vec4_pull_constants(struct brw_context *brw, struct brw_stage_state *stage_state, const struct brw_vec4_prog_data *prog_data); void -brw_vec4_upload_binding_table(struct brw_context *brw, - GLbitfield brw_new_binding_table, - struct brw_stage_state *stage_state, - const struct brw_vec4_prog_data *prog_data); +brw_upload_binding_table(struct brw_context *brw, + GLbitfield brw_new_binding_table, + struct brw_stage_state *stage_state, + unsigned binding_table_entries, + int shader_time_surf_index); /* gen7_vs_state.c */ void diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 216ff4734bc..6fbe8ebad25 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -151,18 +151,18 @@ const struct brw_tracked_state brw_vs_ubo_surfaces = { void -brw_vec4_upload_binding_table(struct brw_context *brw, - GLbitfield brw_new_binding_table, - struct brw_stage_state *stage_state, - const struct brw_vec4_prog_data *prog_data) +brw_upload_binding_table(struct brw_context *brw, + GLbitfield brw_new_binding_table, + struct brw_stage_state *stage_state, + unsigned binding_table_entries, + int shader_time_surf_index) { if (INTEL_DEBUG & DEBUG_SHADER_TIME) { - gen7_create_shader_time_surface(brw, &stage_state->surf_offset[SURF_INDEX_VEC4_SHADER_TIME]); + gen7_create_shader_time_surface(brw, &stage_state->surf_offset[shader_time_surf_index]); } /* If there are no surfaces, skip making the binding table altogether. */ - const unsigned entries = prog_data->binding_table_size; - if (entries == 0) { + if (binding_table_entries == 0) { if (stage_state->bind_bo_offset != 0) { brw->state.dirty.brw |= brw_new_binding_table; stage_state->bind_bo_offset = 0; @@ -170,7 +170,7 @@ brw_vec4_upload_binding_table(struct brw_context *brw, return; } - size_t table_size_in_bytes = entries * sizeof(uint32_t); + size_t table_size_in_bytes = binding_table_entries * sizeof(uint32_t); uint32_t *bind = brw_state_batch(brw, AUB_TRACE_BINDING_TABLE, table_size_in_bytes, 32, @@ -195,8 +195,9 @@ brw_vs_upload_binding_table(struct brw_context *brw) const struct brw_vec4_prog_data *prog_data = &brw->vs.prog_data->base; /* BRW_NEW_SURFACES and BRW_NEW_VS_CONSTBUF */ - brw_vec4_upload_binding_table(brw, BRW_NEW_VS_BINDING_TABLE, stage_state, - prog_data); + brw_upload_binding_table(brw, BRW_NEW_VS_BINDING_TABLE, stage_state, + prog_data->binding_table_size, + SURF_INDEX_VEC4_SHADER_TIME); } const struct brw_tracked_state brw_vs_binding_table = { |