Skip to content

Runtime: CheckFeatureSupport(FORMAT_SUPPORT) answers UNKNOWN and unlisted formats as the host does - #2563

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
dev-ewann:format-support-table
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
dev-ewann:format-support-table

Conversation

@dev-ewann

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: new D3D item (claim): CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) answers UNKNOWN and unlisted formats as the host does.

What and why

Measured against the host D3D12 runtime on an RTX 5070 with driver 621.14:

Format Host Before
UNKNOWN S_OK, Support1 = BUFFER (and TILED in Support2) DXGI_ERROR_UNSUPPORTED
116-129, 133-188 (no entry in the runtime's table) E_FAIL DXGI_ERROR_UNSUPPORTED
130-132 (P208, V208, V408, planar video) E_FAIL DXGI_ERROR_UNSUPPORTED
192 and up, and -1 E_FAIL DXGI_ERROR_UNSUPPORTED

The query now checks the value first: past B4G4R4A4_UNORM (115) and outside 189-191 (sampler feedback, A4B4G4R4_UNORM) is E_FAIL. Then UNKNOWN answers Support1 = BUFFER. Everything else goes through the existing lookup, unchanged.

The test (d3d12_vulkan_device_test):

  • compare_invalid_arguments gets 11 format support: cases that compare the HRESULT and Support1. Support2 is left out: the host's TILED is a GPU capability the layer doesn't offer (TiledResourcesTier is NOT_SUPPORTED).
  • The local check that expected UNKNOWN to fail (not compared with a host before) now expects S_OK and BUFFER. Format 116 must give E_FAIL.
  • The table's edges, 115, 189 and 191, must not give E_FAIL. Whether they are supported is the GPU's answer, so they are not compared.

Not changed: what the layer reports for sampler-feedback formats and for A4B4G4R4_UNORM, which are capability differences. The MULTISAMPLE_QUALITY_LEVELS differences are posted as a finding to take after #1991, which changes those lines.

Tested

AI-assisted (Claude), on behalf of dev-ewann. NVIDIA GeForce RTX 5070, driver 621.14, Vulkan 1.4.357, Windows 11 build 26300, MSVC 19.44 (BuildTools 2022), Ninja RelWithDebInfo, on main 4947579. No game files.

  • d3d12_vulkan_device_test with LEONIDA_D3D49_VERBOSE=1: all 11 new cases give the host's answer, exit 0. Full ctest: 124 of 124 passed (the ones needing game files skip).
  • Mutations of the new code, one at a time (only the test target rebuilt), each fails the test:
Mutation Fails at
no E_FAIL the invalid_format check, and the host comparison
no UNKNOWN branch the unknown_format check
lower bound >= 115 the table-edge check
upper window to 190 new format 191: FORMAT_SUPPORT reports no 2D texture
window from 188 format support: 188: ours 0x887a0004, host 0x80004005
window from 190 the table-edge check

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. (Not applicable: no translator change.)

🤖 Generated with Claude Code

…sted formats as the host does

Measured against the host D3D12 runtime (RTX 5070, driver 621.14):
UNKNOWN is a buffer format (S_OK, Support1 = BUFFER), and a value the
runtime's format table has no entry for is E_FAIL: 116-188, which
includes the planar video formats P208/V208/V408 at 130-132, and 192 and
up. The layer answered DXGI_ERROR_UNSUPPORTED for both.

compare_invalid_arguments gets 11 "format support:" cases, comparing the
HRESULT and Support1. Support2 is not compared, because the host's
TILED is a GPU capability the layer doesn't offer. The local check that
expected UNKNOWN to fail now expects the host's answer. 115, 189 and 191,
the table's edges, must not be E_FAIL.

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

Copy link
Copy Markdown
Contributor

Tested 7a9bebd on NVIDIA GeForce RTX 4070 (driver 617.42), Windows 11 (26300), MSVC 19.44, scripts/build_runtime.ps1 (Ninja), RelWithDebInfo: pass. ctest 124/124 (GameInput disabled, no SDL3); d3d12_vulkan_device passes, including its 46 CheckFeatureSupport option queries compared with the host (0 mismatches).

I also read the diff; one gap in the new cases: format_support1 returns Support1 in place of any successful HRESULT, so a host that answers S_FALSE with the same bitmask would still match. Comparing the HRESULT and, on success, Support1 separately would tell them apart.

AI-assisted: the review was done by Codex (gpt-6.2-sol); the point was checked against the code.

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (MSVC 14.51, llvm-mc 23.1.6): pass. ctest: 124/124 on the RTX 4080 SUPER. On the Intel UHD 770 only the known d3d12_descriptor (min-LOD) and d3d12_subgroup (fragment probe) fail (#2716).

@davidaleksejevs

Copy link
Copy Markdown

Tested 7a9bebd on AMD Radeon RX 7900 XTX (RDNA3, gfx1100), AMD 26.11.2, Windows 11: pass

  • runtime built from the PR head (scripts\build_runtime.ps1, MSVC 14.44, Windows SDK 10.0.26100)
  • d3d12_vulkan_device passes against the host runtime on the same AMD adapter, including the new format support: cases in compare_invalid_arguments (no mismatch lines). Resolve comparison 60/60, depth/stencil MSAA quality queries 12 compared, 0 mismatches.
  • Informational only, also on main: "invalid arguments format 55-59/65: the host accepts it, this Vulkan driver can't".
  • full ctest: 124/124 passed

(AI-assisted run.)

@evilclanker9000

Copy link
Copy Markdown
Contributor

Tested 7a9bebd on Windows 11 (26200), MSVC 19.4x (VS 2022 Build Tools), Ninja RelWithDebInfo: pass on both GPUs of a two-GPU PC.

  • NVIDIA GeForce RTX 5080, driver 616.92 (LEONIDA_VK_DEVICE=nvidia): ctest 108/108 passed, including d3d12_vulkan_device (FORMAT_SUPPORT against the host).
  • AMD Radeon RDNA2 iGPU, driver 32.0.21045.16010 (LEONIDA_VK_DEVICE=radeon, LEONIDA_HOST_ADAPTER=radeon so the host comparisons run on the same GPU): ctest 108/108 passed.

No game files. AI-assisted check (Claude Code), Vonsek3.

@DmitryBykov-ISPO

Copy link
Copy Markdown
Contributor

Tested 7a9bebd2 on NVIDIA GeForce RTX 5070 (Blackwell, subgroup 32), driver 621.24 (32.0.16.2124), Vulkan 1.4.357, Windows 11 Pro 26300, MSVC 19.52 from Visual Studio 2026 with the Windows SDK 10.0.26100: pass.

  • ctest -C RelWithDebInfo -R d3d12_vulkan_device: pass in 13.4 s. compare_invalid_arguments runs against the real D3D12 device here, and the summary line reports FORMAT_INFO on NVIDIA GeForce RTX 5070: 195 queries, 0 newer formats unknown to host, 0 mismatches.
  • Negative control: with only runtime/shims/d3d12_vulkan_device.cpp at pr2563^ and the PR's test unchanged, the test fails on the new assertion at d3d12_vulkan_device_test.cpp:3961: CheckFeatureSupport(FORMAT_SUPPORT, DXGI_FORMAT_UNKNOWN) == S_OK && Support1 == D3D12_FORMAT_SUPPORT1_BUFFER. The parent shim does not answer UNKNOWN that way on this machine. With the PR's shim restored, it passes again.

Synthetic device and format queries only, no game files.

@Koro4e

Koro4e commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 7a9bebd2 on NVIDIA GeForce RTX 3060 (Ampere, driver 617.14), Windows 11 build 26200, MSVC 19.44 (VS 2022 Build Tools), CMake Visual Studio 17 2022 generator, RelWithDebInfo. No game files.

  • ctest -C RelWithDebInfo -R d3d12_vulkan_device --output-on-failure: 1/1 passed (9.0 s).
  • With LEONIDA_D3D49_VERBOSE=1, all 11 new format support: comparisons match the host D3D12 runtime: UNKNOWN (0x00000001 on both sides) and 116, 129, 130-133, 188, 192, 1000, -1 (0x80004005 on both).
  • Negative control: rebuilt with runtime/shims/d3d12_vulkan_device.cpp restored from 49475796 and the PR test unchanged — the same test fails; restoring the PR file makes it pass again.
  • Build emitted two pre-existing C4456 warnings in runtime/src/vulkan_replay.h, unrelated to this diff.

Adds Ampere coverage next to the Ada/Blackwell/RDNA3 results already posted. AI-assisted.

@kacper-serewis kacper-serewis 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 RTX 5070, driver 616.56, same adapter LUID. The 57 retail TTPF pools contained 357,115 descriptors covering 20 formats. All 20 returned S_OK on native D3D12, parent 4947579 and head 7a9bebd. Parent and head returned identical Support1 and Support2 masks for every format. None exercised UNKNOWN or an unlisted format. For 14 formats (355,161 descriptors), only the native CAST_WITHIN_BIT_LAYOUT and TILED bits differed. Six formats had additional differences. In particular, the shim alone advertised BUFFER for DXGI 29 and 91. This predates the PR and is tracked separately. Capability queries only; no draw or texture creation in this run. AI-assisted.

@Darkz0rz

Copy link
Copy Markdown

Tested 7a9bebd2 on Windows 11 (build 26300) on two GPUs, against the host D3D12 runtime on each (LEONIDA_VK_DEVICE and LEONIDA_HOST_ADAPTER set to the same GPU): pass.

d3d12_vulkan_device_test with LEONIDA_D3D49_VERBOSE=1:

  • AMD Radeon iGPU (Ryzen 7 9800X3D, RDNA2), AMD 25.10.36 (32.0.21036.18): exit 0. All 11 format support: cases give the host's HRESULT (UNKNOWN returns S_OK; 116, 129, 130-132, 133, 188, 192, 1000 and -1 return E_FAIL). FORMAT_SUPPORT against the host: 94 formats compared, 0 mismatches.
  • NVIDIA RTX 4090 (Ada), 617.42: exit 0, with the same 11 matches and 94 formats compared, 0 mismatches.

With runtime/shims/d3d12_vulkan_device.cpp from the base 49475796 (only the test target rebuilt), the test fails on both GPUs at line 3965: ...CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &unknown_format, ...) == S_OK && unknown_format.Support1 == D3D12_FORMAT_SUPPORT1_BUFFER. With the PR's file it passes.

Full ctest: 116/116 on each GPU. That's fewer tests registered than the 124 others report with this build setup (VS 2026's CMake/Ninja), but none failed. scripts/run_gpu_tests.py: AMD 170/185 passed, 15 skipped; RTX 4090 139/185 native, 170/185 with LEONIDA_W64_EMULATE=1; no failures.

Tools: Vulkan SDK 1.4.363.0, MSVC from VS 2026 (18.11), Ninja RelWithDebInfo, VK_LOADER_LAYERS_DISABLE=~implicit~. No game files.

AI-assisted: setup and runs were done with Claude Code.

@ItsNotRexed
ItsNotRexed merged commit 23f61f5 into ItsNotRexed:main Nov 22, 2026
3 of 4 checks passed
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.

10 participants