vulkan/runtime: Add emulated secondary command buffer support

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
This commit is contained in:
Jason Ekstrand
2022-03-08 17:50:09 -06:00
committed by Marge Bot
parent 25542f12d7
commit df92f56d8d
2 changed files with 27 additions and 1 deletions
+18
View File
@@ -24,6 +24,8 @@
#include "vk_command_buffer.h"
#include "vk_command_pool.h"
#include "vk_common_entrypoints.h"
#include "vk_device.h"
VkResult
vk_command_buffer_init(struct vk_command_buffer *command_buffer,
@@ -63,3 +65,19 @@ vk_command_buffer_finish(struct vk_command_buffer *command_buffer)
util_dynarray_fini(&command_buffer->labels);
vk_object_base_finish(&command_buffer->base);
}
VKAPI_ATTR void VKAPI_CALL
vk_common_CmdExecuteCommands(VkCommandBuffer commandBuffer,
uint32_t commandBufferCount,
const VkCommandBuffer *pCommandBuffers)
{
VK_FROM_HANDLE(vk_command_buffer, primary, commandBuffer);
const struct vk_device_dispatch_table *disp =
primary->base.device->command_dispatch_table;
for (uint32_t i = 0; i < commandBufferCount; i++) {
VK_FROM_HANDLE(vk_command_buffer, secondary, pCommandBuffers[i]);
vk_cmd_queue_execute(&secondary->cmd_queue, commandBuffer, disp);
}
}