Size read-only console textures in the title's swizzle mode (RT-XS-CONSOLE-PLACEMENT-TITLE-LAYOUT) #2516
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2516"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-28T00:09:41Z.
Claimed in the coordination issue as: RT-XS-CONSOLE-PLACEMENT-TITLE-LAYOUT (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230686328). Found by @kevincommits, item 2 of https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230381887. Thanks for the clear repro.
What and why
Device slots 25 (
GetResourceAllocationInfo) and 108 (GetResourceAllocationInfo2) size the title's descriptions from their PC form (pc_resource_desc). The PC form drops the console layout word (0x100 | swizzle mode) to 0, soconsole_placementgets the title's own array astitle_descsfor the words it lost. The unordered-access rule (console_unordered_access_size) already read the layout fromtitle_descs.console_texture_layout, the rule for a texture only the CPU fills (no render-target, depth-stencil or unordered-access flag), read it from the PC form. So such a texture was sized in XG's default swizzle mode, not the one the title named:0x109(SW_64KB_S)0x100(linear)The rule exists because the title reads exactly the size it was given for such a texture from its archives, so a size too small is a real fault.
Fix.
console_texture_layouttakes the layout word as a parameter.console_placementpasses(title_descs ? title_descs : descs)[i].Layoutat both of its uses, andapply_console_placementdoes the same at its third. Whendescsis the title's own array (slot 56, or a PC-form call) nothing changes. The flags and everything else still come from the PC form, as before.Tested
xs_proxy_mock_test(CPU only, synthetic descriptions, no GPU or game data), incheck_render_target_sizes:mainthe first new check fails (info.SizeInBytes == 65536 && info.Alignment == 65536); with the fix the whole test passes (exit 0)./W4), Release; no new warnings.GPUs tested: n/a (CPU mock).
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).d3d12_xs_alloc_size.h(guards and duplicate passes), not where the layout word comes from. #2029 edits the sameany_targetloop, so whichever lands second needs a small merge there.🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T00:53:18Z.
Independently checked head
c05dc2ff5on Windows 11 Pro 26200, MSVC 2022 (19.44.35230.0, RelWithDebInfo, Ninja), no game files.Local build & test verification:
xs_proxy_mock_test(confirmedapply_console_placementcompiles cleanly withtitle_descsin scope).xs_proxy_mock_test: PASS (12 allocations refused on purpose).Code review notes:
1for row-major,0x100 | modefor swizzle modes, otherwise falling back to XG's default) strictly for non-RT/DS/UAV textures and keeping the PC answer when XG refuses looks clean and safely scoped across bothconsole_placementandapply_console_placement.1) case, a mip chain or array texture in a swizzle mode, and an invalid/unknown layout word confirming fallback to XG's default.Overall looks clean and solid. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T09:28:07Z.
Review: APPROVED
Reviewed the diff and tested merged onto
main(493867366) with Ninja Release (MSVC).Passing the title's original layout word (
(title_descs ? title_descs : descs)[i].Layout) intoconsole_texture_layoutin bothconsole_placementandapply_console_placementcleanly preserves swizzle-mode sizing for CPU-filled console textures across slots 25 and 108.Tests run
ctest --output-on-failure -R "^xs_proxy_mock$": 1/1 passed (2.64 s).AI-assisted (Antigravity, Gemini).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T09:52:17Z.
#2516 | head
c05dc2ff52(merged cleanly with main3ca0707dde) |ctest --test-dir runtime/build -C RelWithDebInfo -R "^xs_proxy_mock" --output-on-failure| red on main:xs_proxy_mock_testfails (line 3057: info.SizeInBytes == 65536 && info.Alignment == 65536—console_texture_layoutignored the title's swizzle/linearLayoutword afterpc_resource_descstripped it, sizing a64x64BC70x109texture as4096 Binstead of65536 B) | green on PR+main:9/9xs_proxy_mock*CTests pass (xs_proxy_mockin2.67splus all 8 slot/reserve/protect/layout variants);check_no_game_data.py0violations | Windows 11, RTX 3090 (610.88), Vulkan SDK 1.4.363.1 | AI-assisted: yesImported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:03:43Z.
Verified by OreoFR
Run 1 (lot 4)
09c153948+ PR headc05dc2ff5; integration package 3 of 6 (4 PRs, merged without conflict)Run 2 (lot 4 bis)
33db04a70+ PR headc05dc2ff5; integration package of 15 PRsAll runs
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:46:47Z.
Run on PR head
c05dc2ff5(based44285197, 1 commit; the base is old), checked against main1bc055e6c(and origin/mainc7753ed98):git merge-tree --write-treefinds no conflict with either.Environment: NVIDIA GeForce RTX 3090 (24 GB), driver 621.40, Windows 11 Pro (build 26300), MSVC 14.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo, SDL3 3.4.20 static installed. CPU tests only.
Configure (as scripts/build_runtime.ps1 does, own build folder):
cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON. Only the test target was built, not the whole runtime:cmake --build runtime/build -j 8 --target xs_proxy_mock_test.Green (PR head):
ctest -R "^xs_proxy_mock" --output-on-failure-> 9/9 passed (xs_proxy_mock2.64 s).Red (behavioural; no new header, the new checks are in
check_render_target_sizes):runtime/shims/d3d12_xs_alloc_size.handruntime/shims/d3d12_xs_device.cppput back to based44285197, test kept, rebuiltxs_proxy_mock_test,ctest -R "^xs_proxy_mock$"-> failed:line 3057: info.SizeInBytes == 65536 && info.Alignment == 65536(the first new check, the one the PR description names).Link check: merged into main
1bc055e6c, gta6rt.exe builds and links (RelWithDebInfo, MSVC 19.44); no new imports vs main.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T01:04:41Z.
Merged after enlight3d (Thib)'s red/green run (RUN, RTX 3090, driver 621.40, Windows 11: green with this PR, red without it, and
gta6rt.exestill links) and a re-check here: no conflict withmain193a69286, same head as run,no-game-datagreen, and the only ctest failures in the Windows/macOS CI jobs are tests this diff does not touch (known onmainor Vulkan: vk_xdxr_postbuild_readback vk_bindless_dimensions d3d12_compile_pool xbox_present ).AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T17:02:51Z.
Independent check on Windows (not the author), at
c05dc2ff5.xs_proxy_mock_testand ran it: PASS (12 allocations refused on purpose), including the bundle/state carry-over, cross-queue ordering, timeout back-off, deferred page remap and non-tearing value-store cases.Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711.
AI-assisted: yes (opencode).