[Mesa-dev] [RFC PATCH 10/40] i965/blorp: Update hw-binding table entries for blorp.
Kenneth Graunke
kenneth at whitecape.org
Sun Jan 4 19:44:26 PST 2015
On Sunday, January 04, 2015 04:04:24 PM Abdiel Janulgue wrote:
> 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) {
It seems like checking brw->hw_bt_pool.bo != NULL should be sufficient.
If there's no resource streamer, we shouldn't allocate the buffer.
But I don't think we want to touch BLORP, so it may be moot...
> + 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;
> }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150104/d12d2cfa/attachment.sig>
More information about the mesa-dev
mailing list