Repository navigation
xg_xs: lay out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER) - #461
Conversation
…-TEXTURE-COMPUTER) XGSuggestSwizzleMode and every texture-computer slot returned E_NOTIMPL, so the title's texture layout and copy calls did nothing. They now run on a model of the GFX10 texture layouts (runtime/src/console_texture_layout.h, AMD addrlib's rules for the linear, 256 B, 4 KiB and 64 KiB modes): the suggested mode, the layout structure (slot 2), element offsets (slot 6), copies into and out of a subresource (slots 8 and 9) and the 64 KiB tiling (slot 10). A description the model cannot lay out still gets a computer in *out (with E_INVALIDARG), as before, because two measured callers use *out without checking the HRESULT. Not modelled: compression metadata planes and the XOR and MSAA modes' addressing (E_NOTIMPL). The layout model, the computer's method table and the layout structure are ported from Marvisak/VIctory (GPL-3.0), crates/victory-formats/src/texture.rs and crates/victory-hle/src/modules/xg.rs at d2a4bae1f, credited in the files; the addrlib notice is kept. xg_xs_test now checks the model (hand-checked addresses, mip tails, a two-plane depth-stencil, a bijection and round trip over every element of ten layouts) and the shim's slots: 106 checks, MSVC /W4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER) [oscarlosu-lab]
|
Cross-check of this PR's layout model against an independently written one, with no game files: 3,038 2D cases: modes linear, 256B_S/D, 4KB_S/D, 64KB_S/D; element sizes 1-16 bytes and 4x4 blocks of 8 and 16 bytes; 11 extents from 1x1 to 1920x1080 including odd ones (100x37, 3x1024, 1000x600); 1 and 3 slices; 1, 3 and full mip chains. Compared: total size, slice size, and the byte offset of every element of every mip and slice (every 7th row and column above 512).
Also consistent with this PR: xcl's issue 662 (RX 9070 XT, retail title) measured that the title calls slot 9 with one argument more than VIctory's original The harness is a 150-line standalone C++20 program including both headers, compiled with MSVC 19.44. I can attach it if useful. AI-assisted. |
… lazy PSOs, console formats, XG, title memory) Measured on the retail boot under Wine 11.22 (RX 9060 XT, RADV): it now creates 10,000+ slot 57 pipelines, runs its loading frame loop at ~2.5-4 GB, and, with the hang check held off (LEONIDA_SLOW_STARTUP=1), starts real rendering at ~120 s. Frames are still black, and that run stops at game+0x13360a3 (a game object with a garbage vtable; not caused by anything below that was tested). From open pull requests (applied as patches, conflicts resolved here): - ProjectLeonida#511 (VibeClauding): LEONIDA_LAZY_PSO=1, pipelines built at first draw/dispatch. Local fix on top: the rect-list path's VS words were cleared before rect_list_geometry read them, refusing every rectangle-list PSO; the compute compile keeps this branch's host-stall scope. - ProjectLeonida#496 (Rüzgar Koray Genç): console pipeline-stream numbering (24 = mesh shader). - ProjectLeonida#461 (oscarlosu-lab): xg_xs texture layout and computer (ported from Marvisak/VIctory, GPL-3.0). - Draft ProjectLeonida#321 (Mumogg, 237f9e0): vertex/index views in title CPU memory copied into a ring (title_memory). Local fixes: - Slot 57 pipeline blob elements: +0x00 is SemanticIndex, +0x08 InputSlot (swapped before; docs/fspx.md and the device_proxy test updated). ~4,900 "input layout does not feed COLOR1" refusals were this. - FSPX graphics stages that read their code base use the kind-6 program as code (was empty -> E_OUTOFMEMORY). - Console formats 118/119/120 (hypothesis: D16_UNORM_S8_UINT family) aliased to the D24S8 family at the device's entry points. - Depth-stencil + UAV stand-in extended to slots 108, 127 and the slot-133 texture fallback; a UAV initial state on such a texture starts in COMMON. Slot 108 logs refusals (the title asserts its answer is below 4 GiB). - 8-bit RGBA/BGRA render targets accept a UNORM/sRGB view without a castable list. - Fence slot 12 mirrors refreshed by one poller thread (LEONIDA_FENCE_MIRROR=tp keeps the thread-pool waits, which queued on Wine's wait-queue lock); xs_proxy_mock tests run in tp mode. - Slot-133 shadow buffers keep their VirtualQuery layout between refreshes (178 MB: 70 ms -> ~8.5 ms) and the refresh counts as a host stall. Diagnostics and experiments (off unless noted): - LEONIDA_DRAW_DIAG=1: per-present draw counts and per-draw pipeline/target/depth/viewport/vb0 for early frames. - Slot 57 refusal layout dump and created/failed totals; refused RTV and committed-resource details; failed ExecuteCommandLists names its vulkan_replay.h line (on by default, test-branch lines). - LEONIDA_SLOW_STARTUP=1: guest Sleep of 1-2.1 s lasts 2.1 s, so the startup hang check never counts (hides hangs). - LEONIDA_XG_NO_COPY=1: texture computer slots 8/9 copy nothing. Co-authored-by: VibeClauding <360230414+VibeClauding@users.noreply.github.com> Co-authored-by: Rüzgar Koray Genç <koray_genc1@hotmail.com> Co-authored-by: oscarlosu-lab <251827664+oscarlosu-lab@users.noreply.github.com> Co-authored-by: Mumogg <104529023+Mumogg@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Retail check of the texture computer on a second native-Windows machine, which also shows that the title really calls it. Windows 11, RTX 5070, driver 617.14, Stack without this pull request: The same stack with this pull request merged on top (clean merge): 464,933 What I did not check: AI-assisted: yes (Claude Code, Sonnet 5.5) |
SweatierKey
left a comment
There was a problem hiding this comment.
Independent verification on Windows 11 against origin/main@1504c1af6:
- Cross-compiled
xg_xs_test.exe(clang-cl+ xwin SDK 10.0.26100) and ran natively on Windows 11:106 checks, 0 failures(rc=0), including layout/offset/copy/tiling checks and stub-computer compatibility for unmodelled descriptions.
python3 -I scripts/check_no_game_data.py: clean.
AI-assisted: yes
|
Overlap note: #984 (RT-PROTON-STORY-LOAD, the integration branch that boots through the story load) carries its own I have no preference for which one stays. If #984 is carved into smaller PRs and its texture computer goes in, I'll close this one; if this one goes in first, its layout model and |
|
Windows result for this PR on the frame-loop stack of #321 (head e0d4fd2 with three small local changes: the Baseline, #321 alone: every frame has two of its three command lists refused ( With this PR's commit (71e2cb90b) cherry-picked on that base, two runs gave 0 and 22 refusals, so on its own it does not remove them every time. With #489 added on top (de191a9), the run had 0 refusals, 68 The picture does not change: the seven frames dumped in that last run ( AI-assisted. |
…first-run UI Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic. The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
Claimed in the coordination issue as: RT-XG-TEXTURE-COMPUTER
Summary
Implements the console texture layout model and
XGCreateTextureComputer/XGSuggestSwizzleModeinruntime/shims/xg_xs.cppon top of a GFX10 texture layout model (runtime/src/console_texture_layout.h), replacing the previousE_NOTIMPLstubs:0(AddRef),1(Release),2(layout structure),6(element offsets),8(copy into subresource),9(copy from subresource), and10(64 KiB tiling), while unsupported slots log once and returnE_NOTIMPL.*outalongsideE_INVALIDARG(preserving compatibility with measured callers that ignore theHRESULT).E_NOTIMPL).Attribution
Marvisak/VIctory(GPL-3.0),crates/victory-formats/src/texture.rsandcrates/victory-hle/src/modules/xg.rsatd2a4bae1f, credited in the file headers; AMDaddrlibMIT notice preserved.Verification
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo --target gta6rt xg_xs_test) on Windows 11, MSVC 19.52 x64 (VS 2026): 0 warnings in the touched files.xg_xs_test.exe:106 checks, 0 failures(hand-checked addresses, mip tails, two-plane depth-stencil, bijection/round-trip across 10 layouts, and shim slot routing).ctest -R xg_xs:1/1 Test #50: xg_xs ... Passed (0.19 sec).python -I scripts/check_no_game_data.py&python -I tests/test_docs_links.py: PASS (16/16 OK).AI-assisted. No game files.