Open AlexMcFarland opened 6 months ago
The spec isn't really clear on when the monitor value will be used when provided, and when it will be ignored. I had assumed that if the value is not required, then the driver will always ignore it, but apparently that's not the case? Do you have any information on that perhaps?
vkGetPhysicalDeviceSurfaceCapabilities2KHR()
VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pNext-02671 If a
VkSurfaceCapabilitiesFullScreenExclusiveEXT
structure is included in the pNext chain ofpSurfaceCapabilities
, aVkSurfaceFullScreenExclusiveWin32InfoEXT
structure must be included in thepNext
chain ofpSurfaceInfo
On windows, if full_screen_exclusive != Default
then VkSurfaceCapabilitiesFullScreenExclusiveEXT
is added to the chain so VkSurfaceFullScreenExclusiveWin32InfoEXT
is required. It is currently only added if full_screen_exclusive == ApplicationControlled
.
The ValidationError
provided in PhysicalDevice::surface_capabilities
references VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-02672
which is a subset of the requirements of VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pNext-02671
.
VkPhysicalDeviceSurfaceInfo2KHR
... chaining a
VkSurfaceFullScreenExclusiveWin32InfoEXT
structure may also report additional surface capabilitiesVUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-02672 If the
pNext
chain includes aVkSurfaceFullScreenExclusiveInfoEXT
structure with itsfullScreenExclusive
member set toVK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT
, and surface was created usingvkCreateWin32SurfaceKHR
, aVkSurfaceFullScreenExclusiveWin32InfoEXT
structure must be included in thepNext
chain
I.e. on windows VkSurfaceFullScreenExclusiveWin32InfoEXT
is required if full_screen_exclusive == ApplicationControlled
and may be optionally provided for additional capabilities (that are required by vkGetPhysicalDeviceSurfaceCapabilities2KHR()
).
PhysicalDevice::surface_formats
and PhysicalDevice::surface_present_modes
use VkPhysicalDeviceSurfaceInfo2KHR
.
VkSwapchainCreateInfoKHR
Same as VkPhysicalDeviceSurfaceInfo2KHR
but there is no advantage to providing it outside the required full_screen_exclusive == ApplicationControlled
.
So on windows, VkSurfaceFullScreenExclusiveWin32InfoEXT
is optional if full_screen_exclusive != Default
. It is required for VkPhysicalDeviceSurfaceInfo2KHR
with full_screen_exclusive == ApplicationControlled
and vkGetPhysicalDeviceSurfaceCapabilities2KHR()
with full_screen_exclusive != Default
.
0.34
Windows
NVIDIA GeForce GTX 1080
GeForce Game Ready Driver 536.23
Issue
Currently when a
full_screen_exclusive
value other thanFullScreenExclusive::Default
is provided inSurfaceInfo
orSwapchainCreateInfo
, Vulkan will output a validation error if aWin32Monitor
handle is not provided. Vulkano however expects that if and only iffull_screen_exclusive
isFullScreenExclusive::ApplicationControlled
should aWin32Monitor
handle also be provided. Since Vulkano will not let you provide aWin32Monitor
handle alongside otherfull_screen_exclusive
values likeFullScreenExclusive::Allowed
orFullScreenExclusive::Disallowed
, it is impossible to use these values without triggering the following validation error:As the Vulkan spec states (for surface capabilities):
Note that it makes no mention of
VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT
specifically.As far as I'm aware, the fix would be to update these conditional checks (these are only the ones that I know of in Vulkano, but maybe there are more?): https://github.com/vulkano-rs/vulkano/blob/master/vulkano/src/device/physical.rs#L2412 https://github.com/vulkano-rs/vulkano/blob/master/vulkano/src/device/physical.rs#L2683 https://github.com/vulkano-rs/vulkano/blob/master/vulkano/src/swapchain/mod.rs#L609-L610 https://github.com/vulkano-rs/vulkano/blob/master/vulkano/src/swapchain/mod.rs#L633-L634
To instead be: