VK_EXT_multisampled_render_to_swapchain.proposal
This extension brings the functionality of VK_EXT_multisampled_render_to_single_sampled to Vulkan swapchains.
Problem Statement
Multisampled rendering to single-sampled images is particularly efficient on tiling GPUs.
See the proposal for VK_EXT_multisampled_render_to_single_sampled for details.
Such rendering to swapchain images is currently prohibited due to a lack of a create flag equivalent to VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT.
Proposal
This extension simply adds a swapchain create flag that mirrors VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT:
VK_SWAPCHAIN_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT
Feature, advertising whether the implementation supports multisampled-rendering-to-single-sampled for swapchain images:
typedef struct VkPhysicalDeviceMultisampledRenderToSwapchainFeaturesEXT {
VkStructureType sType;
void* pNext;
VkBool32 multisampledRenderToSwapchain;
} VkPhysicalDeviceMultisampledRenderToSwapchainFeaturesEXT;
To query whether this flag is acceptable in VkSwapchainCreateInfoKHR::flags for a given surface, chain an instance of the following struct to pSurfaceCapabilities when calling vkGetPhysicalDeviceSurfaceCapabilities2KHR.
Any bit, including VK_SWAPCHAIN_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT, that is not set in swapchainSupportedFlags is not supported when creating a swapchain for the queried surface.
The result of this query is the intersection of supported flags for all present modes unless VkSurfacePresentModeKHR is chained to pSurfaceInfo, in which case more flags may be supported, limited to the specified present mode and those that are compatible with it (per VkSurfacePresentModeCompatibilityKHR).
typedef struct VkSwapchainFlagsSurfaceCapabilitiesEXT {
VkStructureType sType;
void* pNext;
VkSwapchainCreateFlagsKHR swapchainSupportedFlags;
} VkSwapchainFlagsSurfaceCapabilitiesEXT;
Issues
How can support for this flag be determined for the exact swapchain format?
The description of the vkCreateSwapchainKHR entry point defines the equivalence between presentable and non-presentable images.
Therefore, applications must use vkGetPhysicalDeviceImageFormatProperties2 to determine support for VK_SWAPCHAIN_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT with a given format by using the equivalent VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT flag.