Repository navigation
profile_guess: SDL_GPU's vkCmd* names and empty #version strings (MARVEL Cosmic Invasion) - #2599
Open
bensaadmucret wants to merge 1 commit into
Open
bensaadmucret wants to merge 1 commit into
bensaadmucret wants to merge 1 commit into
Conversation
This was referenced Nov 13, 2026
…VEL Cosmic Invasion) Two misreads of an SDL_GPU main's files: - graphics: a main that imports only vkGetInstanceProcAddr (SDL's Vulkan loader, which an SDL game links for WSI and may never use to draw — Balatro renders with OpenGL, Absolum with NVN) was read as OpenGL when it also imports EGL and names glShaderSource — SDL's unused GL backend. vkGetDeviceProcAddr does not tell the renderer either: the WSI path names it to load the swapchain procs. A vkCmd* name can only come from a table a renderer resolves command-recording procs through: MARVEL Cosmic Invasion names 30 of them. vk_names counts them in main's strings; the loader import plus any of those is vulkan. - gl_src: MARVEL's main holds four bare '#version' headers (MojoShader prefixes the GLSL it regenerates at run time) which counted as embedded GLSL sources, so the build translated four empty shaders and failed in metallib. A '#version' string now counts only with a body behind it (>64 bytes to its NUL). Checked: shader_sources on MARVEL Cosmic Invasion's extraction gives graphics=vulkan + vk_capture; its four captured SPIR-V modules translate and the game draws at 60 FPS. SdlVulkan in test_profile_guess covers the loader-only shapes (Balatro gl, Absolum nvn, own nvnBootstrapLoader beating the SDL signal).
bensaadmucret
force-pushed
the
pr-sdl-vulkan-detect
branch
from
November 14, 2026 13:59
1892d27 to
c83d6e1
Compare
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.
What and why
Two misreads of an SDL_GPU main's files, both found bringing up MARVEL Cosmic Invasion (
010059D020C26000v0, buildD6A37DEAFF3F5AEA, FNA/SDL_GPU):vkGetInstanceProcAddr— SDL's Vulkan loader, which an SDL game links for WSI and may never use to draw (Balatro renders with OpenGL, Absolum with NVN) — was read as OpenGL when it also imports EGL and namesglShaderSource, which is SDL's unused GL backend.vkGetDeviceProcAddrdoes not tell the renderer either: the WSI path names it to load the swapchain procs. AvkCmd*name can only come from a table a renderer resolves command-recording procs through — MARVEL's main names 30 of them.vk_namescounts them; the loader import plus any of those isgraphics=vulkan, with its own survey reason. A main whose ownnvnBootstrapLoaderimport wins as before.#versionheaders (MojoShader prefixes the GLSL it regenerates at run time) which counted as embedded GLSL sources, so the build translated four empty shaders and failed inmetallib. A#versionstring now counts only with a body behind it (>64 bytes to its NUL) — still looser thanglsl_sources'void mainrule, on purpose.Adds the finding to docs/reference/packing.md (A Vulkan game read as OpenGL through SDL's loader).
Checked
python3 -m unittest dm.tools.tests.test_profile_guess— 37 tests, including the newSdlVulkanclass: loader alone with GL names →gl(Balatro's shape), loader only and no GL name →nvn(Absolum's shape), ownnvnBootstrapLoaderbeating the SDL signal,vk_captureset for an SDL_GPU game without SPIR-V files, and a bare#versionheader not counting as embedded GLSL.test_docspasses (6 tests).010059D020C26000v0: the provisional profile now comes outgraphics=vulkan+vk_capture, and with the sibling PRs the game boots and draws (intro video, 60 fps). Before, the profile saidgland the build captured nothing.regress.py impactnamesprofile/ every build for this change. Thegl_srctightening can only lower that counter (bare headers stop counting); thevk_namespath triggers only when a main imports the loader alone and namesvkCmd*procs — a shape the supported SDL games do not have (Balatro: OpenGL, names novkCmd*; Absolum: NVN, ownnvnBootstrapLoader).regress.py check --gameswas not run locally; flagging it honestly for CI.Docs
docs/reference/<subsystem>.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)dmsh_chain.py --headerwas run anddm/gfx/nvn/dmsh_chain.his part of the change