Skip to content

D3D12.X: the console's acceleration-structure resource flag becomes UAV, not a video flag - #3141

Draft
KOLESNiii wants to merge 1 commit into
xcl-dev:mainfrom
KOLESNiii:d3d12x-console-resource-flags
Draft

KOLESNiii wants to merge 1 commit into
xcl-dev:mainfrom
KOLESNiii:d3d12x-console-resource-flags

Conversation

@KOLESNiii

@KOLESNiii KOLESNiii commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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 / -1

  • crates/xcl/src/hle/d3d12x/real.rs: +1 / -1

  • new tests: console_resource_flags_map_to_pc_ones

Tested

Regression run

Both 60-second runs used the same warm DXIL cache directory.


xcl-smoke v1

commit: 336fdddafbcb3c3db753629f5f79a9f44b6c4b9d

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1228 (PresentX 1228)

presents per 2 s (last 3): 61 60 60

device removals: 0

crashes: 0

peak commit: 15234 MB


xcl-smoke v1

commit: 9c89e410b6cffbc80302812565219ccb3a6372b2

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1464 (PresentX 1464)

presents per 2 s (last 3): 60 60 60

device removals: 0

crashes: 0

peak commit: 15474 MB

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

…AV, not a video flag

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).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KOLESNiii
KOLESNiii force-pushed the d3d12x-console-resource-flags branch from 2f5ecdc to 0da61c6 Compare November 29, 2026 20:56
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 0da61c6

No open or merged PR changes how the console's resource flag 0x80 is mapped; on main pc_resource_desc and sanitize_coherent_buffer pass it through as the PC's video-encode flag (& 0xFF).
device_x.rs pc_resource_desc: pc_resource_flags runs 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.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Review (head 0da61c6, diff read, not a merge-check; draft, PR description red: the smoke blocks name 9c89e41):

  • The UAV flag comes back after the filters that remove it. pc_resource_flags maps 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.
  • A default-path change for every title. 0x40 and 0x80 are no longer passed through; on main, 0x40 reached the PC as its video-decode flag.
  • The meanings aren't backed by an observation. 0x80 as an acceleration-structure buffer, 0x100 / 0x200 as texture-compatibility flags, and 0x40 as console-only (~877-880) cite no title call; HANDOFF records only high bits (0x300005, 0x20004). Please say how they were obtained.
  • Nit: the new test sits above use super::*; (~1471). D3D12.X: sanitize PC resource flag invariants in pc_resource_desc #3414 rewrites the same flags code.

Fine: 0x1-0x20 pass through unchanged, and sanitize_coherent_buffer uses the same helper.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants