nvk: Flush pushbufs in EndCommandBuffer()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33959>
This commit is contained in:
Faith Ekstrand
2025-03-08 20:35:07 -06:00
parent fac856112e
commit c04dacb42c
+15 -1
View File
@@ -370,6 +370,13 @@ nvk_BeginCommandBuffer(VkCommandBuffer commandBuffer,
return VK_SUCCESS;
}
static void
flush_mem_list(struct nvk_cmd_buffer *cmd, struct list_head *mem_list)
{
list_for_each_entry_safe(struct nvk_cmd_mem, mem, mem_list, link)
nvkmd_mem_sync_map_to_gpu(mem->mem, 0, mem->mem->size_B);
}
VKAPI_ATTR VkResult VKAPI_CALL
nvk_EndCommandBuffer(VkCommandBuffer commandBuffer)
{
@@ -377,6 +384,13 @@ nvk_EndCommandBuffer(VkCommandBuffer commandBuffer)
nvk_cmd_buffer_flush_push(cmd, false);
/* We only need to flush the memory objects we own because, if there are
* secondaries, they will have been flushed in their EndCommandBuffer()
* call.
*/
flush_mem_list(cmd, &cmd->owned_mem);
flush_mem_list(cmd, &cmd->owned_gart_mem);
return vk_command_buffer_get_record_result(&cmd->vk);
}
@@ -1267,4 +1281,4 @@ nvk_CmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer,
.pipeline_location = vk_stage_flags_to_nv9097_pipeline_location(stage),
.structure_size = STRUCTURE_SIZE_ONE_WORD,
});
}
}