D3D12.X: the console's acceleration-structure resource flag becomes UAV, not a video flag #3141
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3141"
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 ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T13:01:41Z.
Status: a guess that needs evidence before it can be merged. That console resource flag 0x80 is a raytracing acceleration-structure buffer is reasoned from how titles call the API and from the PC's D3D12; it is not taken from any console documentation, and no title has confirmed it yet. Draft until then.
Evidence that would confirm it: a title that creates a buffer with flag 0x80, and what it does with that buffer (builds an acceleration structure into it, or binds it as one). The retail game used for the regression run does not get there.
If you run a title that gets there, please post those lines here (not the whole log, which names your paths).
The console's resource flag 0x80 is a raytracing acceleration-structure
buffer; the PC's 0x80 is a video-encode reference. pc_resource_desc and
sanitize_coherent_buffer kept the low byte (flags & 0xFF), so a console
acceleration-structure buffer reached the PC as a video-encode buffer, which
the PC refuses for a buffer or treats as a video resource.
pc_resource_flags keeps 0x1-0x20, maps 0x80 to ALLOW_UNORDERED_ACCESS (an
acceleration-structure buffer needs it for its state on the PC) and never
forwards 0x40, 0x80, 0x100, 0x200 or the console-only bits above. Not
confirmed on a title: whether the creations fail or are accepted as video
buffers (the handoff's logging step).
What is in it
crates/xcl/src/hle/d3d12x/device_x.rs: +22 / -1crates/xcl/src/hle/d3d12x/real.rs: +1 / -1new tests:
console_resource_flags_map_to_pc_onesTested
NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0 MSVC; tests in debug
cargo test --workspace --no-fail-fast -- --test-threads=4on9c89e410(built onmain336fddda; it merges into the currentmaine429936cwithout conflict): 2123 passed, 9 failed, 48 ignored, 25SKIPPEDlines (21 no wave64, 3 #1426, 1 no heap windows).The 9 failures are the ones
mainhas (3e2etitle tests and 6 split-wave64 GPU tests, #3093:main336fdddagives 2122 passed, 9 failed, 48 ignored); the set of failing tests is identical to it.console_resource_flags_map_to_pc_ones: ok in that run; fails without the changeRegression run
Both 60-second runs used the same warm DXIL cache directory.
Not tested
Full preparation. The smoke runs used
XCL_PREPARE=0.Whether a console creation with flag 0x80 fails on the PC today or is accepted as a video buffer: not confirmed (needs logging on a title that creates acceleration structures). No GPU test of an acceleration-structure buffer.
A console desc with 0x80 on a depth texture gets the UAV flag back after the depth step strips it (acceleration structures are buffers).
AMD and Intel GPUs; wave64 hardware (the RTX 2070 SUPER is wave32).
AI use
Codex (exact model name unavailable) verified the queued smoke results and drafted this description update.
patch-worker on Claude Sonnet 5.5 (self-reported); reviewed by Claude Opus 5.5: the code and tests. The description and the test / suite runs: Claude Code, Claude Sonnet 5.5 and Claude Opus 5.5.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:35:29Z.
Triage (#1607) – head
0da61c6No open or merged PR changes how the console's resource flag 0x80 is mapped; on main
pc_resource_descandsanitize_coherent_bufferpass it through as the PC's video-encode flag (& 0xFF).device_x.rs
pc_resource_desc:pc_resource_flagsruns after the depth and texture-format UAV filters, so a texture carrying 0x80 would get ALLOW_UNORDERED_ACCESS back after they removed it. That is harmless if 0x80 only ever appears on buffers (acceleration structures are buffers), but applying the mapping before those filters would be safer.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:10:57Z.
Review (head
0da61c6, diff read, not a merge-check; draft,PR descriptionred: the smoke blocks name9c89e410):pc_resource_flagsmaps 0x80 to ALLOW_UNORDERED_ACCESS (device_x.rs~881). It runs when the flags are written (~873), after the depth filter (~859) and the format / multisample filter (~867) have taken 4 out. A depth buffer, or a texture whose format can't be a UAV, that carries 0x80 gets ALLOW_UNORDERED_ACCESS back, and the PC refuses it (E_INVALIDARG; the 599 / 0x887A0001 case the comment above describes). Applying the mapping before those filters avoids it. Whether 0x80 ever appears on textures is unknown.use super::*;(~1471). #3414 rewrites the same flags code.Fine: 0x1-0x20 pass through unchanged, and
sanitize_coherent_bufferuses the same helper.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-12-02T15:10:03Z.
@Foniass fixed:
pc_resource_descnow maps the flags withpc_resource_flagsfirst, so the depth filter and the format / multisample filter see the UAV flag a console 0x80 turns into, and take it out again (device_x.rs). New testa_console_0x80_does_not_bring_back_a_filtered_uav_flag: a D32 depth buffer with 0x82, a BC1 texture and a 4x MSAA texture with 0x80 end up without ALLOW_UNORDERED_ACCESS, and a buffer keeps it. It fails on the previous head. The nit is fixed too:use super::*;is now at the top of the test module. New head7747e07b(rebased ontomaindf0cfef6). 0x40 no longer reaching the PC is the PR author's call. How the slot / field meanings were obtained is a question for the PR author, who will answer it here; I have not changed them.— Claude Code (Claude Opus 5.5), on behalf of the PR author
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T15:11:37Z.
Follow-up review (head
7747e07b, since0da61c6, diff read, not a merge-check; draft, checks red):pc_resource_desc(device_x.rs), so a console 0x80 on a depth buffer, a block-compressed or a multisampled texture no longer brings back the UAV flag the filters take out, with a test (a_console_0x80_does_not_bring_back_a_filtered_uav_flag).New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.