anv: add helper to get current address of a batch

And allow the function to get the very first address in the batch.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
This commit is contained in:
Lionel Landwerlin
2022-02-26 21:58:35 +02:00
committed by Marge Bot
parent c9272e80b1
commit 8d21e29be3

View File

@@ -1462,6 +1462,12 @@ VkResult anv_batch_emit_ensure_space(struct anv_batch *batch, uint32_t size);
void anv_batch_emit_batch(struct anv_batch *batch, struct anv_batch *other);
struct anv_address anv_batch_address(struct anv_batch *batch, void *batch_location);
static inline struct anv_address
anv_batch_current_address(struct anv_batch *batch)
{
return anv_batch_address(batch, batch->next);
}
static inline void
anv_batch_set_storage(struct anv_batch *batch, struct anv_address addr,
void *map, size_t size)