vulkan/runtime: Add a vk_cmd_queue object to vk_command_buffer
This is paving the road for generic secondary command buffer support, where commands are simply recorded in a software queue and replayed on the primary command buffer when vkCmdExecuteCommands() is called. Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
This commit is contained in:
parent
ad4d2da90a
commit
6bd8a3c7e4
|
@ -36,6 +36,7 @@ vk_command_buffer_init(struct vk_command_buffer *command_buffer,
|
||||||
|
|
||||||
command_buffer->pool = pool;
|
command_buffer->pool = pool;
|
||||||
command_buffer->level = level;
|
command_buffer->level = level;
|
||||||
|
vk_cmd_queue_init(&command_buffer->cmd_queue, &pool->alloc);
|
||||||
util_dynarray_init(&command_buffer->labels, NULL);
|
util_dynarray_init(&command_buffer->labels, NULL);
|
||||||
command_buffer->region_begin = true;
|
command_buffer->region_begin = true;
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ vk_command_buffer_init(struct vk_command_buffer *command_buffer,
|
||||||
void
|
void
|
||||||
vk_command_buffer_reset(struct vk_command_buffer *command_buffer)
|
vk_command_buffer_reset(struct vk_command_buffer *command_buffer)
|
||||||
{
|
{
|
||||||
|
vk_cmd_queue_reset(&command_buffer->cmd_queue);
|
||||||
util_dynarray_clear(&command_buffer->labels);
|
util_dynarray_clear(&command_buffer->labels);
|
||||||
command_buffer->region_begin = true;
|
command_buffer->region_begin = true;
|
||||||
}
|
}
|
||||||
|
@ -55,6 +57,7 @@ void
|
||||||
vk_command_buffer_finish(struct vk_command_buffer *command_buffer)
|
vk_command_buffer_finish(struct vk_command_buffer *command_buffer)
|
||||||
{
|
{
|
||||||
list_del(&command_buffer->pool_link);
|
list_del(&command_buffer->pool_link);
|
||||||
|
vk_cmd_queue_finish(&command_buffer->cmd_queue);
|
||||||
util_dynarray_fini(&command_buffer->labels);
|
util_dynarray_fini(&command_buffer->labels);
|
||||||
vk_object_base_finish(&command_buffer->base);
|
vk_object_base_finish(&command_buffer->base);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#ifndef VK_COMMAND_BUFFER_H
|
#ifndef VK_COMMAND_BUFFER_H
|
||||||
#define VK_COMMAND_BUFFER_H
|
#define VK_COMMAND_BUFFER_H
|
||||||
|
|
||||||
|
#include "vk_cmd_queue.h"
|
||||||
#include "vk_object.h"
|
#include "vk_object.h"
|
||||||
#include "util/list.h"
|
#include "util/list.h"
|
||||||
#include "util/u_dynarray.h"
|
#include "util/u_dynarray.h"
|
||||||
|
@ -52,6 +53,9 @@ struct vk_command_buffer {
|
||||||
*/
|
*/
|
||||||
void (*destroy)(struct vk_command_buffer *);
|
void (*destroy)(struct vk_command_buffer *);
|
||||||
|
|
||||||
|
/** Command list for emulated secondary command buffers */
|
||||||
|
struct vk_cmd_queue cmd_queue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VK_EXT_debug_utils
|
* VK_EXT_debug_utils
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue