Where MI_BATCH_BUFFER_END is recorded.
Signed-off-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/2371>
* with our BATCH_BUFFER_END in another BO.
*/
cmd_buffer->batch.end += GEN8_MI_BATCH_BUFFER_START_length * 4;
+ assert(cmd_buffer->batch.start == batch_bo->bo->map);
assert(cmd_buffer->batch.end == batch_bo->bo->map + batch_bo->bo->size);
+ /* Save end instruction location to override it later. */
+ cmd_buffer->batch_end = cmd_buffer->batch.next;
+
anv_batch_emit(&cmd_buffer->batch, GEN8_MI_BATCH_BUFFER_END, bbe);
/* Round batch up to an even number of dwords. */
struct anv_batch batch;
+ /* Pointer to the location in the batch where MI_BATCH_BUFFER_END was
+ * recorded upon calling vkEndCommandBuffer(). This is useful if we need to
+ * rewrite the end to chain multiple batch together at vkQueueSubmit().
+ */
+ void * batch_end;
+
/* Fields required for the actual chain of anv_batch_bo's.
*
* These fields are initialized by anv_cmd_buffer_init_batch_bo_chain().