Skip to content

D3D12.X: R9G9B9E5 render targets / UAVs are half floats where the device refuses them (retail title, Series S) - #242

Open
mrp1no wants to merge 1 commit into
xcl-dev:mainfrom
mrp1no:d3d12x-r9g9b9e5-targets
Open

mrp1no wants to merge 1 commit into
xcl-dev:mainfrom
mrp1no:d3d12x-r9g9b9e5-targets

Conversation

@mrp1no

@mrp1no mrp1no commented Nov 23, 2026 •

Copy link
Copy Markdown

On the Series S profile (device_type = "lockhart"), the retail title places a 1920x1080 DXGI_FORMAT_R9G9B9E5_SHAREDEXP texture that is both a render target and a UAV (flags 0x300005). On NVIDIA the device accepts neither use of that format, so CreatePlacedResourceX gets E_INVALIDARG and the title stops on its own assertion (a breakpoint exception). That looks like the assertion #156 reports after a refused pipeline on that profile. An AMD RDNA4 card accepts both uses (MesshM's report below), so the format is changed only on a device that does not take it.

This handles the format the way XCL already handles the console's R10G10B10 7e3 / 6e4 floats (116 / 117) and B5G5R5A1 / B4G4R4A4 targets. Half floats hold every shared-exponent value exactly: 9 mantissa bits and exponents down to 2^-24 fit in fp16. The texture is a GPU-owned target, a resource of its own, so nothing the CPU lays out depends on its format. Like the B5G5R5A1 case, it costs twice the memory per texel.

What is in it

  • D3D12.X: R9G9B9E5 render targets / UAVs are half floats on the PC (crates/xcl/src/hle/d3d12x/device_x.rs, crates/xcl/src/hle/d3d12x/real.rs):
    • probe_rgb9e5_targets, called when the device is made: CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) for format 67. The format is kept when the device has RENDER_TARGET, TYPED_UNORDERED_ACCESS_VIEW and UAV_TYPED_STORE; otherwise RGB9E5_AS_HALF is set and the log says which.
    • pc_resource_desc: an R9G9B9E5 texture with ALLOW_RENDER_TARGET or ALLOW_UNORDERED_ACCESS becomes R16G16B16A16_FLOAT when RGB9E5_AS_HALF is set. A texture that is only sampled stays R9G9B9E5.
    • pc_target_format: render target views, pipeline formats and clear values in format 67 follow the same switch.
    • pc_shader_view_format: a shader view in format 67 of a converted texture is R16G16B16A16_FLOAT.
    • pc_srv (real.rs): an R9G9B9E5 shader view of a converted texture reads alpha as the constant 1 (alpha_read_as_one: each read of the fourth component in its Shader4ComponentMapping becomes FORCE_VALUE_1), as the format does; the half floats hold whatever the title's pixel shader wrote in alpha. Its other component choices stay.
    • The console_types_and_descs_become_pc_ones test covers the desc with the switch on and off, the sampled-only case, and the view and target formats; an_rgb9e5_view_of_half_floats_reads_alpha_one covers the alpha mapping and the views left as they are.

Tested

  • NVIDIA GeForce RTX 3060 12 GB, driver 610.88; Intel Core i7-11700K; 32 GB; Windows 11 build 26300; rustc 1.100.0; tests in debug, game runs in release.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on ff28e60 (rebased on main c160d86): 859 passed, 0 failed, 42 ignored over 20 test binaries. SKIPPED: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • On this RTX 3060 the probe logs R9G9B9E5 render targets / UAVs: half floats (the device does not render into the format or store to it).
  • Retail title 1.0.2.1, Series S profile (device_type = "lockhart"), scripts/smoke.ps1 -Seconds 60 with that data folder, release builds: main f4ce27c logs CreatePlacedResourceX ... 1920x1080 format 67 flags 0x300005 – a resource of its own (0x80070057) at 35.3 s and ends on the title's breakpoint exception 0x80000003 (no frame count: the run did not reach its end); this change (e54a0d4) makes the texture, runs the 60 s and shows 937 frames, no crash. The same 60 s on the Series S profile with 5683056 (the previous head, same change): 1330 frames, no crash, peak commit 18417 MB.
  • On the Series X profile the title creates its format-67 textures as sampled only, each aliasing an R32_UINT UAV, and this change leaves those as they are; the pipelines that name format 67 as a target get the half-float format (pc_target_format, the report from XackiGiFF below).
  • Reports from others on the first form (ecdfa5b): klNuno, RTX 5080, Series S: the stop is gone; MesshM, RX 9060 XT (RDNA4): suite green, and the format is accepted there as a target and a UAV, which is why the conversion now depends on the device. XackiGiFF, RTX 5090 Laptop, Series X profile on 9ce2070: the 8 failed pipelines of main, among them the debug layer's message 676 (R9G9B9E5 render-target support), went to 0 with this change; the intro ran at about 27 fps.
  • Reports on e54a0d4: MrEjecutor, RTX 5060 Ti, Series S: the format-67 assertion is gone and the title runs 2.7× longer, to a different assertion that kernelx: XMemMapPhysicalPagesScatter with no page array unmaps #495 fixes (with kernelx: XMemMapPhysicalPagesScatter with no page array unmaps #495 the full 180 s). yous0serious, RTX 4090, Series X: failed_pipelines 8 on the base, 0 with this change. milas6669, RTX 3070, Series S: the format error is gone, the first screens run at a steady 30 fps, then the same assertion kernelx: XMemMapPhysicalPagesScatter with no page array unmaps #495 fixes.

Regression run
scripts/smoke.ps1 -Game <game folder> (60 s), Series X profile, no input (the title stays at its first menus), release builds; main at c160d86, this branch's base.

main:

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: NVIDIA GeForce RTX 3060
title: dump
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14560 MB

This PR:

xcl-smoke v1
commit: ff28e60b41e01c032556b6112fefcedf16f92b22
gpu: NVIDIA GeForce RTX 3060
title: dump
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14554 MB

Not tested

  • AMD GPUs with this form of the change: on a device that takes the format, the probe keeps it and the conversion is skipped, but I have no AMD card to run it.
  • The smoke run uses the Series X profile, where the title makes no format-67 target, so it is a regression check only.
  • A shader view the title makes with no description (the resource's own format) of a converted texture reads the half floats' alpha: it cannot be told from a view of a real half-float texture.
  • Whether the Series S frames render correctly past this point: klNuno's frames were black, and that run had other local patches.

AI use

  • Claude Code, Claude Opus 5.5: the diagnosis, the code, the test and this description. The runs and tests were made on the hardware named above.

🤖 Generated with Claude Code

@klNuno

klNuno commented Nov 23, 2026 •

Copy link
Copy Markdown

Note

Clanker Claude Opus 5.5 is responding on behalf of meetsu

Test report for #242 on a second GPU: the RTX 3060 result in the description reproduces on an RTX 5080.

Tested

  • Hardware: RTX 5080, driver 616.92, Windows 11 build 26200, release build.
  • Code: main at 9ab7d76 plus the ecdfa5b diff (same git patch-id --stable, 501b6a29), without Retail title reaches its title screen and menus: GPU title memory in large pages, to_zero pruned once #203.
  • Both builds also carry two unpublished local patches: an opt-in audio mute and an experimental write-watched reservation for a 3977 MiB texture pool.
  • The pool reservation was active in both runs; no XAudio2 engine was created in either run.
  • Profile: Series S (device_type = "Lockhart"), 3136 MB coherent window.
  • cargo test --release -p xcl --lib console_depth_buffers_and_their_views_are_the_pcs: 1 passed, 0 failed.
  • Before (no ecdfa5b): at 8.5 s the log shows CreatePlacedResourceX at ...: dimension 3 1920x1080 format 67 flags 0x300005 - a resource of its own (0x80070057), then exception 0x80000003.
  • After: no such line; a 55 s timed run (XCL_RUN_SECONDS=55) ended with exit code 0, 1062 frames shown for 1063 PresentX calls.

Not tested

AI use

  • The builds and runs were driven by an AI agent session orchestrated from Codex (GPT-6.2 Astra).
  • Claude Opus 5.5 re-checked the logs, frames, diff and patch-id, and wrote this report.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of ecdfa5bfa on AMD (RDNA4); the PR was tested on NVIDIA only. The branch is based on 0f34407, so I merged it onto current main a6f5f7a locally (clean merge, only device_x.rs, +15 lines) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; XCL picked it (backend 'real' – AMD Radeon RX 9060 XT (16191 MiB VRAM))
  • Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on the merge: 676 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 636 passed, 0 failed, 21 ignored; the same counts as main on this machine (the PR extends an existing test rather than adding one); console_types_and_descs_become_pc_ones passes
  • 0 SKIPPED on this adapter

One finding on AMD: the description says a PC device accepts R9G9B9E5_SHAREDEXP neither as a render target nor as a UAV. On this RDNA4 card it accepts both. A small standalone program (not part of XCL) on the same adapter:

  • CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) for DXGI_FORMAT_R9G9B9E5_SHAREDEXP: RENDER_TARGET, TYPED_UNORDERED_ACCESS_VIEW and UAV_TYPED_STORE all set
  • CreateCommittedResource of a 1920x1080 R9G9B9E5 texture with ALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESS: S_OK (R16G16B16A16_FLOAT: S_OK too)

So the E_INVALIDARG is driver-dependent (NVIDIA in the reports so far), not a property of D3D12 on the PC. The conversion is still correct on AMD, since half floats hold every shared-exponent value exactly; it just costs twice the memory there without being needed. Not a blocker; if you want, the conversion could depend on the device's format support for 67, and the comment in pc_resource_desc could say "some PC drivers" instead of "the PC".

Review of the change: I checked that every view of a converted texture goes through the new mappings. RTVs (dev_create_rtv) and UAVs (dev_create_uav_x) use pc_shader_view_format(resource, view), SRVs go through pc_srv → pc_shader_view_format, and pipeline RTV formats and clear values use pc_target_format. A sampled-only R9G9B9E5 texture stays R9G9B9E5, as the test checks.

Not tested: no retail title or Series S profile (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's own head commit on its old base was not run, only its merge onto main.

Run and report by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

@XackiGiFF

Copy link
Copy Markdown

Additional Series X/Anaconda test on NVIDIA: upstream 9ce2070 plus only this PR’s 15-line device_x.rs patch from ecdfa5b. No additional runtime patches.

Setup

  • Windows 11 build 26300 VM, direct VFIO passthrough of RTX 5090 Laptop GPU (24,137 MiB), NVIDIA 621.01.
  • 48 GiB assigned RAM, DXC 1.9.2609.5, real NVIDIA backend.
  • 4,095 MiB coherent window, XCL_NETWORK=0, D3D12 debug enabled, no FrameDump.

Tests
Five targeted libtests passed with zero SKIPPED, covering format/descriptor mappings and texture uploads.

The first synthetic run produced 49 PASS / 1 FAIL: XMA2 buffer duration was 64 ms versus approximately 100 ms expected. ZIP compression was concurrent; causation is unproven. An isolated repeat produced 50 PASS / 0 FAIL, exit 0.

Observed
Unmodified 9ce2070 reported eight failed pipelines, including early debug IDs 676 (R9G9B9E5 render-target support) and 688 (VS/root-signature mismatch).

With this patch, both IDs disappeared. The final report showed 155 translated pipelines and zero failed pipelines. The animated intro visibly rendered at approximately 27 FPS.

Limits
No visible 3D world was reached. World loading ended at 205.215 s with the existing +0x23cf683 null-write signature.

A diagnostic minidump briefly suspended threads for 518 ms approximately 1.7 seconds before the fault, so timing was perturbed. One retail run per configuration; profile and shader caches were reused. No pixel-exact format comparison or full workspace suite was performed.

This supports the format/PSO fix on this configuration, but does not demonstrate a fix for the world-loading crash.

AI use
Codex prepared and ran the local builds/tests, analyzed the results, and drafted this report. No game files or memory dumps attached.

@grahamster2 grahamster2 changed the title D3D12.X: R9G9B9E5 render targets and UAVs are half floats (GTA VI on the Series S profile) D3D12.X: R9G9B9E5 render targets and UAVs are half floats (retail title on the Series S profile) Nov 24, 2026
@mrp1no
mrp1no force-pushed the d3d12x-r9g9b9e5-targets branch from ecdfa5b to e54a0d4 Compare November 24, 2026 03:55
@mrp1no mrp1no changed the title D3D12.X: R9G9B9E5 render targets and UAVs are half floats (retail title on the Series S profile) D3D12.X: R9G9B9E5 render targets / UAVs are half floats where the device refuses them (GTA VI, Series S) Nov 24, 2026
@mrp1no

mrp1no commented Nov 24, 2026

Copy link
Copy Markdown
Author

Thanks to all three of you for the runs.

@MesshM: confirmed from your numbers. The conversion now depends on the device, in the one commit (now e54a0d4, rebased on main f4ce27c). When the device is made, probe_rgb9e5_targets asks CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) for format 67. The format stays when the device has RENDER_TARGET, TYPED_UNORDERED_ACCESS_VIEW and UAV_TYPED_STORE, so an RDNA4 card keeps R9G9B9E5 and pays no extra memory. Otherwise pc_resource_desc and pc_target_format make the targets half floats, as before. The comment now says "some PC drivers". The unit test covers both settings of the switch.

@klNuno: noted that your frames were black. That run had the two local patches, and I have not checked the Series S frames myself either; it is listed under Not tested.

@XackiGiFF: thanks for the Series X run; it is in the description (the pipelines naming format 67 as a target get the half-float format on NVIDIA).

On the Series S profile I reran main f4ce27c and this head: main still stops at the refused format-67 texture (0x80070057, then the title's 0x80000003), and this head runs on. The suite and the smoke runs on the new head are in the description.

Written with Claude Code, Claude Opus 5.5.

@MrEjecutor

MrEjecutor commented Nov 24, 2026 •

Copy link
Copy Markdown

Test report on e54a0d4 (this PR's head): RTX 5060 Ti + Intel CPU, Series S profile – the R9G9B9E5 assert is gone, the title runs 2.7× longer, then stops on a different assert

Tested

  • RTX 5060 Ti 16 GB (wave32), driver 621.24; Intel Core Ultra 5 225F (no SSE4a); 32 GB; Windows 11 Pro 26200; Rust 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.8.2505.32 (SDK 10.0.28000); release
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4 on e54a0d4: 701 passed, 0 failed, 41 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
  • Retail title 1.0.2.1, device_type = "lockhart", XCL_NETWORK=0, 120 s:
    • main (d5442d2): CreatePlacedResourceX 1920x1080 format 67 flags 0x300005 → 0x80070057, then 0x80000003 at +0xcc2834 at 19.1 s
    • this PR: R9G9B9E5 render targets / UAVs: half floats (the device does not render into the format or store to it) at start; no refusal of format 67; the title runs to 51.6 s at 17–25 fps (1920x1080 swap chain), then 0x80000003 at +0xb18de7
    • the new assert comes 20 ms after the first Insertq { dst: 0, src: 1, reg: false, len: 16, idx: 16 } emulated at +0x2e7ff1 (this CPU has no SSE4a). Not shown to be related; I have no AMD CPU to compare.
  • For comparison, the Series X profile (anaconda, default) on main: no crash in 120 s but 3840x2160 output at 4.5–5 fps, GPU at 6–9 % utilisation.

Regression run

xcl-smoke v1
commit: d5442d2dfc02b4ecceba637eb56e78ec77926477
gpu: NVIDIA GeForce RTX 5060 Ti
title: GTAVI
seconds: 120
exit: 0x80000003
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 36 50 22
device removals: 0
crashes: 2
peak commit: 14593 MB
xcl-smoke v1
commit: e54a0d426fdfbbc59ae529908774b293ab809bc3
gpu: NVIDIA GeForce RTX 5060 Ti
title: GTAVI
seconds: 120
exit: 0x80000003
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 34 21 15
device removals: 0
crashes: 2
peak commit: 18197 MB

Both with device_type = "lockhart". The main block is from d5442d2, this PR is based on f4ce27c.

Not tested

AI use

  • Claude Code (Claude Opus 5.5) ran the builds, tests and runs and wrote this report; checked by mrejecutor.

Update: the +0xb18de7 assert is not the SSE4a emulation. The same INSERTQ is emulated on the Series X profile at 62 s with no crash. The assert is XMemMapPhysicalPagesScatter called with a NULL page array, which #495 fixes. With this PR and #495 merged on main e50836b, the title runs the full 180 s on this card on the Series S profile (report on #495).

Compared with #605 and #651 (same card, same setup, each merged with #495): none of the three crashes in 180 s, so a run cannot tell them apart here. From the code, checked by me (a comparison drafted by Codex, gpt-6-sol, was the starting point):

  • This PR is the only one that keeps format 67 where the adapter supports it (FORMAT_SUPPORT probe), and R16G16B16A16_FLOAT holds every R9G9B9E5 value; R11G11B10_FLOAT (D3D12.X: promote R9G9B9E5_SHAREDEXP render/UAV targets to R11G11B10_FLOAT #605, D3D12.X: R9G9B9E5_SHAREDEXP targets become R11G11B10_FLOAT #651) keeps 7/7/6 significant bits where R9G9B9E5 has 9.
  • Worth a look here: format 10 has a real alpha channel, while sampling format 67 returns alpha 1, so a shader that reads .a from the retyped view could see what was written or cleared instead of 1. Not observed, the window is black on this card.
  • Common to all three, on main too: dev_create_placed_resource_x retries with pc_resource_desc but passes the title's clear value unchanged (real.rs:2695, 2704, and own_memory_if_larger_on_the_pc at 2749), so a format-67 target with an optimized clear on that path would still be refused. This title did not take that path in my runs.

@yous0serious

Copy link
Copy Markdown
Contributor

Test report on e54a0d4 (this PR's head): RTX 4090, Series X profile – no refused pipeline left; the later crash at +0x23cf683 is unchanged

@XackiGiFF's Series X run above was on 9ce2070 with the earlier patch; this one is on the current head.

Tested

  • NVIDIA GeForce RTX 4090 (wave32), driver 621.01; Intel Core i7-13700KF; 32 GB; Windows 11 Pro 26200; Rust 1.100.0 stable-x86_64-pc-windows-msvc; release
  • Retail title 1.0.2.1, device_type = "anaconda" (Series X), XCL_NETWORK=0, scripts/smoke.ps1 -Seconds 60, no input, on this head and on its base f4ce27c
  • report.json d3d12.failed_pipelines: base 8, this PR 0 (fallback_pipelines 0, translated_pipelines 1345 in both). On the base the 8 are pipeline streams with a console VS + PS and one render target in format 67, refused with 0x8007000e / 0x80070057, and their stand-in versions too (graphics PSO rejected …, the fallback version too), about 8 s after start.
  • Played by hand to the crash, once on main 077ce40 and once on this head: both end in the same null write at game_scarlett_master.exe+0x23cf683 (The retail title 1.0.2.1 (RTX 5070): reaches the end of the first-run setup, then deterministic 0xC0000005 write at 0x0 in game_scarlett_master.exe+0x23cf683 #846), about 30 s after the first ID3D12GraphicsCommandList12::#101 stub call and after more than 2000 BCPack refusals. This PR does not change that crash.

Regression run

Base (f4ce27c):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: NVIDIA GeForce RTX 4090
title: GTA6
seconds: 60
exit: 0x0
frames shown: 1650 (PresentX 1650)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15548 MB

This PR (e54a0d4):

xcl-smoke v1
commit: e54a0d426fdfbbc59ae529908774b293ab809bc3
gpu: NVIDIA GeForce RTX 4090
title: GTA6
seconds: 60
exit: 0x0
frames shown: 1650 (PresentX 1650)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14925 MB

Not tested

  • cargo test --workspace on this head
  • whether the 8 pipelines draw correctly; Series S profile; AMD

AI use

  • GitHub Copilot app with Claude Opus 5.5: ran the builds and runs, found the pipelines' render-target format with a temporary local log line (in no commit), wrote this report. Checked by me.

@milas6669

Copy link
Copy Markdown
Contributor

Series S mode with this PR on an RTX 3070 (3 runs), and what comes after the R9G9B9E5 format. Not a regression run.

Setup: RTX 3070 8 GB (32-lane waves), i9-10900KF, 31.9 GB RAM, Windows 11 Pro 10.0.26200, rustc 1.100.0, release. Build: main 077ce40 + #891 (XCL_PSO_WAIT_MS=50) + this PR's head e54a0d4 (clean merge). XCL_NETWORK=0, retail title, warm caches. xcl.toml with device_type = "lockhart", console_type_raw = 5; the same build and settings with anaconda / 6 as the control. A button press reached the title in every run (a scripted XCL_PRESS_A_AT=25 plus presses by hand, so the press times in the log differ: 44 s, 127 s, 166 s).

With this PR the format error from #914 is gone here. The log has R9G9B9E5 render targets / UAVs: half floats (the device does not render into the format or store to it) at 2 s, and no not reserved / assert about format 67 follows. The title boots, gets through the first screens at a steady 30 fps (4200 frames in the longest run), and answers the A press.

What happens next, 3 of 3 runs:

  • the title makes its XStore query 0.6 s after the A press (XCL answers "offline" and the title logs XErrorReport 0x89240107, as it also does in Series X runs);
  • about 5 s later, unhandled exception 0x80000003 (int3) in game_scarlett_master.exe+0xb18de7: 174.0 s (press at 166.5 s), 49.7 s (press at 44.2 s) and 133.1 s (press at 127.4 s); 4.9 to 6.9 s after the XStore error each time, with the same registers (rbx=0x7aa5e09a8 rcx=0x57);
  • in each run the log line Insertq { dst: 0, src: 1, reg: false, len: 16, idx: 16 } in game_scarlett_master.exe+0x2e7ff1 ... emulated (logged once) comes 21–23 ms before the int3. The same line appears in Series X runs, which go on. I read the emulation (insn::insertq) against AMD's definition and it matches; I do not claim it is related, only that the two events are 22 ms apart.
  • no Series X log of mine with an A press has this exception (24 logs, including the control run below).

Memory, Series S against the Series X control (same build, \Memory\Available Bytes logged once a second):

game's private bytes at its peak lowest available RAM how it ended
Series S, 3 runs 20.2, 23.9 and 21.1 GB 7.8, 10.2 and 12.5 GB the int3 above
Series X control 31.7 GB 0.1 GB world loading at 117.6 s, then my 31 GB watchdog at 32.4 GB commit

So Series S keeps the machine well clear of the RAM exhaustion I see in Series X (comments on #675), but it does not get as far as the world because of the assert.

Not tested: whether the int3 is the title's own check on something Series S specific; the other Series S fix candidates; AMD.

AI use: Claude Code, Claude Sonnet 5.5, ran the commands and wrote this comment.

pedro-anthony added a commit to pedro-anthony/xcl that referenced this pull request Nov 24, 2026
Conflicts resolved with upstream's versions where our side held older copies of PRs it has
since merged or superseded:
- title_textures.rs, vram.rs, device_x.rs: upstream's xcl-dev#248 (ad79932) and xcl-dev#283 replace our
  earlier merges of xcl-dev#248 / xcl-dev#269 (closed) / xcl-dev#292 (open, conflicts with main now). xcl-dev#242
  (R9G9B9E5 targets) is to be merged again on top.
- kernelx.rs unmap_away: upstream's condition (also keeps a home the caller committed).
- real.rs / host.rs: calls into xcl-dev#292's title_textures::teardown, vram::on_queue_release and
  title_textures::stats dropped (not in upstream's files); its MADE cache in real.rs stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pedro-anthony added a commit to pedro-anthony/xcl that referenced this pull request Nov 24, 2026
…vall#242, again after the merge)

The merge of upstream main took upstream's device_x.rs, which dropped this PR's change (its
commit ecdfa5b is already in our history, so git does not merge it again).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrp1no
mrp1no force-pushed the d3d12x-r9g9b9e5-targets branch from e54a0d4 to 5683056 Compare November 24, 2026 13:10
@mrp1no

mrp1no commented Nov 24, 2026

Copy link
Copy Markdown
Author

Thanks for the three reports. The head is now 5683056, rebased on main 47efa2e, still one commit.

@MrEjecutor: both of your points are fixed.

  • Alpha. An R9G9B9E5 shader view of a target made half floats now reads alpha as the constant 1, as the format does. The view's Shader4ComponentMapping has every read of the fourth component set to FORCE_VALUE_1; the title's other component choices stay. Test: an_rgb9e5_view_of_half_floats_reads_alpha_one. One case remains: a view made with no description (the resource's own format) cannot be told from a view of a real half-float texture, so it is left alone. This is listed under Not tested.
  • Clear value. The retry in dev_create_placed_resource_x and own_memory_if_larger_on_the_pc now pass the clear value through pc_clear, as create_placed_resource_x already did. The clear value is therefore in the format of the PC description there. This also covers the B5G5R5A1 / B4G4R4A4 and D16S8 families on those two paths.

@milas6669, @MrEjecutor: the Series S int3 at +0xb18de7, a few seconds after the A press, is the one #495 fixes (MrEjecutor's update above). It is not related to this PR.

@yous0serious: thanks for the Series X numbers (failed_pipelines 8 → 0). The +0x23cf683 crash happens during the world load and is outside this PR. In my runs it comes about 30 s after the first compute dispatches that XCL skips because their pipelines are still being built.

New results on 5683056:

  • cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored.
  • Series X smoke: 1637 frames against main's 1623.
  • Series S, 60 s: 1330 frames, no crash.

The details are in the description.

(Claude Code, Claude Opus 5.5)

@grahamster2 grahamster2 changed the title D3D12.X: R9G9B9E5 render targets / UAVs are half floats where the device refuses them (GTA VI, Series S) D3D12.X: R9G9B9E5 render targets / UAVs are half floats where the device refuses them (retail title, Series S) Nov 24, 2026
…refuses them

On the Series S profile GTA VI places a 1920x1080 R9G9B9E5_SHAREDEXP
texture that is a render target and a UAV (flags 0x300005). NVIDIA
refuses the format for both uses (CreatePlacedResourceX: E_INVALIDARG)
and the title stops on its own assertion. An AMD RDNA4 card accepts
both.

When the device is made, CheckFeatureSupport(FORMAT_SUPPORT) for format
67 decides: without RENDER_TARGET, TYPED_UNORDERED_ACCESS_VIEW and
UAV_TYPED_STORE, such targets are made R16G16B16A16_FLOAT
(pc_resource_desc), and so are their target and pipeline formats
(pc_target_format) and their shader views (pc_shader_view_format). Half
floats hold every shared-exponent value exactly. A texture that is only
sampled stays R9G9B9E5.

An R9G9B9E5 shader view of such a target reads alpha as the constant 1
(its component mapping), as the format does: the half floats hold what
the pixel shader wrote there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrp1no
mrp1no force-pushed the d3d12x-r9g9b9e5-targets branch from 5683056 to ff28e60 Compare November 24, 2026 19:44
@mrp1no

mrp1no commented Nov 24, 2026

Copy link
Copy Markdown
Author

Rebased on c160d86; still one commit, now ff28e60. One change from the head reviewed above: f4bbf26 (emirduran707) on main now converts the clear value at the start of dev_create_placed_resource_x. That covers the retry and own_memory_if_larger_on_the_pc, so I dropped this PR's own conversion there to avoid a second one. The alpha-as-1 mapping for R9G9B9E5 views of the half-float targets stays.

cargo test --workspace --no-fail-fast -- --test-threads=4: 859 passed, 0 failed, 42 ignored. Smoke on main c160d86 and on ff28e60: 1620 frames each, no crash (blocks in the description).

(Claude Code, Claude Opus 5.5)

@adriaespii

Copy link
Copy Markdown

Independent test run on commit ff28e60:

Tested

  • Hardware: AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11, debug build
  • Command: $env:XCL_ADAPTER='RX 9070'; .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4)
  • Result: 859 passed, 0 failed, 42 ignored (lib: 810 passed, 0 failed, 22 ignored; integration/e2e: 49 passed, 0 failed, 20 ignored)
  • SKIPPED GPU tests: 1 (heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows, XCL_HEAP_WINDOWS unset)

Not tested

  • Retail titles (scripts/smoke.ps1 and XCL_SAMPLE_* tests not run)
  • NVIDIA / Intel / non-RDNA4 GPUs where R9G9B9E5_SHAREDEXP render-target/UAV fallback to half floats triggers

AI use

  • Antigravity (Gemini 4 Neon) ran the test suite locally and formatted this report.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants