SDL/cmake
Dan Ginsburg cab20117e6
Vulkan Renderer (#9114)
This pull request adds an implementation of a Vulkan Render backend to SDL.  I have so far tested this primarily on Windows, but also smoke tested on Linux and macOS (MoltenVK).  I have not tried it yet on Android, but it should be usable there as well (sans any bugs I missed).  This began as a port of the SDL Direct3D12 Renderer, which is the closest thing to Vulkan as existed in the SDL codebase. The shaders are more or less identical (with the only differences being in descriptor bindings vs root descriptors).  The shaders are built using the HLSL frontend of glslang.

Everything in the code is pure Vulkan 1.0 (no extensions), with the exception of HDR support which requires the Vulkan instance extension `VK_EXT_swapchain_colorspace`.  The code could have been simplified considerably if I used dynamic rendering, push descriptors, extended dynamic state, and other modern Vulkan-isms, but I felt it was more important to make the code as vanilla Vulkan as possible so that it would run on any Vulkan implementation.

The main differences with the Direct3D12 renderer are:
* Having to manage renderpasses for performing clears.  There is likely some optimization that would still remain for more efficient use of TBDR hardware where there might be some unnecessary load/stores, but it does attempt to do clears using renderpasses.
* Constant buffer data couldn't be directly updated in the command buffer since I didn't want to rely on push descriptors, so there is a persistently mapped buffer with increasing offset per swapchain image where CB data gets written.
* Many more resources are dependent on the swapchain resizing due to i.e. Vulkan requiring the VkFramebuffer to reference the VkImageView of the swapchain, so there is a bit more code around handling that than was necessary in D3D12.
* For NV12/NV21 textures, rather than there being plane data in the texture itself, the UV data is placed in a separate `VkImage`/`VkImageView`.

I've verified that `testcolorspace` works with both sRGB and HDR linear.  I've tested `testoverlay` works with the various YUV/NV12/NV21 formats.  I've tested `testsprite`.  I've checked that window resizing and swapchain out-of-date handling when minimizing are working.  I've run through `testautomation` with the render tests.  I also have run several of the tests with Vulkan validation and synchronization validation.  Surely I will have missed some things, but I think it's in a good state to be merged and build out from here.
2024-02-22 14:58:11 -08:00
..
android cmake: create Android jars + apks for tests 2023-07-20 16:54:29 +02:00
test Removed SDL_INIT_EVERYTHING 2024-01-18 06:17:58 -08:00
3rdparty.cmake cmake: include_guard() is not needed 2023-02-13 04:55:46 +01:00
CPackProjectConfig.cmake.in cmake: add CPack support for creating binary archives 2023-01-31 01:59:21 +01:00
CheckCPUArchitecture.cmake cmake+video: always use altivec.h header for detection + introduce SDL_ENABLE_ALTIVEC 2023-03-15 14:54:20 +01:00
FindFFmpeg.cmake cmake: use *_STATIC_* variables when linking to a static ffmpeg 2023-10-10 03:32:46 -07:00
GetGitRevisionDescription.cmake Fix various typos (docs/build scripts/tests) 2023-07-03 08:35:37 -07:00
GetGitRevisionDescription.cmake.in cmake: generate git hash using GetRevisionDescription CMake module 2023-01-08 18:20:56 +01:00
PkgConfigHelper.cmake cmake: use *_STATIC_* variables when linking to a static ffmpeg 2023-10-10 03:32:46 -07:00
SDL3Config.cmake.in cmake: create and install SDL3::Jar target for Android 2023-11-23 02:13:08 +01:00
SDL3jarTargets.cmake.in cmake: create and install SDL3::Jar target for Android 2023-11-23 02:13:08 +01:00
cmake_uninstall.cmake.in cmake: declutter root + remove obsolete variables 2022-12-19 09:19:45 -08:00
macros.cmake cmake: the compile-time pdb does not have a suffix, if set 2023-11-09 03:28:20 +01:00
sdl3.pc.in Don't provide the SDL3 header path 2023-08-31 11:41:37 -07:00
sdlchecks.cmake Vulkan Renderer (#9114) 2024-02-22 14:58:11 -08:00
sdlcompilers.cmake Use SDL_DISABLE_ALLOCA instead of HAVE_ALLOCA in SDL_stdinc.h 2023-10-28 18:54:12 +02:00
sdlmanpages.cmake cmake: make HEADERS_DIR a required argument of SDL_generate_manpages 2023-09-29 03:42:33 +02:00
sdlplatform.cmake Implement visionOS support 2023-08-08 22:25:04 -07:00
sdltargets.cmake cmake: file(RELATIVE_PATH) needs 2 absolute paths 2023-10-30 19:50:35 +01:00
xxd.py xxd.py: always write \n line endings 2023-08-13 13:51:31 -07:00