[Mesa-dev] [RFC PATCH 09/40] i965/gen7.5: Upload binding tables as hw-generated binding table format.
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Sun Jan 4 06:04:23 PST 2015
When hardware-generated binding tables are enabled, use the hw-generated
binding table format when uploading binding table state.
Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
src/mesa/drivers/dri/i965/brw_binding_tables.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_binding_tables.c b/src/mesa/drivers/dri/i965/brw_binding_tables.c
index e853aac..d97b3d9 100644
--- a/src/mesa/drivers/dri/i965/brw_binding_tables.c
+++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c
@@ -71,7 +71,12 @@ brw_upload_binding_table(struct brw_context *brw,
return;
stage_state->bind_bo_offset = 0;
- } else {
+ }
+
+ /* If resource streamer is enabled, skip manual binding table upload */
+ if (!brw->hw_bt_pool.bo) {
+ /* CACHE_NEW_*_PROG */
+
/* Upload a new binding table. */
if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
brw->vtbl.create_raw_surface(
@@ -86,15 +91,26 @@ brw_upload_binding_table(struct brw_context *brw,
/* BRW_NEW_SURFACES and BRW_NEW_*_CONSTBUF */
memcpy(bind, stage_state->surf_offset,
prog_data->binding_table.size_bytes);
+ } else {
+ gen7_update_binding_table_from_array(brw, stage_state->stage,
+ stage_state->surf_offset,
+ prog_data->binding_table.size_bytes / 4);
}
brw->state.dirty.brw |= brw_new_binding_table;
if (brw->gen >= 7) {
+
+ if (brw->has_resource_streamer)
+ stage_state->bind_bo_offset = brw->hw_bt_pool.next_offset;
+
BEGIN_BATCH(2);
OUT_BATCH(packet_name << 16 | (2 - 2));
OUT_BATCH(stage_state->bind_bo_offset);
ADVANCE_BATCH();
+
+ if (brw->has_resource_streamer)
+ brw->hw_bt_pool.next_offset += bt_size;
}
}
--
1.9.1
More information about the mesa-dev
mailing list