summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-09-13 14:51:10 -0700
committerKenneth Graunke <[email protected]>2013-09-19 10:52:57 -0700
commit254891b3fcd8ecfcea746f3bae4b274328981201 (patch)
tree4fbaa339ce74cce85f7b822a075b82b04bc428f4 /src/mesa/drivers
parent0532b200f357f335cfaff2c6b0e05282f239ffdf (diff)
i965: Convert loop to memcpy in brw_vec4_upload_binding_table().
This is probably more efficient. At any rate, it's less code. 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_vs_surface_state.c15
1 files changed, 6 insertions, 9 deletions
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 985fd671ca9..216ff4734bc 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -156,9 +156,6 @@ brw_vec4_upload_binding_table(struct brw_context *brw,
struct brw_stage_state *stage_state,
const struct brw_vec4_prog_data *prog_data)
{
- uint32_t *bind;
- int i;
-
if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
gen7_create_shader_time_surface(brw, &stage_state->surf_offset[SURF_INDEX_VEC4_SHADER_TIME]);
}
@@ -173,14 +170,14 @@ brw_vec4_upload_binding_table(struct brw_context *brw,
return;
}
- bind = brw_state_batch(brw, AUB_TRACE_BINDING_TABLE,
- sizeof(uint32_t) * entries,
- 32, &stage_state->bind_bo_offset);
+ size_t table_size_in_bytes = entries * sizeof(uint32_t);
+
+ uint32_t *bind = brw_state_batch(brw, AUB_TRACE_BINDING_TABLE,
+ table_size_in_bytes, 32,
+ &stage_state->bind_bo_offset);
/* BRW_NEW_SURFACES and BRW_NEW_*_CONSTBUF */
- for (i = 0; i < entries; i++) {
- bind[i] = stage_state->surf_offset[i];
- }
+ memcpy(bind, stage_state->surf_offset, table_size_in_bytes);
brw->state.dirty.brw |= brw_new_binding_table;
}