Nabla
Nabla copied to clipboard
Implement + require `VK_KHR_surface_maintenance1` and `VK_KHR_swapchain_maintenance1`
Description
In plain old regular Vulkan you can't query the following from a Surface:
- the number of min/max images from a surface GIVEN a particular presentation mode
- the set of presentation modes which can be easily switched between without requiring swapchain recreation
- scaled presentation capabilities
this is the
surface_maintenanceinstance extension which is required for the following.
The main device extension we want to use is swapchain_maintenance1 because it fixes a bunch of spec errors and UB:
- knowing when you can throw away an old swapchain and its images ("Specify a fence that will be signaled when the resources associated with a present operation can be safely destroyed.")
- not "having to present" swapchain images already acquired, via a special "release" ("Allow applications to release previously acquired images without presenting them.")
Plus some fun bonuses:
- Allow applications to define the behavior when presenting a swapchain image to a surface with different dimensions than the image. Using this feature may allow implementations to avoid returning VK_ERROR_OUT_OF_DATE_KHR in this situation.
- Allow changing the present mode a swapchain is using at per-present granularity
- Allow applications to defer swapchain memory allocation for improved startup time and memory footprint
Solution proposal
Both extensions are not yet ratified and device support for both extensions is hovering around 2% right now, so we need to wait before implementing.