diff options
author | Kenneth Graunke <[email protected]> | 2013-08-14 19:54:25 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-08-19 13:17:00 -0700 |
commit | 60689c05d1f69610b3daac1c9f407c75ebecc81b (patch) | |
tree | 27e515c664ae47f01e6221be1f741697e802be37 /src/mesa | |
parent | 6d89bc803d83d27d8946afdd2f749334a41a9d1f (diff) |
i965/fs: Make the FS binding table as small as possible.
Computing the minimum size was easy, and done at compile-time for no
extra overhead here. Making the binding table smaller wastes less batch
space.
Adding the CACHE_NEW_WM_PROG dirty bit isn't strictly necessary, since
other atoms depend on it and flag BRW_NEW_SURFACES. However, it's best
to add it for clarity and safety. It shouldn't add any new overhead.
v2: Use binding_table_size, rather than max_surface_index.
Signed-off-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 16579f946ef..e2c7b77472d 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -873,15 +873,14 @@ brw_upload_wm_binding_table(struct brw_context *brw) gen7_create_shader_time_surface(brw, &brw->wm.surf_offset[SURF_INDEX_WM_SHADER_TIME]); } - /* Might want to calculate nr_surfaces first, to avoid taking up so much - * space for the binding table. - */ + /* CACHE_NEW_WM_PROG */ + unsigned entries = brw->wm.prog_data->binding_table_size; bind = brw_state_batch(brw, AUB_TRACE_BINDING_TABLE, - sizeof(uint32_t) * BRW_MAX_WM_SURFACES, + sizeof(uint32_t) * entries, 32, &brw->wm.bind_bo_offset); /* BRW_NEW_SURFACES */ - for (i = 0; i < BRW_MAX_WM_SURFACES; i++) { + for (i = 0; i < entries; i++) { bind[i] = brw->wm.surf_offset[i]; } @@ -893,7 +892,7 @@ const struct brw_tracked_state brw_wm_binding_table = { .mesa = 0, .brw = (BRW_NEW_BATCH | BRW_NEW_SURFACES), - .cache = 0 + .cache = CACHE_NEW_WM_PROG }, .emit = brw_upload_wm_binding_table, }; |