* vulkan: no need to explicitly enable VK_KHR_get_physical_device_properties2
It has been promoted to core Vulkan 1.1
* vulkan: fix creating and destroying swapchains
We can't reuse a semaphore if it is signalled. There is no
easy way to wait on the swapchain semaphore without some ugly hacks,
so instead we just create a new one.
We also need make sure we only destroy old swapchains once they are
(probably) not used anymore. The recent VK_EXT_swapchain_maintenance1
extension would make all of this much easier, but as of now, it's not yet
widely supported.
* cleanup: reduce amount of copy-paste in AllocationHandler::Update()
Using a lambda allows us to remove the copy-pasted loop and increase legibility
by reducing the code by almost two thirds with no performance impact: both GCC
and MSVC generate almost the same code as in the old version, the differences
being often due to slightly different register allocations.
* vulkan: ensure render area is not greater than color attachments
swapchain->desc.width/height can differ from the swapChainExtent,
for example if a VK_KHR_SUBOPTIMAL happened before we received the
"window size changed" event, or if it is not between the minimal
or maximal extents.
Ensure we don't use a render area larger than the color attachments,
as this violates VUID-VkRenderingInfo-pNext-06079 and 06080.
Some devices don't offer dedicated queues, just one "does everything"
queue. In those cases, our logically separate queues are the same
Vulkan queue, so we need to make sure that those queue share the same
mutex.
Co-authored-by: Turánszki János <turanszkij@users.noreply.github.com>
Ensure that if there is more than one physical device, but
no preferred one, (eg. iGPU and llvmpipe), properties2 will
have the data for the selected device, and not the last
one checked.
Update_IK gets called for every frame, but ground intersections are only
checked up to 120 times per second.
This can lead to the Y velocity being >0 despite standing on the ground,
messing up IK which is only done when the velocity is 0.
Fixes#707