From a8cdef3dcef0e5da809f306a82aa6ffc9c1e6a71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg=20Kristensen?= Date: Fri, 8 Jan 2016 22:50:18 -0800 Subject: [PATCH] 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.*. --- src/vulkan/anv_cmd_buffer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = -- 2.30.2