d3d12_xs: strip buffer-only read states from texture barriers and initial states #18
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!18
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/18/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?
@QuentinDanblon on GitHub · 2026-11-21 17:30 UTC · original
QuentinDanblon:fix/texture-barrier-buffer-states→main· +192 −42 · 5 files · 2 commits · closed without mergingLibrary / area: d3d12_xs (resource barriers, resource creation states)
Exports changed (exports.txt rows): none
Source of the behaviour: PC D3D12 accepts VERTEX_AND_CONSTANT_BUFFER (0x1) and INDEX_BUFFER (0x2) only on buffers. Ported from brcly/TomBox (crates declare MIT OR Apache-2.0), GDAgent: dde663f and barriers.rs.
Xbox titles transition textures with the 0x3 bits set (render-target reads 0x8c3, GENERIC_READ 0xac3) and also pass them as creation states. On PC, command-list Close fails and the device is removed. At
226938c,xone_barrier::sanitizeonly stripped 0x400000 and turned aliasing barriers into UAV barriers. The graphics path (cmdlist_x.rsresource_barrier_x) andCreateCommittedResource/CreatePlacedResource/CreatePlacedResourceXpassed the bits through. The copy queue was already safe (dma_list.rscopy_legal_barriers).Changes:
xone_barrier.rs: a purerewrite()drops 0x3 from both states of a transition on a non-buffer resource (GetDescslot 10, same ABI ascl_ext.rs/present.rs). It removes transitions that the rewrite collapses to before == after. It keeps the title's own no-op transitions, split flags, subresource, opaque barrier bytes and order. It allocates only on the first change.resource_barrier_xand thecmdlist_validatereplay use the rewritten (possibly shorter) count. An empty batch is not forwarded.initial_state(dim, s), sogpu_va,placed(upload.rs barriers) andrtcaptrack the same PC-legal state.COND_POOL_TEST.cargo test -p d3d12_xs --libdid not compile at226938c(E0425 in gpu_wait.rs:666,720).Tests:
cargo test -p d3d12_xs xone_barrier: 6 passed. They cover a mixed batch (order, flags, collapse, opaque bytes, input untouched), a fully collapsed batch, a clean batch left untouched, aliasing, and the 0x400000 strip. Fullcargo test -p d3d12_xs: lib 237 passed, 6 ignored (hw); process_debug_off/on passed. Not run against a title; I don't have one.Build note: a fresh checkout of
226938cdoes not build d3d12_xs.compat-common/backend_data/*is not in the repo, andquery_accum.dxilneedsTOMBOX_DXC_DIR. I built with local placeholders, which are not committed.cargo test -p d3d12_xspassesmissingwith a note@QuentinDanblon on GitHub · 2026-11-21 21:03 UTC · original
Merged in the source sync
1159c96(adapted). Thanks! Closing.Pull request closed