From 7a86192d3a366fa1ed978088476eafc2a3411dbd Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:11:50 -0600 Subject: [PATCH] nvk: Drop vk_sync BO refs after push_submit Otherwise, all syncs are cumulative and, if the same command buffer is submitted multiple times, it will sync on the union of all syncs it's ever seen. Part-of: --- src/nouveau/vulkan/nvk_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nouveau/vulkan/nvk_device.c b/src/nouveau/vulkan/nvk_device.c index 5d5dd35aa8b..aa1b403d937 100644 --- a/src/nouveau/vulkan/nvk_device.c +++ b/src/nouveau/vulkan/nvk_device.c @@ -144,6 +144,7 @@ nvk_queue_submit(struct vk_queue *vkqueue, struct vk_queue_submit *submission) for (unsigned i = 0; i < submission->command_buffer_count; i++) { struct nvk_cmd_buffer *cmd = (struct nvk_cmd_buffer *)submission->command_buffers[i]; + unsigned real_refs = nouveau_ws_push_num_refs(queue->empty_push); for (uint32_t i = 0; i < submission->signal_count; i++) { struct nvk_bo_sync *bo_sync = container_of(submission->signals[i].sync, struct nvk_bo_sync, sync); nouveau_ws_push_ref(cmd->push, bo_sync->bo, NOUVEAU_WS_BO_RDWR); @@ -152,6 +153,8 @@ nvk_queue_submit(struct vk_queue *vkqueue, struct vk_queue_submit *submission) nouveau_ws_push_submit(cmd->push, device->pdev->dev, device->ctx); if (cmd->reset_on_submit) nvk_reset_cmd_buffer(cmd); + + nouveau_ws_push_reset_refs(queue->empty_push, real_refs); } for (uint32_t i = 0; i < submission->signal_count; i++) {