vulkan/cmd_queue: Add a vk_cmd_queue_execute() helper
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
This commit is contained in:

committed by
Marge Bot

parent
e0910f5ef8
commit
8f29c833da
@@ -70,6 +70,8 @@ TEMPLATE_H = Template(COPYRIGHT + """\
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct vk_device_dispatch_table;
|
||||
|
||||
struct vk_cmd_queue {
|
||||
const VkAllocationCallbacks *alloc;
|
||||
struct list_head cmds;
|
||||
@@ -169,6 +171,10 @@ vk_cmd_queue_finish(struct vk_cmd_queue *queue)
|
||||
list_inithead(&queue->cmds);
|
||||
}
|
||||
|
||||
void vk_cmd_queue_execute(struct vk_cmd_queue *queue,
|
||||
VkCommandBuffer commandBuffer,
|
||||
const struct vk_device_dispatch_table *disp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -185,6 +191,7 @@ TEMPLATE_C = Template(COPYRIGHT + """
|
||||
#include "vk_alloc.h"
|
||||
#include "vk_cmd_enqueue_entrypoints.h"
|
||||
#include "vk_command_buffer.h"
|
||||
#include "vk_dispatch_table.h"
|
||||
|
||||
const char *vk_cmd_queue_type_names[] = {
|
||||
% for c in commands:
|
||||
@@ -275,6 +282,33 @@ vk_free_queue(struct vk_cmd_queue *queue)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
vk_cmd_queue_execute(struct vk_cmd_queue *queue,
|
||||
VkCommandBuffer commandBuffer,
|
||||
const struct vk_device_dispatch_table *disp)
|
||||
{
|
||||
list_for_each_entry(struct vk_cmd_queue_entry, cmd, &queue->cmds, cmd_link) {
|
||||
switch (cmd->type) {
|
||||
% for c in commands:
|
||||
% if c.guard is not None:
|
||||
#ifdef ${c.guard}
|
||||
% endif
|
||||
case ${to_enum_name(c.name)}:
|
||||
disp->${c.name}(commandBuffer
|
||||
% for p in c.params[1:]:
|
||||
, cmd->u.${to_struct_field_name(c.name)}.${to_field_name(p.name)}\\
|
||||
% endfor
|
||||
);
|
||||
break;
|
||||
% if c.guard is not None:
|
||||
#endif // ${c.guard}
|
||||
% endif
|
||||
% endfor
|
||||
default: unreachable("Unsupported command");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
% for c in commands:
|
||||
% if c.name in manual_commands:
|
||||
/* TODO: Generate vk_cmd_enqueue_${c.name}() */
|
||||
|
Reference in New Issue
Block a user