Skip to content

Report DXGI format plane counts on the Vulkan device (D3D-91) - #706

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
cemalyakla:d3d-91-format-info
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
cemalyakla:d3d-91-format-info

Conversation

@cemalyakla

@cemalyakla cemalyakla commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

The format plane-count implementation and regression tests from this PR are on main. The only remaining change against 067d3e8 is in docs/d3d12_vulkan.md. The feature list describes OPTIONS1 as unsupported even though the device implements it. This edit corrects that entry and removes duplicate text from the feature list and A8 paragraph. Original implementation merge · Latest upstream merge of the earlier documentation revision

Implementation already on main

The Vulkan-backed device now returns the DXGI plane count for D3D12_FEATURE_FORMAT_INFO. The regression test compares the Xbox-ABI proxy's HRESULT and output byte with native D3D12 across named formats, gaps and invalid inputs. For three newer formats that an older host may reject, it still requires the layer to report one plane. It also checks null and oversized buffers. D3D-91 claim · Coordinator assignment

Verification

  • The runtime and its tests are byte-identical to 067d3e8. On that revision, all 195 format queries matched native D3D12 on Windows 11 with an RTX 4070 Ti SUPER, NVIDIA driver 610.88 and Vulkan synchronization validation enabled.
  • The test passed when replaying the reported Windows 10 answer for format 191 and when simulating an older host rejecting all three newer formats. A deliberately wrong layer plane count and an unexpected host error on an ordinary format each produced one mismatch. Before the implementation landed, the fixture detected 118 mismatches on pristine 762893f.
  • On 067d3e8, all 34 enabled Windows CTest cases and all 11 Linux CTest cases passed. The standalone Windows clear test reports three existing Vulkan/WARP differences on that base. Optional SDL3 GameInput was disabled.

AI-assisted with OpenAI Codex. All test inputs were synthetic. The tracked-file scan found no game data.

@Derpbeat

Copy link
Copy Markdown
Contributor

Tested 562913f on an NVIDIA GeForce RTX 4090 (driver 617.14, Vulkan 1.4.351), Windows 10 Home 22H2 (19045), MSVC 19.39, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, LEONIDA_VK_VALIDATION=1: the layer change is right, but the new host comparison fails on Windows 10. (D3D-91.)

  • Build: no new warnings. ctest: 28/28 with validation. d3d12_descriptor_test, d3d12_method_variants_test, d3d12_com_test, vk_command_replay_test: pass, 0 validation messages.
  • d3d12_vulkan_device_test: FORMAT_INFO on NVIDIA GeForce RTX 4090: 195 queries, 1 mismatches, then line 1031: compare_format_info(device.p, d) == 0. The one mismatch:
    FORMAT_INFO format 191 size 8: HRESULT/planes 00000000/1, expected 80070057/255
    Format 191 is A4B4G4R4_UNORM, which the Windows 10 runtime doesn't know, so it returns E_INVALIDARG. The layer answers 1 plane, as Windows 11 does. So the layer is right and the expectation is host-version-dependent. Everything else matched, including the video formats and the gaps.
  • Negative control: with the shim put back to 762893f, the same comparison reports 117 mismatches (your 118 on Windows 11, less the one above). The test catches the missing feature.

Suggestion: skip (or log) formats the host rejects but the layer knows to be valid DXGI formats newer than the host runtime: 191, and probably 189/190 (sampler feedback) on older runtimes too, though those matched here. Then the test passes on Windows 10 instead of stopping. This check now sits at line 1031, before the footprint and resolve comparisons, so on Windows 10 it would be the first thing to stop d3d12_vulkan_device_test. That's the same problem TEST-97 is fixing for those two comparisons, so it may be worth mentioning there too.

AI-assisted (Claude Code); repository tests only, no game files.

@cemalyakla

Copy link
Copy Markdown
Contributor Author

Thanks for testing this on Windows 10. Rebased onto 67204bf and addressed the host difference in 660c2e4. If the host rejects format 191, 189 or 190 with E_INVALIDARG for a correctly sized query, the test still requires the layer to return S_OK and exactly one plane. It also prints which format the host rejected.

On Windows 11 with an RTX 4070 Ti SUPER, driver 610.88, all 195 live queries matched. Replaying your format-191 result and then simulating a host rejecting all three formats also passed all 195. Injecting a wrong plane count for 191 produced one mismatch. Windows CTest passed 30/30 and Linux CTest passed 10/10.

A rerun on your Windows 10 machine would confirm the native result. The later footprint and resolve comparisons are tracked in #717 (TEST-97).

@VeTkN

VeTkN commented Nov 22, 2026

Copy link
Copy Markdown

Tested 562913f on RTX 5070 (Blackwell), NVIDIA 621.01, Windows 11 Pro (10.0.26200), MSVC 19.51 (VS 2026 Build Tools), LEONIDA_VK_VALIDATION=1: pass.

d3d12_vulkan_device_test: FORMAT_INFO on NVIDIA GeForce RTX 5070: 195 queries, 0 mismatches; exit 0, 0 VUID messages
ctest: 28/28

This supports the Windows 10 result above: the format 191 (A4B4G4R4_UNORM) mismatch is host-version-dependent. On Windows 11 the host answers like the layer, so all 195 queries match. No game files.

AI-assisted (Claude)

@cemalyakla

Copy link
Copy Markdown
Contributor Author

Rebased onto 8df277f in 527e41c after the merge round. The device test includes #717’s Windows 10 footprint and resolve checks alongside the format comparison. All 195 live queries matched on Windows 11, RTX 4070 Ti SUPER, driver 610.88, with Vulkan validation enabled. Replaying the Windows 10 answer for format 191 also passed. A deliberately wrong plane count still failed.

Windows CTest passed 32/32 and Linux CTest passed 11/11. The restored submodule pin also fixes the earlier rpf9dump build failure. The standalone RGBA8 clear showed the same one-byte difference on pristine upstream. The native Windows 10 rerun would still be welcome.

@quackottu quackottu 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.

Tested 527e41c on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • ctest -C RelWithDebInfo: 97% tests passed, 1 tests failed out of 31
  • d3d12_vulkan_device_test (changed here): exit=1 validation=0 | 10 validation errors
  • 30 test programs in the build pass with 0 validation errors
  • d3d12_clear_test fails (format 28 case 0 byte 2: Vulkan 7f, WARP 80) exactly as on main 67204bf, so not from this PR: NVIDIA rounds a 0.5 UNORM clear to 0x7f, which #521 addresses
  • d3d12_vulkan_device_test reports 10 synchronization-validation WRITE_AFTER_WRITE hazards on back-to-back copies (so ctest's d3d12_vulkan_device fails). main 8df277f shows the same 10 here, so not from this PR: it's @guimsolutions's finding in #634, which #782 addresses

Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.

@cemalyakla

Copy link
Copy Markdown
Contributor Author

Rebased onto dedd75c in 0b312b0 as requested. The conflict was in the feature documentation. It now lists the merged options queries alongside format plane counts.

All 195 format queries matched on Windows 11 with RTX 4070 Ti SUPER, driver 610.88. Replaying the Windows 10 response for format 191 also passed. Windows CTest passed all 33 enabled cases, with optional SDL3 GameInput disabled. Linux CTest passed 11/11. The standalone clear test reproduced the one-byte difference on pristine upstream.

@cemalyakla

Copy link
Copy Markdown
Contributor Author

Thanks for running synchronization validation on both 527e41c and its base. The new base dedd75c includes the copy-ordering fix from #782. I reran the full device test with VK_LAYER_VALIDATE_SYNC=1 on pristine dedd75c and on the rebased 0b312b0 (RTX 4070 Ti SUPER, driver 610.88). Both exited 0 with zero reported synchronization hazards. All 195 format comparisons matched on the PR. The separate RGBA8 clear still differs by one byte on both revisions, as you observed. Original RTX 5070 results

ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	docs/d3d12_vulkan.md
@cemalyakla

Copy link
Copy Markdown
Contributor Author

The implementation and its regression tests landed from 527e41c in the upstream merge of #706. GitHub still lists this PR as open. I rebased its remaining documentation correction in ddc5677. The entire runtime and test tree is identical to 4a36bb1. The one-file diff removes a stale statement that FORMAT_INFO is unimplemented and preserves the A8 documentation.

I verified all 195 format queries on the merged code with an RTX 4070 Ti SUPER, driver 610.88. The replay of the Windows 10 response for format 191 also passed. Thanks for getting the implementation into main.

ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	docs/d3d12_vulkan.md
@cemalyakla

Copy link
Copy Markdown
Contributor Author

Rebased the documentation correction onto d1211d0 in 998916d. The second upstream merge picked up 0b312b0, but its feature list still calls FORMAT_INFO unimplemented and lists the newly supported OPTIONS1 among the refused queries. This edit removes the duplicate entries and preserves the XR-bias and A8 format documentation.

Only the Markdown file differs from main. On this base the device test matched all 195 format queries and exercised OPTIONS1 on an RTX 4070 Ti SUPER, driver 610.88, with synchronization validation enabled.

ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	docs/d3d12_vulkan.md
@cemalyakla

Copy link
Copy Markdown
Contributor Author

The latest upstream merge picked up the earlier documentation revision ddc5677. I resolved the remaining conflict on 067d3e8 in 4b1bb24. The diff is one Markdown file. It removes the duplicate feature summary and records OPTIONS1 as supported, matching the implementation and device test.

On the new base, all 195 format queries matched native D3D12, the OPTIONS1 query succeeded, and all 34 enabled Windows CTest cases and all 11 Linux CTest cases passed. Windows verification used an RTX 4070 Ti SUPER, driver 610.88, with synchronization validation enabled.

@ItsNotRexed
ItsNotRexed merged commit abbedcc into ItsNotRexed:main Nov 22, 2026
6 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.

5 participants