vulkan: use cmd size array for queued cmd allocations

minor simplification for consistency

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23322>
This commit is contained in:
Mike Blumenkrantz 2023-05-30 11:11:21 -04:00 committed by Marge Bot
parent fd45ab843f
commit 0a3ddcbe8b
2 changed files with 2 additions and 7 deletions

View file

@ -112,7 +112,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_CmdPushDescriptorSetWithTemplateKHR(
LVP_FROM_HANDLE(lvp_descriptor_update_template, templ, descriptorUpdateTemplate);
size_t info_size = 0;
struct vk_cmd_queue_entry *cmd = vk_zalloc(cmd_buffer->vk.cmd_queue.alloc,
sizeof(*cmd), 8,
vk_cmd_queue_type_sizes[VK_CMD_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_KHR], 8,
VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
if (!cmd)
return;

View file

@ -274,12 +274,7 @@ VkResult vk_enqueue_${to_underscore(c.name)}(struct vk_cmd_queue *queue
% endfor
)
{
struct vk_cmd_queue_entry *cmd = vk_zalloc(queue->alloc,
sizeof(struct vk_cmd_queue_entry_base)
% if len(c.params) > 1:
+ sizeof(struct ${to_struct_name(c.name)})
% endif
, 8,
struct vk_cmd_queue_entry *cmd = vk_zalloc(queue->alloc, vk_cmd_queue_type_sizes[${to_enum_name(c.name)}], 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!cmd) return VK_ERROR_OUT_OF_HOST_MEMORY;