aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-08-14 20:18:24 -0700
committerKenneth Graunke <[email protected]>2013-08-19 13:17:00 -0700
commite197f5373037a972244e15b8453007dd165b9b35 (patch)
tree3a4f354dc7e3dfa6bda5bf6eb1ac134229b0bed7
parent7e9559c9ba4dd82aca83b08d039103e38a3f94be (diff)
i965: Make the VS binding table as small as possible.
For some reason, we didn't use this information even though the VS backend has computed it (albeit poorly) for ages. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_surface_state.c7
1 files changed, 4 insertions, 3 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 2c2d713b98c..4577e769122 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -145,7 +145,8 @@ brw_vs_upload_binding_table(struct brw_context *brw)
/* CACHE_NEW_VS_PROG: Skip making a binding table if we don't use textures or
* pull constants.
*/
- if (brw->vs.prog_data->base.binding_table_size == 0) {
+ const unsigned entries = brw->vs.prog_data->base.binding_table_size;
+ if (entries == 0) {
if (brw->vs.bind_bo_offset != 0) {
brw->state.dirty.brw |= BRW_NEW_VS_BINDING_TABLE;
brw->vs.bind_bo_offset = 0;
@@ -157,11 +158,11 @@ brw_vs_upload_binding_table(struct brw_context *brw)
* space for the binding table.
*/
bind = brw_state_batch(brw, AUB_TRACE_BINDING_TABLE,
- sizeof(uint32_t) * BRW_MAX_VS_SURFACES,
+ sizeof(uint32_t) * entries,
32, &brw->vs.bind_bo_offset);
/* BRW_NEW_SURFACES and BRW_NEW_VS_CONSTBUF */
- for (i = 0; i < BRW_MAX_VS_SURFACES; i++) {
+ for (i = 0; i < entries; i++) {
bind[i] = brw->vs.surf_offset[i];
}