D3D12.X: promote R9G9B9E5_SHAREDEXP render/UAV targets to R11G11B10_FLOAT #605
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!605
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/605/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?
@0x6461726B on GitHub · 2026-11-24 02:24 UTC · original
0x6461726B:d3d12x-r9g9b9e5-target→main· +19 −2 · 1 files · 1 commits · merged 2026-11-24 21:14 UTCIn Xbox Series S (
lockhart) mode, a retail title creates a1920x1080render target / UAV (ALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESS, flags0x300005) withDXGI_FORMAT_R9G9B9E5_SHAREDEXP(67) during startup. PC D3D12 forbids render-target and UAV flags on format 67 and failsCreatePlacedResourceXwithE_INVALIDARG(0x80070057), crashing the title (0x80000003) before presenting frames.Promoting format-67 resources with RT/UAV flags and their RTV/UAV/SRV views to
DXGI_FORMAT_R11G11B10_FLOAT(26, same 32 bpp unsigned HDR float with full PC RTV/UAV/SRV support), while keeping sampled-only format-67 textures as format 67, unblocks Series S startup without changing Anaconda behavior.What is in it
67to26inpc_resource_descwhenALLOW_RENDER_TARGETorALLOW_UNORDERED_ACCESS(flags & 5 != 0) is set, and map67 => 26inpc_target_formatand(26, 67) => 26inpc_shader_view_format(crates/xcl/src/hle/d3d12x/device_x.rs), plus unit test cases inconsole_depth_buffers_and_their_views_are_the_pcs.Tested
32.0.16.2135), Intel Core i5-10400F, Microsoft Windows 11 Pro (Build 26300),rustc 1.100.0 (0ef1bc386 2026-11-09)cargo test --workspace -- --test-threads=4(debug): 684 passed, 0 failed, 41 ignoredSKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64lockhart) smoke run (retail title, 60 s, release):maincrashed at startup (exit: 0x80000003, 2 crashes, no frame count logged); this branch ran the full 60 s withexit: 0x0, 916 frames shown (PresentX 916), 0 crashes, 0 device removals.Regression run
Not tested
no wave64skipped the two wave64 GPU tests above).R9G9B9E5precision edge cases.AI use
CreatePlacedResourceXformat-67E_INVALIDARGcrash from the log, wrote the fix and unit test expansion indevice_x.rs, ran the test suite and smoke runs, and drafted this description.github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@MesshM on GitHub · 2026-11-24 02:28 UTC · original
Test run and review of
c3d350a5729d7559d00554facc622c6d1c1b9bb6on AMD RDNA4. The branch is based on9ce2070, so I merged it onto currentmaincb868b2locally (clean merge, onlydevice_x.rs) and tested that tree.Overlap: this fixes the same Series S start-up failure as #242 (still open), the same way except for the target format: #242 makes the format-67 targets
R16G16B16A16_FLOAT(10), this PRR11G11B10_FLOAT(26). Only one of them should land; the numbers below may help pick.Tested
stable-x86_64-pc-windows-msvc, debug.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4) on the merge: 685 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 645 passed, 0 failed, 21 ignoredSKIPPED;console_depth_buffers_and_their_views_are_the_pcs(with the new cases) passesReview
R11G11B10_FLOAT does not hold R9G9B9E5's values. The description calls it "the same 32 bpp unsigned HDR float format", but the precision differs: R9G9B9E5 gives each channel a 9-bit mantissa (shared 5-bit exponent); R11G11B10 has 6-bit mantissas for R and G and 5 bits for B. Counted over every value an R9G9B9E5 channel can hold (m · 2^(e−24), m 0–511, e 0–31: 8 448 distinct values), exactly representable are:
R16G16B16A16_FLOAT, #242): 8 448 of 8 448For example 1.00390625 (1 + 2⁻⁸) is an R9G9B9E5 value and an fp16 value, but rounds in R11/G11/B10. Max values also drop (R9G9B9E5 65 408, R11 65 024, B10 64 512). So a target the title writes and reads back loses precision here; with fp16 it does not, at twice the memory (8 bytes per texel instead of 4).
The premise does not hold on every PC driver. The code comment says PC D3D12 forbids
ALLOW_RENDER_TARGETandALLOW_UNORDERED_ACCESSon format 67. On this RDNA4 card,CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)forDXGI_FORMAT_R9G9B9E5_SHAREDEXPreportsRENDER_TARGET,TYPED_UNORDERED_ACCESS_VIEWandUAV_TYPED_STORE, and a 1920x1080 RT|UAV committed resource in that format is created withS_OK(measured for #242, same machine and driver). TheE_INVALIDARGis driver-dependent (NVIDIA in the reports so far); the comment could say "some drivers".The view mappings are complete: RTVs and UAVs go through
pc_shader_view_format(resource, view), SRVs throughpc_srv, pipeline formats and clears throughpc_target_format, and a sampled-only format-67 texture stays 67, as the new test checks.Not tested: no retail title or Series S profile (I have no unpacked game), so the picture with either format was not compared on screen; no regression run, no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the value counts come from a short script over the three formats' definitions, the format support from the run on this adapter.
@yyc160 on GitHub · 2026-11-24 04:45 UTC · original
I arrived at the same fix independently a few hours ago (#651, created ~02:24 UTC alongside this one) and my PR covers two things this one does not — while this PR covers something mine was missing. Posting the deltas here since the maintainer will have to pick one anyway, and both halves are worth keeping regardless of which PR carries them.
What #605 has that #651 was missing —
pc_target_formatpromoting 67 itself. I only rewrotepc_resource_descandpc_shader_view_format, so on my branch the graphics PSO mapper still returned 67 for the retyped resource (verified independently by @CryingLaughing on an RTX 4080 in the #651 thread). I've added the same67 => 26line topc_target_formatin #651 (commit42ec5f7) with the comment pointing here.What #651 has that #605 does not — two clear-value fixes found on the real title, with probe data:
A retyped resource's optimized clear value follows the new format. After the 67→26 resource promotion,
pc_clearstill mapped the title's clear value to 67, and the device refuses a resource whose clear value's format does not match — so the crash chain moved one door over instead of ending. #651'spc_cleartakes the(console, PC)resource formats and follows. Note thatpc_target_format(67) => 26alone does not fully cover this: the depth case below produces a clear value in a typeless format, which no entry inpc_target_formatfixes.A depth target's clear value in a typeless format. Console depth 118 maps to PC 44 (
R24G8_TYPELESS), and the title's optimized clear value for it arrives in format 44 — typeless — which the PC refuses outright (E_INVALIDARGunderALLOW_DEPTH_STENCIL, verified under both COMMON and UNORDERED_ACCESS initial states; the correct format is the family's DSV format 45). #651's commitb212ecbhandles the depth-typeless family (19→20, 39→40, 44→45, 53→55) and drops color-typeless clear values rather than guessing a typed format. Probe data for all of this is in the #651 thread.End-to-end result on the title that motivates both PRs (RTX 5070 Ti, lockhart, idle GPU): 21.7 s breakpoint → 27.1 s breakpoint (67's resource fixed, depth clear still broken) → 120 s clean exit, 0 crashes, both refusals gone — with #651's three commits. #605 alone would fix the first refusal; the clear-value follow and the depth-typeless case are what got past the second.
Regression runs on the same hardware are in the #651 description (main
9ce2070crashing at 21.7 s vs the branch surviving the full 120 s, pluseizispark's RX 9070 XT pass andCryingLaughing's RTX 4080 probe run above).One scope note for whoever reviews: this title reaches the 67 target only under
lockhart— underanacondait never draws at all on NVIDIA (every activity line reads0 draws, 0 dispatches; on @eizispark's AMD cardanacondarenders at 60 presents/2s). Happy to fold whatever the maintainer prefers into whichever PR they pick — the clear-value follow is a self-containedpc_clearchange and would sit cleanly on top of this branch too.@MrEjecutor on GitHub · 2026-11-24 06:27 UTC · original
Test report on Windows + NVIDIA for
c3d350a(this PR's head), Series S profile: no crash in 180 sTested
stable-x86_64-pc-windows-msvc; DXC 1.8.2505.32 (SDK 10.0.28000); releasemaine50836b+ this PR + #495 (3ae0841), merged locally without conflicts (c096040). #495 is needed on this title to get past a later assert (+0xb18de7) on the Series S profile.cargo test --workspace --release --no-fail-fast -- --test-threads=4: 705 passed, 0 failed, 41 ignored;SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwaredevice_type = "lockhart",XCL_NETWORK=0, 180 s: no refusal of the format-67 target, no assert, no device removal. Onmainthe same setup stops at+0xcc2834at 19 s (format 67,0x80070057).FORMAT_SUPPORTfirst).Regression run
From the local merge above, not from this PR's head alone.
Not tested
AI use
@volkan12a-bot on GitHub · 2026-11-24 06:44 UTC · original
Test report: retail title, a run confirming the problem this PR fixes
Not a run of this PR's head (
c3d350a): it is a run of my local patch with the same logic (format == 67 && flags & 5 != 0→ 26,pc_target_format67 → 26,(26, 67) → 26), onmain7ebf1b8.Hardware / build
cargo build --releaseWithout the fix
CreatePlacedResourceXof a 1920x1080 format 67 texture, flags 0x300005, returned 0x80070057, and the title stopped on its ownint3(0x80000003).With the fix
R9G9B9E5 target / UAV texture 1920x1080 (flags 0x300005) made R11G11B10_FLOAT.cargo test -p xcl --lib d3d12x::device_x: 5 passed, 0 failed.Not tested
smoke.ps1blocks; AMD GPUs.I post the report here because this PR has the same condition as my patch. #651 does the same with more changes around it.
AI use
@yous0serious on GitHub · 2026-11-24 09:26 UTC · original
Test report on
c3d350a(this PR's head): RTX 4090, Series X profile – the 8 pipelines with a format-67 target are no longer refusedThe runs on this PR so far are on the Series S profile; the Series X profile reaches format 67 too, in pipelines (#914 expected it not to).
Tested
stable-x86_64-pc-windows-msvc; releasedevice_type = "anaconda"(Series X),XCL_NETWORK=0,scripts/smoke.ps1 -Seconds 60, no input, on this head and on its base9ce2070report.jsond3d12.failed_pipelines: base 8, this PR 0 (fallback_pipelines0,translated_pipelines6 in both). On the base the 8 are pipeline streams with a console VS + PS and one render target in format 67, refused with0x8007000e/0x80070057, and their stand-in versions too (graphics PSO rejected …, the fallback version too), about 8 s after start.Regression run
Base (
9ce2070):This PR (
c3d350a):Not tested
cargo test --workspaceon this headAI use
@raylitebull on GitHub · 2026-11-24 10:40 UTC · original
Code/CI review only (not independently runtime-tested by me): clean merge and
PR descriptiongreen (just awaiting CI workflow approval). Tight+19/-2fix promotingR9G9B9E5_SHAREDEXPRT/UAV targets toR11G11B10_FLOAT— cleaner than duplicate #651. Recommend approving CI and merging, @ivall.@MKmajster on GitHub · 2026-11-24 12:59 UTC · original
Confirming PR #605 on an RTX 3070 (8 GB VRAM) / 16 GB RAM, Windows 11.
Before #605, Series S (lockhart) aborted at startup: the title creates a 1920×1080 R9G9B9E5_SHAREDEXP (67) render target + UAV (flags 0x300005), the host refuses with 0x80070057, and the title hits int3 (0x80000003) after ~234 frames (~80 s) — matches #914.
With #605 cherry-picked (plus
console_type_raw = 5for lockhart), the assert is gone. Series S now runs to a clean exit (code 0), ~30 fps at 1920×1080, 2585 console frames / 19,610 translated draws, with no device-removed and no OOM — i.e. it fits 8 GB VRAM, where Series X 4K does not (that path exhausts the 8 GB and the GPU is removed after ~3.5 min).Remaining on this setup: sampled frames stay black (0 non-black). ID3D12GraphicsCommandList10 #126 and #142 (~2585×/frame) and ID3D12CommandQueue #31 (CopyPageMappingsBatchX, #1031) are still stubbed, so the streamed/mapped content never reaches the GPU views. So #605 clears the Series S startup crash; a visible Series S frame additionally needs those console extensions.
Tested with Claude Code (AI-assisted). No game data attached.
@rrrarrra9 on GitHub · 2026-11-24 16:16 UTC · original
Windows comparison on a GTX 1650 (4 GB)
I compared retail 1.0.2.1 in the Series S profile on
main(b7aa9f3) and on the same base with this PR'sc3d350acherry-picked (e21849e, local).main0x80070057, followed by0x80000003atgame+0xcc2834main+ #6050x80000003atgame+0xb18de7(#495). Final process exit was0xc0000005The last sampled frame in each run had 0 of 129,600 non-dark samples. This confirms that #605 clears the #914 startup assertion on this GPU. The #495 follow-up is in testing.
AI use
Codex (GPT-6) ran both builds and wrote the report from the generated logs.