mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 23:40:12 +01:00
vulkan: handle enqueueing CmdPushConstants2KHR
implementation from lavapipe. there's no CTS coverage for this but hopefully it works... Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28682>
This commit is contained in:
parent
0ba7489243
commit
b39efbc422
2 changed files with 29 additions and 1 deletions
|
|
@ -720,3 +720,31 @@ err:
|
|||
|
||||
vk_command_buffer_set_error(cmd_buffer, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL vk_cmd_enqueue_CmdPushConstants2KHR(
|
||||
VkCommandBuffer commandBuffer,
|
||||
const VkPushConstantsInfoKHR* pPushConstantsInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_command_buffer, cmd_buffer, commandBuffer);
|
||||
struct vk_cmd_queue *queue = &cmd_buffer->cmd_queue;
|
||||
|
||||
struct vk_cmd_queue_entry *cmd = vk_zalloc(queue->alloc, vk_cmd_queue_type_sizes[VK_CMD_PUSH_CONSTANTS2_KHR], 8,
|
||||
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if (!cmd)
|
||||
return;
|
||||
|
||||
cmd->type = VK_CMD_PUSH_CONSTANTS2_KHR;
|
||||
|
||||
VkPushConstantsInfoKHR *info = vk_zalloc(queue->alloc, sizeof(*info), 8,
|
||||
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
void *pValues = vk_zalloc(queue->alloc, pPushConstantsInfo->size, 8,
|
||||
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
|
||||
memcpy(info, pPushConstantsInfo, sizeof(*info));
|
||||
memcpy(pValues, pPushConstantsInfo->pValues, pPushConstantsInfo->size);
|
||||
|
||||
cmd->u.push_constants2_khr.push_constants_info = info;
|
||||
info->pValues = pValues;
|
||||
|
||||
list_addtail(&cmd->cmd_link, &cmd_buffer->cmd_queue.cmds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ MANUAL_COMMANDS = [
|
|||
# pData's size cannot be calculated from the xml
|
||||
'CmdPushDescriptorSetWithTemplate2KHR',
|
||||
'CmdPushDescriptorSetWithTemplateKHR',
|
||||
'CmdPushConstants2KHR',
|
||||
]
|
||||
|
||||
NO_ENQUEUE_COMMANDS = [
|
||||
# pData's size cannot be calculated from the xml
|
||||
'CmdPushConstants2KHR',
|
||||
'CmdPushDescriptorSet2KHR',
|
||||
|
||||
# These don't return void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue