cpu: draw BC7 pages requested by a recompiled archive reader #1324
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1331"
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 R0Y00 on 2026-11-24T08:18:32Z.
Refs #1198 and #870. Follows #1323 and the archive texture comparison in #830.
Move the two source range calculations into a Zig 0.13 executable compiled with the repository's existing archive-reader build. Its internal function reads adjacent RDS5 boundary words and computes the absolute file offset and compressed size, accounting for the stored padding. The EXE invokes this function twice. The native and mapped PE and the statically translated EXE all call the same Windows provider DLL. The provider submits both requests to a single XCRDAPI file queue, reads both statuses, uploads the decoded pages as one BC7 texture, then draws and reads back the image using the existing QuadFrames renderer.
The two synthetic files contain 1 and 16,384 ETPF records. First and second pages have different compressed lengths. Adding 896 KiB to just the first offset selects a valid equal-length alternate stream. All three runners see the changed top half of the output with the bottom half intact (8,192/16,384 pixels). Selecting EOF instead returns exit 6, preserves the first 4 KiB destination and still decodes the second; no frame is emitted. Each successful draw requires the same adapter description, full RGBA readback, fence 1, exit 0 and zero remaining device references.
Windows 11 26200.9974 x64, Release
b4227960, NVIDIA RTX 4060 Laptop GPU 32.0.16.1656 and WARP 10.0.26100.9818. Across both adapters: 36 executions and 24 checked frames, zero skips. Two new CTests and three existing storage/reader regressions passed, 5/5. Markdown link check passed, 293 links.All archives and images are generated by the fixture. The offset control is supplied explicitly to the caller. The source of an unexpected offset in another caller remains open.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:27:16Z.
Review: COMMENTED
Reviewed PR #1331 at commit
b4227960aa93c1b0de9f6af13d3056f871bb846c.Verification
tests/docs_links_check.py: passed (16 Markdown files, 293 links).tests/bidi_controls_check.py: passed (1102 tracked files).tests/cpu/archive_directory_gpu_check.py: Windows-only (startup_xg_bc7_layout_check.pyusesctypes.WINFUNCTYPE).--preset dev):archive_directory_gpu,archive_directory_lifted,pe_map,startup_stub_consumerbuilt cleanly;ctest -R '^(cpu_archive_directory_gpu_warp|startup_storage_directory_batch)$'2/2 passed (startup_storage_directory_batch0.15s,cpu_archive_directory_gpu_warp3.60s)./O2(--preset release): built cleanly; 2/2 passed (startup_storage_directory_batch0.14s,cpu_archive_directory_gpu_warp3.61s).Code Findings
tests/cpu/archive/directory_gpu.cpp(directory_input) reads the binaryuint64_tfirst_biasviastd::fread(&inputs.first_bias, sizeof(Word), 1, stdin)without settingstdinto binary mode (_setmode(_fileno(stdin), _O_BINARY)). Under MSVC's default text mode, any future bias containing0x1aor0x0d 0x0awould be truncated or translated (the current test biases0,0xe0000, and the aligned EOF offset are unaffected).CloseBatchreleases COM objects and closes the trace file on all paths,native/pe_map/AOTrunners match ranges, statuses,0xa5destination preservation on EOF, fence1, release refcount0, and rendered BC7 pixels.