Add Vulkan renderer from vkQuake3 (Sui Jingfeng's fork)#861
Open
runlevel5 wants to merge 7 commits intoioquake:mainfrom
Open
Add Vulkan renderer from vkQuake3 (Sui Jingfeng's fork)#861runlevel5 wants to merge 7 commits intoioquake:mainfrom
runlevel5 wants to merge 7 commits intoioquake:mainfrom
Conversation
Port the Vulkan renderer from vkQuake3 into ioquake3 as a third renderer option alongside OpenGL 1.x and OpenGL 2.0. The renderer is self-contained with its own image loaders, font rendering, and noise functions. CMake integration: - New BUILD_RENDERER_VULKAN option (default ON) - New cmake/renderer_vulkan.cmake build rules - Updated static-linking guard to support 3 renderers - Added Vulkan renderer to macOS bundle, JPEG/FreeType guards Source fixes applied to vkQuake3 code: - Removed duplicate vk_image_sampler.c (kept vk_image_sampler2.c) - Fixed R_LoadImage signature (int* -> uint32_t*) to match declaration - Fixed puff.h include path for ioquake3 directory layout - Added QALIGN macro definition missing from upstream q_shared.h - Re-query VkSurfaceCapabilitiesKHR before swapchain creation to fix stale surface dimensions on Wayland (matching Quake3e's approach) Tested on Fedora 43, AMD Radeon RX 6600 XT via RADV: - All 3 renderers, client, server, and game VMs build cleanly - Vulkan renderer initializes, renders, and shuts down correctly - Swapchain dimensions match window at r_mode 4 and r_mode -2
The .vspv/.fspv files are intermediate build artifacts generated by glslangValidator. Only the .c byte-array files are needed for compilation. Add .vspv/.fspv patterns to .gitignore.
The Vulkan renderer currently only builds and works on Linux. It has not been tested on macOS, Windows, OpenBSD, or Emscripten. Setting the default to OFF prevents CI failures on unsupported platforms.
66c5297 to
d2f6419
Compare
- Update bundled Vulkan headers from 1.1 to 1.4 (header version 341), removing obsolete SPIR-V tools and platform-specific headers now provided via vulkan_core.h - Add VK_KHR_portability_enumeration and VK_KHR_portability_subset support required for MoltenVK on macOS - Add USE_INTERNAL_VULKAN_HEADERS CMake option to allow building against system-provided Vulkan headers - Fix SDL2 header includes in Vulkan renderer to use standard paths - Document macOS MoltenVK requirement in vulkan-readme.md and README.md
Fix all build warnings in the Vulkan renderer (shadow variables, format specifiers, strict prototypes, array size mismatches, header guard typo, unhandled switch cases, and a real memcpy bug in R_MovePatchSurfacesToHunk where heightLodError was copied to itself instead of the hunk allocation). Add r_swapInterval cvar support so the Vulkan renderer respects vsync settings. Previously the present mode selection always preferred MAILBOX over FIFO regardless of r_swapInterval, causing vsync to have no effect and frame rates to run uncapped at 1000+ fps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port the Vulkan renderer from vkQuake3 into ioquake3 as a third renderer option alongside OpenGL 1.x and OpenGL 2.0. The renderer is self-contained with its own image loaders, font rendering, and noise functions.
CMake integration:
BUILD_RENDERER_VULKANoption (default ON)cmake/renderer_vulkan.cmakebuild rulesSource fixes applied to vkQuake3 code:
vk_image_sampler.c(keptvk_image_sampler2.c)R_LoadImage signature (int* -> uint32_t*)to match declarationpuff.hinclude path for ioquake3 directory layoutQALIGNmacro definition missing from upstreamq_shared.hVkSurfaceCapabilitiesKHRbefore swapchain creation to fix stale surface dimensions on Wayland (matching Quake3e's approach)Tested on Fedora 43, AMD Radeon RX 6600 XT via RADV:
r_mode 4andr_mode -2TODO