Repository navigation
Conversation
…rame bring-up LEONIDA_PROBE=<text>|all gives a graphics pipeline whose vertex, geometry or pixel shader entry name (spirv/index.json) contains the text built-in stages when it is created: a pixel shader that writes opaque green to RT 0 and a vertex shader that draws one full-screen triangle (culling off). LEONIDA_PROBE_MODE=vs|ps|both picks the stages (default both). LEONIDA_PROBE_POS=ndc|px[:<W>x<H>] makes the vertex shader pass the POSITION0 input through as NDC or as pixels instead; its input Location is moved to POSITION's register and its scale/offset specialization constants are set in the words. Each probed pipeline is logged once. A geometry or mesh pipeline keeps its first stage. LEONIDA_DEBUG_CLEAR=1 turns an all-zero ClearRenderTargetView colour into opaque magenta (read when a command list is made), so a black frame can be told apart from a target no draw reached. The probe shaders are GLSL in runtime/src (debug_probe_*.vert, debug_probe.frag); debug_probe_spirv.h holds their SPIR-V 1.5 words from glslangValidator -V --target-env vulkan1.2 -Os -g0 (glslang 16.6.0). tests/test_debug_probe_spirv.py checks the header against the GLSL and --write regenerates it. d3d12_debug_probe_test checks the parser, the patched words and, on a GPU, each mode and the magenta clear by readback. Documented in docs/boot.md, "Useful switches". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ABh377Xfov1ZDULWTYvTm
Contributor
|
Verified on native Windows 11 (
AI-assisted. |
|
checked: #9322@ Built on the local boot integration with a mechanical insertion of the environment parser. Synthetic fixtures only for this PR check. The Vulkan validation layer is unavailable on this host. agent: yes |
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.
Claimed in #9065 (comment) (first posted in #8868).
What
Two opt-in debug switches for bring-up of the retail title's first frames. Both are off unless the variable is set.
LEONIDA_PROBE=<text>|all: a graphics pipeline whose vertex, geometry or pixel shader entry name (fromspirv/index.json) contains<text>gets built-in stages when it is created.LEONIDA_PROBE_MODE=vs|ps|bothpicks the stages (defaultboth).LEONIDA_PROBE_POS=ndc|px[:<W>x<H>]: the built-in VS instead passes the POSITION0 input through, either as NDC or as pixels of a W x H target (y down; barepx= 3840x2160). Its input Location is patched to POSITION's input register.LEONIDA_DEBUG_CLEAR=1: an all-zeroClearRenderTargetViewcolour becomes opaque magenta. This tells a black frame apart from "nothing reached the target".Why
A black first frame doesn't say whether shaders, render state, submission or present are at fault. These switches separate those without touching game data.
How to use
Set the variables before starting
gta6rtwithLEONIDA_D3D12=vulkan. They are documented indocs/boot.md, "Useful switches".Measured use
On the retail title (data in #6750 and #9137):
That separated the shader-side constant and descriptor reads from the D3D12 state.
Implementation
runtime/src/debug_probe.h: the settings parser, plus the SPIR-V patch for the pass-through VS (Location and four float spec constants).PipelineState::create_graphicsswaps in the words after the f16 link and D24 patch, right before the shader modules are created.runtime/src(debug_probe_fullscreen.vert,debug_probe_position.vert,debug_probe.frag).runtime/src/debug_probe_spirv.hholds their words, built withglslangValidator -V --target-env vulkan1.2 -Os -g0(glslang 16.6.0, SPIR-V 1.5).tests/test_debug_probe_spirv.pychecks the header against the GLSL;--writeregenerates it.LEONIDA_DEBUG_CLEARis read when a command list is made.Tested
d3d12_debug_probe_test.MODE=pscolours the quad green.MODE=vscovers the target with a title PS.POS=ndcandPOS=px:64x64put the title's POSITION in the right quadrant (POSITION is input register 1).d3d12_draw,d3d12_geometryandd3d12_compass.d3d12_debug_probeis clean underLEONIDA_VK_VALIDATION=1.tests/test_debug_probe_spirv.py,test_ctest_registration.py,test_docs_repo_paths.pyandtest_docs_env_vars.pypass.No game data: the probe shaders are hand-written GLSL, and nothing from the game is in the change.
AI-assisted (Claude Code). Reviewed and tested as above.
🤖 Generated with Claude Code
https://claude.ai/code/session_016ABh377Xfov1ZDULWTYvTm