[Mesa-dev] [PATCH 05/27] i965: Upload binding tables in hw-generated binding table format.
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Tue Apr 28 13:08:02 PDT 2015
When hardware-generated binding tables are enabled, use the hw-generated
binding table format when uploading binding table state.
Normally, the CS will will just consume the binding table pointer commands
as pipelined state. When the RS is enabled however, the RS flushes whatever
edited surface state entries of our on-chip binding table to the binding
table pool before passing the command on to the CS.
Note that the the binding table pointer offset is relative to the binding table
pool base address when resource streamer instead of the surface state base address.
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 70b8751..c1d188e 100644
--- a/src/mesa/drivers/dri/i965/brw_binding_tables.c
+++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c
@@ -75,7 +75,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.emit_buffer_surface_state(
@@ -92,15 +97,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->ctx.NewDriverState |= 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 += ALIGN(prog_data->binding_table.size_bytes, 64);
}
}
--
1.9.1
More information about the mesa-dev
mailing list