Bug 98198 - Crash when framebuffer is VK_NULL_HANDLE in VkCommandBufferInheritanceInfo
Summary: Crash when framebuffer is VK_NULL_HANDLE in VkCommandBufferInheritanceInfo
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: Jason Ekstrand
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-10 15:09 UTC by Adam Bialogonski
Modified: 2016-11-16 23:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Adam Bialogonski 2016-10-10 15:09:24 UTC
When recording the secondary command buffer with the inheritance of the VkRenderPass but without known VkFramebuffer, the driver crashes. For example, setting the VkCommandBufferInheritanceInfo to:

inheritance.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO;
inheritance.renderPass = validRenderPass;
inheritance.subpass = 0;
inheritance.framebuffer = VK_NULL_HANDLE; // not known yet VkFramebuffer object
inheritance.flags = VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT;

It will result in the crash in the vkCmdDraw() as the driver expects the framebuffer is not NULL. However, the specification says:

"framebuffer optionally refers to the VkFramebuffer object that the VkCommandBuffer will be rendering to if it is executed within a render pass instance. It can be VK_NULL_HANDLE if the framebuffer is not known, or if the VkCommandBuffer will not be executed within a render pass instance."

Which means, using VK_NULL_HANDLE is absolutely valid from the application point of view and driver should not crash.
Comment 1 Jason Ekstrand 2016-10-10 16:05:30 UTC
Thanks for the bug report!  This is a known bug and I'm working on fixing it.  Unfortunately, the fix is going to be a bit painful so it may take some time.
Comment 2 Konstantin 2016-10-17 10:51:30 UTC
I can confirm this bug.
If I set inheritance.framebuffer for just one framebuffer in swapchain,
I can see the rendered scene for roughly 1/4th of frames for using 4 swapchain framebuffers.
Comment 3 Konstantin 2016-10-17 11:03:25 UTC
Maybe a bit offtopic: If a vulkan developer supposed to provide separate secondary comamand buffers for each framebuffer, wouldn't it be an overkill to generate 4x as many secondary command buffers(for the whole scene graph)?
I don't see how I can avoid the last restrictions (1 node = one command buffer) because each model needs different buffers. Even if one uses one giant Buffor for all vertices and ubos, each model nees different textures -> this means different descriptor sets -> which means different command buffers. Even if you update the same descriptor set, you still may have different pipelines for some models.
I would have thought setting inheritance.framebuffer to VK_NULL_HANDLE would be the most usual case, unless it's a fixed demo.
Comment 4 Jason Ekstrand 2016-11-16 23:52:58 UTC
I just landed a major rework of color attachments that fixes this.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.