ConfettiFX / The-Forge

The Forge Cross-Platform Rendering Framework PC Windows, Steamdeck (native), Ray Tracing, macOS / iOS, Android, XBOX, PS4, PS5, Switch, Quest 2
Apache License 2.0
4.71k stars 493 forks source link

Vulkan renderer doesn't work when Vulkan implementation has more than 4 queue families #195

Closed pdaniell-nv closed 3 years ago

pdaniell-nv commented 3 years ago

It appears this line of code in the Vulkan renderer will cause a stack corruption if the Vulkan implementation exposes more than 4 queue families: https://github.com/ConfettiFX/The-Forge/blob/81b29058b1b433f581e0e31c633f64118d9ce247/Common_3/Renderer/Vulkan/Vulkan.cpp#L2591

With the release of Vulkan video the latest NVIDIA beta drivers are now exposing 5 queue families - universal, transfer, compute, video decode, video encode: https://developer.nvidia.com/vulkan-driver

This causes the queue_create_infos[4] variable to spill over to other variables in the stack and corrupt the create_info used for vkCreateDevice, which causes the Vulkan loader to crash.

A trivial fix would be to dynamically allocate queue_create_infos based on the queueFamiliesCount.

manas-kulkarni commented 3 years ago

Good catch. Will be fixed in next release

wolfgangfengel commented 3 years ago

Can you confirm that it is resolved with release 1.48?