[Mesa-dev] [RFC PATCH 10/40] i965/blorp: Update hw-binding table entries for blorp.
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Sun Jan 4 06:04:24 PST 2015
Update the hw-generated binding table for blorp SURFACE_STATE entries.
Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
src/mesa/drivers/dri/i965/gen6_blorp.cpp | 35 ++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
index d4aa955..8e78450 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
@@ -428,15 +428,32 @@ gen6_blorp_emit_binding_table(struct brw_context *brw,
uint32_t wm_surf_offset_texture)
{
uint32_t wm_bind_bo_offset;
- uint32_t *bind = (uint32_t *)
- brw_state_batch(brw, AUB_TRACE_BINDING_TABLE,
- sizeof(uint32_t) *
- BRW_BLORP_NUM_BINDING_TABLE_ENTRIES,
- 32, /* alignment */
- &wm_bind_bo_offset);
- bind[BRW_BLORP_RENDERBUFFER_BINDING_TABLE_INDEX] =
- wm_surf_offset_renderbuffer;
- bind[BRW_BLORP_TEXTURE_BINDING_TABLE_INDEX] = wm_surf_offset_texture;
+ uint32_t *bind;
+
+ if (brw->hw_bt_pool.bo && brw->has_resource_streamer) {
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_BINDING_TABLE_EDIT_PS << 16 | (4 - 2));
+ OUT_BATCH(0x3);
+ {
+ OUT_BATCH(BRW_BLORP_RENDERBUFFER_BINDING_TABLE_INDEX << 16 |
+ (wm_surf_offset_renderbuffer >> 5));
+ OUT_BATCH(BRW_BLORP_TEXTURE_BINDING_TABLE_INDEX << 16 |
+ (wm_surf_offset_texture >> 5));
+ }
+ ADVANCE_BATCH();
+ wm_bind_bo_offset = brw->hw_bt_pool.next_offset;
+ brw->hw_bt_pool.next_offset += (256 * sizeof(uint16_t));
+ } else {
+ bind = (uint32_t *)
+ brw_state_batch(brw, AUB_TRACE_BINDING_TABLE,
+ sizeof(uint32_t) *
+ BRW_BLORP_NUM_BINDING_TABLE_ENTRIES,
+ 32, /* alignment */
+ &wm_bind_bo_offset);
+ bind[BRW_BLORP_RENDERBUFFER_BINDING_TABLE_INDEX] =
+ wm_surf_offset_renderbuffer;
+ bind[BRW_BLORP_TEXTURE_BINDING_TABLE_INDEX] = wm_surf_offset_texture;
+ }
return wm_bind_bo_offset;
}
--
1.9.1
More information about the mesa-dev
mailing list