Trace each CopyTextureRegionX location by its active type #67
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!67
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/67/head"
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?
@philip-roy-jones on GitHub · 2026-11-21 22:38 UTC · original
fix/d3d12-copy-location-trace→main· +32 −7 · 1 files · 1 commits · closed without mergingLibrary / area:
d3d12_xs, Scarlett command-list slot 83 (CopyTextureRegionX).Exports changed (exports.txt rows): None.
Source of the behaviour: Each
D3D12_TEXTURE_COPY_LOCATIONhas its ownTypefield selecting a subresource index or a placed footprint. The original trace assumed the destination was always a subresource and the source was always a footprint. An RGBA8 readback put the footprint on the destination and exposed the reversed interpretation. Microsoft's structure definitionThe trace now reads the active member separately at each endpoint. An unknown type prints its tag. The regression covers a nonzero subresource index, a footprint offset above 4 GiB, distinct dimensions and an unknown type.
Guest evidence
I replayed the same x64 guest executable and shader blobs on upstream main and this commit. In both cases
mdbglaunched the guest, which calledD3D12XboxCreateDevice, drew into a 16×16R8G8B8A8_UNORMtarget, copied it to a buffer with a 256-byte row pitch, waited for its fence and mapped two pixels. The control omitted onlyDrawInstanced(3, 1, 0, 0). The guest reported Microsoft Basic Render Driver (1414:008c).00 ff 00 ff00 00 ff ff00 00 ff ff00 00 ff ffThe actual copy traces below omit the process-specific resource addresses.
The guest fixture extends the launcher in #59 and lives on a separate fork branch. Its authored gfx1030 vertex and pixel shaders were assembled with LLVM, translated by
tombox-xshaderand compiled by SDK DXC to shader-model-6.0 DXIL. Each draw/control launch used a fresh cache and recorded two translated stages and one successful PSO. The Rust regression in this PR runs directly on upstream. Guest fixture and runner at20f0fc7Windows x64 verification
An x64 Visual Studio developer shell had stable MSVC Rust 1.100.0, LLVM 19.1.7 with the AMDGPU target, and Windows SDK 10.0.26100.0. The following commands built and tested the compared revisions.
Both builds passed. The unfiltered suite had 408 passes on main and 409 on this branch, with the same 37 ignored and two failures on each. FXC rejected
uint64_tin the centroid test. The per-sample test recorded 4,160 base invocations against 4,096 expected. The filtered runs passed all remaining unit tests and both process-debug integration tests. The focused regression and whitespace check passed.I also rebuilt upstream
e843998f0db8d59397eedd0df517b007a2b347a7after the PR opened. It changed documentation and progress files. Its two launches (PIDs 2972 and 30260) returned the same four pixels and both children exited 0.To reproduce the guest evidence, run
python tools/verify/run_d3d12_guest.py --triangleon the linked fixture commit. For each runtime under comparison, copy its builttarget/debug/d3d12_xs.dllbeside the staged guest and run these commands from that directory. Use a fresh directory for each cache.cargo test -p d3d12_xspasses (the same two baseline failures reproduced).Pull request closed