blorp: Add a binding_table_offset_to_pointer helper
On Gen11+, we have a feature that requires us to shift binding table offsets by 3. This adds a helper which gives the driver a hook to do this if it so chooses. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14507>
This commit is contained in:
parent
3c3a8f853d
commit
a83c91a261
|
@ -190,6 +190,13 @@ blorp_alloc_binding_table(struct blorp_batch *blorp_batch,
|
|||
}
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
blorp_binding_table_offset_to_pointer(struct blorp_batch *batch,
|
||||
uint32_t offset)
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void *
|
||||
blorp_alloc_vertex_buffer(struct blorp_batch *blorp_batch,
|
||||
uint32_t size,
|
||||
|
|
|
@ -177,6 +177,13 @@ blorp_alloc_binding_table(struct blorp_batch *blorp_batch,
|
|||
batch->screen->vtbl.update_surface_base_address(batch, binder);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
blorp_binding_table_offset_to_pointer(struct blorp_batch *batch,
|
||||
uint32_t offset)
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void *
|
||||
blorp_alloc_vertex_buffer(struct blorp_batch *blorp_batch,
|
||||
uint32_t size,
|
||||
|
|
|
@ -90,6 +90,10 @@ blorp_alloc_binding_table(struct blorp_batch *batch, unsigned num_entries,
|
|||
uint32_t *bt_offset, uint32_t *surface_offsets,
|
||||
void **surface_maps);
|
||||
|
||||
static uint32_t
|
||||
blorp_binding_table_offset_to_pointer(struct blorp_batch *batch,
|
||||
uint32_t offset);
|
||||
|
||||
static void
|
||||
blorp_flush_range(struct blorp_batch *batch, void *start, size_t size);
|
||||
|
||||
|
@ -1662,16 +1666,19 @@ blorp_emit_btp(struct blorp_batch *batch, uint32_t bind_offset)
|
|||
blorp_emit(batch, GENX(3DSTATE_BINDING_TABLE_POINTERS_GS), bt);
|
||||
|
||||
blorp_emit(batch, GENX(3DSTATE_BINDING_TABLE_POINTERS_PS), bt) {
|
||||
bt.PointertoPSBindingTable = bind_offset;
|
||||
bt.PointertoPSBindingTable =
|
||||
blorp_binding_table_offset_to_pointer(batch, bind_offset);
|
||||
}
|
||||
#elif GFX_VER >= 6
|
||||
blorp_emit(batch, GENX(3DSTATE_BINDING_TABLE_POINTERS), bt) {
|
||||
bt.PSBindingTableChange = true;
|
||||
bt.PointertoPSBindingTable = bind_offset;
|
||||
bt.PointertoPSBindingTable =
|
||||
blorp_binding_table_offset_to_pointer(batch, bind_offset);
|
||||
}
|
||||
#else
|
||||
blorp_emit(batch, GENX(3DSTATE_BINDING_TABLE_POINTERS), bt) {
|
||||
bt.PointertoPSBindingTable = bind_offset;
|
||||
bt.PointertoPSBindingTable =
|
||||
blorp_binding_table_offset_to_pointer(batch, bind_offset);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -195,6 +195,13 @@ blorp_alloc_binding_table(struct blorp_batch *batch, unsigned num_entries,
|
|||
}
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
blorp_binding_table_offset_to_pointer(struct blorp_batch *batch,
|
||||
uint32_t offset)
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void *
|
||||
blorp_alloc_vertex_buffer(struct blorp_batch *batch, uint32_t size,
|
||||
struct blorp_address *addr)
|
||||
|
|
Loading…
Reference in New Issue