PacktPublishing / Mastering-Graphics-Programming-with-Vulkan

MIT License
514 stars 65 forks source link

Zero size framebuffer if dynamic rendering not available. (Chapter 7) #34

Closed dorian-apanel-intel closed 9 months ago

dorian-apanel-intel commented 1 year ago

When VK_KHR_dynamic_rendering extension is not present, or is ignored by following change:

if ( !creation.force_disable_dynamic_rendering && !strcmp( extensions[ i ].extensionName, VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME ) ) {
    //dynamic_rendering_extension_present = true;
    continue;
}

Then following core validation error appears:

VUID-VkFramebufferCreateInfo-width-00885(ERROR / SPEC): msgNum: -1231547098 - Validation Error: [ VUID-VkFramebufferCreateInfo-width-00885 ] Object 0: handle = 0x20e04bf3480, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xb6981526 | vkCreateFramebuffer(): Requested VkFramebufferCreateInfo width must be greater than zero. The Vulkan spec states: width must be greater than 0 (https://vulkan.lunarg.com/doc/view/1.3.231.1/windows/1.3-extensions/vkspec.html#VUID-VkFramebufferCreateInfo-width-00885)
    Objects: 1
       [0]  0x20e04bf3480, type: 3, name: NULL
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in RaptorEngine_Chapter7_Debug.exe.

Callstack:

>   RaptorEngine_Chapter7_Debug.exe!raptor::vulkan_create_framebuffer(raptor::GpuDevice & gpu, raptor::Framebuffer * framebuffer) Line 2211 C++ Symbols loaded.
    RaptorEngine_Chapter7_Debug.exe!raptor::GpuDevice::create_framebuffer(const raptor::FramebufferCreation & creation) Line 2430   C++ Symbols loaded.
    RaptorEngine_Chapter7_Debug.exe!raptor::create_framebuffer(raptor::FrameGraph * frame_graph, raptor::FrameGraphNode * node) Line 380    C++ Symbols loaded.
    RaptorEngine_Chapter7_Debug.exe!raptor::FrameGraph::compile() Line 668  C++ Symbols loaded.
    RaptorEngine_Chapter7_Debug.exe!main(int argc, char * * argv) Line 278  C++ Symbols loaded.

Note: Tested on Intel A770 and NVidia GeForce GT 1030 (No mesh shaders)

theWatchmen commented 10 months ago

This should now be fixed. We were creating a render pass and framebuffer for compute nodes, which resulted in 0 sized resources. We now skip this step for compute nodes :)

theWatchmen commented 9 months ago

Closing this as it should be fixed. Feel free to reopen if that's not the case.