startup: answer XG slot 10 for layout 0x10a from a 64 KiB tile plan #1547
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1554"
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 R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-24T13:53:00Z.
Change
XG texture-computer slot 10 (the tiling query) now answers a two-dimensional texture with layout
0x10afrom a small tile plan,src/startup_stubs/tile64_plan.h, instead of a desktop reserved resource.The rule:
Tile shapes: 512×256 texels for 8-byte blocks, 256×256 for 16-byte blocks and 8-bit formats, 256×128 for 16-bit formats, 128×128 for 32-bit formats with 8-bit channels. Other formats, other layouts (including the existing nine-mip
0x109shapes) and three-dimensional textures are answered as before.Why
A desktop reserved resource puts the largest mip at tile 0 and the packed tile last. For a 2048×2048 BC7 texture with ten mips it reports standard mips at tiles 0, 64, 80, 84 and the packed tile at 85. The plan reports the packed tile at 0 and the standard mips at 22, 6, 2, 1. The nine-mip
0x109values already in the repository (6, 2, 1 in a 22-tile slice) are what the same rule gives for those sizes.A console executable that streams texture levels from a pool uses the slot-10 start of a level as that level's place in the pool. With the desktop order every level is looked for at the wrong place. That is the large
zlib failedclass in #1198: requests for a whole, valid compressed chunk at its file offset plus a constant multiple of 64 KiB. The two constants seen there,0xE0000and0x3A0000, are the distance between a level's desktop start and its pool position for a 1024-wide and a 2048-wide BC7 texture.Refs #1198
What was measured
The rule against pool files. Texture pool files of one console package, read with the
boundary()and descriptor parsers oftools/texture_descriptors.py. A pool stores each level of a texture as its own chunk, smallest first, and each texture record carries size, format, slice count and the split between standard and packed mips. For 39,283 texture records in 57 pool files (179 distinct combinations of size, format, slice count, mip split and level sizes; 18 formats) the rule reproduces every level's size in tiles, with no mismatch. The number of standard mips the rule gives, capped at three, equals the record's own count in every case. The package is not distributed; the fitting script is local and I can put it in a follow-up PR as an offline tool if that is wanted.One executable, before and after. Startup debugger, scripted first-run input, clang-cl build under Wine 11.0 with vkd3d-proton, RTX 4070 Ti SUPER (550.163.1). Both builds are
mainatbb6c9a0cwith #1429 and #1390 merged in and the local prefix switch described in #1198. The executable made 177 distinct slot-10 queries, all two-dimensional, layout0x10a.zlib failedThe runs with the plan used the trial build, which is this change on the older base. The branch itself is rebased on current
mainand was only run through the tests below.Tests
startup_xg_tile64_tiling(new): 18 shapes, 120 queries. It checks the tile total, the packed-mip record, the tile shape, the standard-mip entries at their positions in the requested range, array slices, and sentinel bytes over packed entries and the rest of the caller's array. The expected values are written out in the test and recomputed there by a separate Python model. Control: the desktop order for the 2048×2048 case must not be what comes back.Run directly under Wine against the cross-built DLL (I have no CTest run on Windows):
Against a build without the change the new test fails on the first shape:
docs_links_check.pyandbidi_controls_check.pypass.docs/experiments.mdhas a new section after the nine-mip one.Not verified
0x109beyond the two nine-mip shapes. It is left on its current paths.bcpack failedrequests remain (135 by 250 s). Both are separate from this change.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:14:14Z.
Verified
be98528aon Windows x64 with MSVC 19.51 in Release. After building startup_stub_xg_xs, ctest --preset release --no-tests=error -R "^startup_xg_(tile64_tiling|bc_tiling)$" passed both tests with zero skips. That covers the slot-10 tile query and the existing BC tiling regression. The startup comparison in #1198 is separate contributor evidence.