cpu: draw each completed archive record through D3D12 #857
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/863"
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 lukaslw-lab on 2026-11-23T14:32:41Z.
Change
Connects the archive texture handoff from #850 to D3D12. Refs #830.
The same Zig reader image runs against a GPU consumer (
tests/cpu/archive/texture_gpu.cpp), built asarchive_codec.dllinarchive_gpu/next to copies of the reader and blast. The AOT reader links a GPU build of the codec with the translated decoder. One device, queue and pipeline serve both records. Each completed record uploads its 4×4 RGBA8 texture, draws a point-sampled quad onto a 16×16 target, signals and waits for its own fence value, and reads the frame back.QuadFrames(quad_frames.hpp) holds the device and frame state. It accepts any copyable texture size and format.Shared interfaces touched:
texture.hppaddsfinish_archive_textures(), whichcodec.cpp'scompleted()calls once after the last record so GPU objects are released at a defined point rather than at DLL detach. The stdout consumer's version is empty, so #850's output and test are unchanged. The Zig reader is unchanged.tests/cpu/shim_gpu_device.h(#814) gains a non-throwingshim_try_create_device()andshim_report().shim_create_device()now wraps them with identical behavior. Allcpu_shim_*tests pass.Verification
Commit
3fb24dc(rebased on223a908) on Windows 10 22H2 (build 19045), Visual Studio 2026 18.12 (MSVC 19.52), Windows SDK 10.0.26100, Python 3.13.7. Adapters: Microsoft Basic Render Driver (in-box WARP, driver 10.0.19041.7811) and NVIDIA GeForce RTX 3080 Ti (driver 32.0.16.1047). D3D12 debug layer not enabled.The two skips are
cpu_shim_chain_warpandcpu_shim_shadow_warp, which need mesh shaders that this Windows 10 in-box WARP lacks. They skip identically onmain.cpu_archive_texture_gpu_warpandcpu_archive_texture_gpu_hardwareeach run six cases under native Windows,pe_mapand AOT (18 runs per adapter). All runs must report the same adapter and driver. Frames are compared per pixel with an independent CPU reference (pixel(x, y)= texel(x/4, y/4)); a mismatch names the first differing pixel.gpu release 0, exit 0stale: second upload skippedupload skipped, exit 0fail: second texture one byte shortgpu release 0, exit 4leak: one device object never releasedgpu release 1python -B tests/docs_links_check.py(177 links),python -B tests/bidi_controls_check.py(700 files) andgit diff --checkpass. The fulldevsuite is still running; I'll post its result as a comment.Evidence and follow-up
tests/cpu/archive_check.py; the texture rule is #850's.staleshows a missed upload is detected,leakshows the release count detects a leaked device object, andfailand both truncated cases cover cleanup and exit status on each failure path.alloc/input/output/freeevents are part of the exact trace.pe_maprun the codec DLL is mapped, and a C++ exception thrown and caught inside it escaped as0xE06D7363, while the same DLL loaded by Windows caught it. A standalone 15-line DLL shows the same:catch (int)andcatch (...)fail when mapped,__try/__exceptworks, andRtlPcToFileHeaderreturns NULL for the mapped image. I'll open a separate issue with that repro.Checklist
AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T14:35:59Z.
I built the Zig reader and GPU codec and ran both GPU CTests plus the original texture publication check. All 18 cases matched on each of WARP and RTX 4060 Laptop, including the two fences, truncated input, stale upload, incomplete texture and retained device-reference controls.
I tightened hardware capability detection in the test harness. Only the initial hardware probe can skip with exit 77. Once that probe finds a device, 77 from any runner is a failed comparison. A synthetic child-process check exercised both paths and the three local CTests passed. Windows CI is rerunning on this head.