From 1d2a33c705535b9b1236631a5ab90ace93f398e8 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 28 May 2021 08:52:30 -0700 Subject: [PATCH] venus: ignore pInheritanceInfo when we should pInheritanceInfo should be ignored when the command buffer is primary. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4850 Signed-off-by: Chia-I Wu Reviewed-by: Yiwei Zhang Part-of: --- src/virtio/vulkan/vn_command_buffer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/virtio/vulkan/vn_command_buffer.c b/src/virtio/vulkan/vn_command_buffer.c index 87a9520e8b2..dd157597d70 100644 --- a/src/virtio/vulkan/vn_command_buffer.c +++ b/src/virtio/vulkan/vn_command_buffer.c @@ -211,6 +211,14 @@ vn_BeginCommandBuffer(VkCommandBuffer commandBuffer, vn_cs_encoder_reset(&cmd->cs); + VkCommandBufferBeginInfo local_begin_info; + if (pBeginInfo->pInheritanceInfo && + cmd->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY) { + local_begin_info = *pBeginInfo; + local_begin_info.pInheritanceInfo = NULL; + pBeginInfo = &local_begin_info; + } + cmd_size = vn_sizeof_vkBeginCommandBuffer(commandBuffer, pBeginInfo); if (!vn_cs_encoder_reserve(&cmd->cs, cmd_size)) { cmd->state = VN_COMMAND_BUFFER_STATE_INVALID;