summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-11-12 14:57:30 -0800
committerEric Anholt <[email protected]>2009-11-13 13:18:57 -0800
commitded0ec1ea5db8e08b0bec8ac0d9d30f98e360003 (patch)
tree545936efee1d8fc5dcbbfed3ae96109e7a30d745 /src/mesa/drivers/dri/i965
parent8e8586e62671e8337c08b086bf7f3c54cc46191d (diff)
i965: Use bo_map instead of subdata to upload the bits of constant buffer.
Saves CPU time, resulting in a 2.5% FPS win on ETQW.
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_surface_state.c7
1 files changed, 5 insertions, 2 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 5dac6329693..3bc9840a971 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -68,10 +68,13 @@ brw_vs_update_constant_buffer(struct brw_context *brw)
*/
_mesa_load_state_parameters(&brw->intel.ctx, vp->program.Base.Parameters);
+ intel_bo_map_gtt_preferred(intel, const_buffer, GL_TRUE);
for (i = 0; i < params->NumParameters; i++) {
- dri_bo_subdata(const_buffer, i * 4 * sizeof(float), 4 * sizeof(float),
- params->ParameterValues[i]);
+ memcpy(const_buffer->virtual + i * 4 * sizeof(float),
+ params->ParameterValues[i],
+ 4 * sizeof(float));
}
+ intel_bo_unmap_gtt_preferred(intel, const_buffer);
return const_buffer;
}