Vulkan-Samples
Vulkan-Samples copied to clipboard
direct-to-display window improvements
Description
Rather than just taking the first plane of the first display we now gather a list of valid candidates and pick the best fit.
An additional display 'FullscreenStretch' mode has been added. This uses VkDisplayPresentInfoKHR from the VK_KHR_display_swapchain extension, when available, to specify separate src and dst rectangles for the surface and display. This enables you to have a 640x360 surface stretched fullscreen onto the display for example, rather than just appearing in a corner.
In standard or stretch mode, with direct-to-display, specifying --width & --height controls the surface size. In fullscreen or borderless modes, the surface is the same size as the display regardless of the width and height settings. The width and height are used to select the best display/plane combination however.
General Checklist:
Please ensure the following points are checked:
- [x] My code follows the coding style
- [x] I have reviewed file licenses
- [x] I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
- [x] I have commented any added functions (in line with Doxygen)
- [x] I have commented any code that could be hard to understand
- [x] My changes do not add any new compiler warnings
- [x] My changes do not add any new validation layer errors or warnings
- [x] I have used existing framework/helper functions where possible
- [x] My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions
- [x] My changes do not add any regressions
- [x] I have tested every sample to ensure everything runs correctly
- [x] This PR describes the scope and expected impact of the changes I am making
Note: Built and tested only on Linux
Besides the fact, that I have not checked the actual functionality (just checked on Windows where it is not used): LGTM now!
I suspect that no-one else will actually be able to test the direct-to-display changes, so this may be a code-review only change.