venus: ignore pInheritanceInfo if not secondary command buffer
authorYiwei Zhang <zzyiwei@chromium.org>
Tue, 13 Sep 2022 22:19:28 +0000 (22:19 +0000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 13 Sep 2022 23:19:54 +0000 (23:19 +0000)
TEST: no segfault in dEQP-VK.api.command_buffers.bad_inheritance_info_random

Fixes: 6f5289df533 ("venus: refactor VkCommandBufferBeginInfo fixups to function")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18583>

src/virtio/vulkan/vn_command_buffer.c

index 0276aff..bd9f136 100644 (file)
@@ -656,6 +656,7 @@ vn_fix_command_buffer_begin_info(struct vn_command_buffer *cmd,
    const bool has_continue =
       begin_info->flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT;
    const bool has_renderpass =
+      is_cmd_secondary &&
       begin_info->pInheritanceInfo->renderPass != VK_NULL_HANDLE;
 
    /* Can early-return if dynamic rendering is used and no structures need to