Skip to content

d3d12: drop #1388's R9G9B9E5 render-target mask; follow the device as #1375 does - #1466

Closed
Dom-in wants to merge 1 commit into
ItsNotRexed:mainfrom
Dom-in:r9g9b9e5-follow-native
Closed

Dom-in wants to merge 1 commit into
ItsNotRexed:mainfrom
Dom-in:r9g9b9e5-follow-native

Conversation

@Dom-in

@Dom-in Dom-in commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Follow-up to my own #1388, which was wrong. No new claim is needed; it reverts part of my own merged change. Status posted in #1380.

What and why

#1388 assumed D3D12 never renders to DXGI_FORMAT_R9G9B9E5_SHAREDEXP, and cleared the format's RENDER_TARGET, BLENDABLE, DEPTH_STENCIL and multisample bits on every device. The native measurements on #1388 disproved that: AMD's native D3D12 driver reports RENDER_TARGET, BLENDABLE and MULTISAMPLE_RENDERTARGET for the format and renders it exactly.

  • @Vonsek measured it on gfx1036 (RDNA2).
  • @zneel measured it on an RX 9070 XT (RDNA4, AMD 26.11.2): 15/15 packed texels, render targets up to 8x.

#1375 makes the layer follow the device's native colour-attachment support. Because #1388 merged after it, my mask overrode #1375. On AMD, main hides a render-target format the hardware supports:

This removes the mask; the 8 lines #1388 added are the whole diff. Thanks to @Vonsek and @zneel for measuring the native driver; I should have checked that before #1388.

Tested

AMD Radeon RX 9070 (RDNA4), AMD 26.11.2, Windows 11 Pro 26300, MSVC 14.44, scripts\build_runtime.ps1:

d3d12_r9g9b9e5_uav d3d12_rgb9e5_rtv full ctest
main (bb2e184) Failed, line 399: bool(fs.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET) == native_attach Skipped —
this PR Passed Passed 82/82

AI-assisted (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🤖 Generated with Claude Code

…e device as ItsNotRexed#1375 does

ItsNotRexed#1388 assumed D3D12 never renders to R9G9B9E5_SHAREDEXP and cleared its render-target, blend and
multisample bits on every device. Native D3D12 measurements disproved that: AMD's driver reports
RENDER_TARGET, BLENDABLE and MULTISAMPLE_RENDERTARGET and renders the format exactly, on gfx1036 (@Vonsek)
and on an RX 9070 XT, RDNA4 (@zneel). ItsNotRexed#1375 makes the layer follow the device, and ItsNotRexed#1388 merged after it,
so the mask overrode it: on AMD d3d12_r9g9b9e5_uav failed (RENDER_TARGET == native_attach) and
d3d12_rgb9e5_rtv was skipped. With the mask removed both pass on an RX 9070 and ctest is 82/82.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@whattheflop whattheflop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Windows verification (AI-assisted) on a Ryzen 7 9800X3D with integrated Radeon gfx1036 (1002:13c0), AMD driver 25.10.30.02 (32.0.21030.2001), Windows 11 Pro build 26200, Vulkan 1.4.315. I built both commits with MSVC 19.38 and ran only ctest -V -R '^d3d12_rgb9e5_rtv$' (the stock --rgb9e5 path). The loader log confirmed one AMD ICD (amd-vulkan64.json) and Khronos core and synchronization validation (SDK 1.4.363.0).

Build Focused RGB9E5 RTV result Shim Support1 / Support2
Direct parent bb2e18421dac527374eb837c88b5063c5d96f81f Skipped (exit 77), reports RGB9E5 render targets unavailable 0x020003f0 / 0x00000080
PR head 8371a2584a7037fd0b45ac3786a0d8db963be88c Passed (exit 0), 15/15 packed texels and zero validation errors 0x0224c3f0 / 0x00000080

The AMD Vulkan driver advertises both color attachment and color attachment blend for VK_FORMAT_E5B9G9R9_UFLOAT_PACK32. The head and native Radeon D3D12 agree on the RENDER_TARGET, BLENDABLE and MULTISAMPLE_RENDERTARGET bits. Native Radeon returned 0x02e8d3f0 / 0x000002c0 and WARP returned 0x02ecd3f1 / 0x000002c0. The stock focused path checks the shim. A separate probe reused its single-sample fixture on the native Radeon and WARP, each after checking format support. The head, native Radeon and WARP each matched nine exterior texels at 0x94010040 and six rectangle texels at 0x91010100. Clear/readback coverage was single-sample.

This extends the #1375 and #1388 native Radeon measurements to driver 25.10.30.02 and reproduces the #1380 skip-to-pass result on the exact parent and head.

@evilclanker9000

Copy link
Copy Markdown
Contributor

@Dom-in, your RX 9070 results and the native RX 9070 XT measurements agree with the single-sample change in #1450. Thanks for checking the non-XT. I suggest landing #1450 for that behavior first: it also changes the focused regression so an accidental false capability bit fails on any adapter with the attachment. On bb2e184 the existing clear test silently skips exactly that failure. #1466 additionally exposes the blend and multisample bits; a separate blended draw plus multisampled clear/resolve/readback through the shim would establish which operations match the native driver before advertising them. Keeping just the single-sample change in #1450 also leaves us a clean baseline for that comparison. If the maintainers choose #1466 first, I can narrow #1450 to the regression test. AI-assisted.

@alvaro-marquez-cobos

Copy link
Copy Markdown
Contributor

Independently tested 8371a25 against base bb2e184 on Windows x64, MSVC, AMD Vulkan 26.11.2. Selected each device explicitly: Radeon AI PRO R9700 and the integrated Radeon(TM) Graphics. On the base, d3d12_r9g9b9e5_uav failed and d3d12_rgb9e5_rtv skipped on both. With the PR, both tests passed on both adapters: native UAV mode, 6/6 clears bit-exact against WARP, 16/16 copied and sampled texels, 0 reported validation errors, and the full/rectangle RTV clears matched all 15 packed texels. Synthetic inputs only. AI-assisted.

@Dom-in

Dom-in commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1450 (@Vonsek), which fixes the same main regression from my #1388, was opened first, and changes only the single-sample RTV bit. Tested #1450 on an RX 9070: d3d12_r9g9b9e5_uav and d3d12_rgb9e5_rtv pass, ctest 82/82. AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass. ctest: 82/82 on the RTX 4080 SUPER, with d3d12_r9g9b9e5_uav passing on both GPUs. The Intel UHD 770 failures are known and unrelated: d3d12_descriptor (min-LOD), d3d12_copy_xfmt, and d3d12_present (reported in #1380).

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.

5 participants