From: Kristian Høgsberg Kristensen Date: Sat, 9 Jan 2016 06:50:18 +0000 (-0800) Subject: vk: Only begin subpass if we're continuing a render pass X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8cdef3dcef0e5da809f306a82aa6ffc9c1e6a71;p=mesa.git vk: Only begin subpass if we're continuing a render pass If VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not set in pBeginInfo->flags, we don't have a render pass or framebuffer. Change the condition that guard looking up render pass and framebuffer to test for VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT instead of VK_COMMAND_BUFFER_LEVEL_SECONDARY. Fixes all remaining crashes in dEQP-VK.api.command_buffers.*. --- diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index 0407ad92fba..5507400c84a 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -297,7 +297,11 @@ VkResult anv_BeginCommandBuffer( cmd_buffer->usage_flags = pBeginInfo->flags; - if (cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_SECONDARY) { + assert(cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_SECONDARY || + !(cmd_buffer->usage_flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT)); + + if (cmd_buffer->usage_flags & + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { cmd_buffer->state.framebuffer = anv_framebuffer_from_handle(pBeginInfo->framebuffer); cmd_buffer->state.pass =