Module: Mesa Branch: master Commit: e94c22429b64f419d9a66f04fa5ecdad33f7f5ef URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e94c22429b64f419d9a66f04fa5ecdad33f7f5ef
Author: Marcin Ślusarz <[email protected]> Date: Tue Sep 1 22:02:10 2020 +0200 anv: refresh cached current batch bo after emitting some commands Fixes crashes in: - Rise of the Tomb Rider (on benchmark start) - Total War: Three Kingdoms (on game start) - Total War: Warhammer II (on game start) Fixes: 34a0ce58c7f ("anv: add a new execution mode for secondary command buffers") Signed-off-by: Marcin Ślusarz <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6546> --- src/intel/vulkan/anv_batch_chain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 4aefa58ea1e..ce429ff2d85 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -951,6 +951,11 @@ anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer) .SecondLevelBatchBuffer = Firstlevelbatch) + (GEN8_MI_BATCH_BUFFER_START_BatchBufferStartAddress_start / 8); cmd_buffer->return_addr = anv_batch_address(&cmd_buffer->batch, jump_addr); + + /* The emit above may have caused us to chain batch buffers which + * would mean that batch_bo is no longer valid. + */ + batch_bo = anv_cmd_buffer_current_batch_bo(cmd_buffer); } else if ((cmd_buffer->batch_bos.next == cmd_buffer->batch_bos.prev) && (length < ANV_CMD_BUFFER_BATCH_SIZE / 2)) { /* If the secondary has exactly one batch buffer in its list *and* _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
