cpu: test XG swizzle mode selection and texture computer layout #1027
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1034"
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 Holastor on 2026-11-23T22:18:26Z.
Refs #870.
Refs #1032.
This fixture provides the PE loader, refusal sentinel, and import-withholding test angle for the swizzle mode selection and texture computer layout integration in
xg_xs.dll, alongside #1032 (whose full 8-mip 21,845-texel layout reference uses pinned PC AddrLib from #979):XGSuggestSwizzleMode(desc, flags, out_layout): evaluates resource descriptors and suggests swizzle layouts.XGCreateTextureComputer(desc, out_computer): instantiates an address computer (IXGTextureComputer) for subresource layout, texel address calculation, and tiling/detiling copy operations.Scope & Call Sequence
Public call shape follows DirectXTex usage and public GDK issue references (DirectXTex #498):
XGSuggestSwizzleModeevaluates aD3D12_RESOURCE_DESCwith an unknown input layout (D3D12_TEXTURE_LAYOUT_UNKNOWN = 0) and selector flag0.Layoutfield (&desc.Layout), verifying both produce matching layout results (0x105per fixture policy).XGCreateTextureComputer.CopyIntoSubresourceuploads a generated 3-mip RGBA8 texture (28x4, 14x2, 7x1 = 147 texels) into tiled memory.CopyFromSubresourcedetiles all 147 texels back to linear memory with 100% round-trip fidelity.Layout = 1(ROW_MAJOR) verifies 0 disagreements against linear layout.Contract boundaries & Qualifications
XGSuggestSwizzleMode(desc, 0, &out)with separate and aliased output pointers, feeding the resulting layout intoXGCreateTextureComputer(desc, &comp)for subresource copying.xg_xs.dllis a fixture choice.0x105,0x100) and the Morton bit-order oracle are fixture policy for testing caller/provider interaction; see #1032 for the full texel reference using pinned PC AddrLib. Console-specific hardware encoding and non-zero flags require independent evidence before binding a production export.Width == 0returnsE_INVALIDARG(0x80070057) leaving the output pointer/sentinel intact.cpu_xg_swizzle_provider_clobbertests refusal sentinel overwrite (specific exit0xE01), andcpu_xg_swizzle_provider_lineartests dummy linear fallback where tiled texels are copied without swizzling (specific exit0xE04).pe_map. Withholdingxg_xs.dllhaltspe_mapat import resolution withSTATUS["unresolved"].Evidence
devpreset:ctest --preset dev --no-tests=error -R '^cpu_native_xg_swizzle$' --repeat until-fail:30passed 30/30 runs (~0.19s per run).releasepreset:ctest --preset release --no-tests=error -R '^cpu_native_xg_swizzle$' --repeat until-fail:30passed 30/30 runs (~0.19s per run).0x870.0x870.0x870.0xE01.0xE04.xg_xs.dll: verifiedSTATUS["unresolved"]with diagnosticunresolved import xg_xs.dll!.docs_links_check.py,bidi_controls_check.py,hardware_reports_check.py,form_coverage_check.pyall passed.AI-assisted (Antigravity).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T22:26:43Z.
This adds a useful loader/import-withholding angle alongside #1032, whose full texel reference uses pinned PC AddrLib. Please keep the PE loader, refusal sentinels and missing-provider checks here, and explicitly call the hand-written layout and Morton oracle fixture policy. The small Morton round-trip is an additional caller/provider check. Do not use it as an independent match to #979 or as evidence of the console layout encoding. Please link #1032 so the swizzle-selection and loader evidence stays easy to follow.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T22:34:00Z.
Thanks for the review and guidance! Updated in
d0d6f4d3and updated the PR description:Refs #1032).E_INVALIDARG, output pointer preserved), and missing-provider checks (STATUS["unresolved"]) as the primary focus of this fixture underpe_mapand Windows loader.0x105,0x100) and the 147-texel Morton bit-order oracle as synthetic fixture policy for the caller/provider handshake check. Noted that the full 8-mip 21,845-texel layout reference using pinned PC AddrLib is in #1032, and clarified that the small Morton round-trip is an additional caller/provider check, not an independent match to #979 and not evidence of console layout encoding.All 30/30 runs pass in
devandrelease, and all repo lint/docs checks pass.AI-assisted (Antigravity).