d3d12_vulkan_device: answer features 56 and 57 before the CheckFeatureSupport switch (MSVC C4063) #49

Open
github-bot wants to merge 1 commit from github-bot/gh-49 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:07 UTC · original
ubiquitarianism:old-pr/9771 → main · +6 −4 · 1 files · 1 commits · draft

Carried over from old PR 9771 by ThomasSAMP in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9771, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
ThomasSAMP: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115476617 (new item; no ID assigned yet)

What and why

ID3D12Device::CheckFeatureSupport in runtime/shims/d3d12_vulkan_device.cpp answers APPLICATION_SPECIFIC_DRIVER_STATE (56) and BYTECODE_BYPASS_HASH_SUPPORTED (57) through case labels on compat::kFeatureApplicationSpecificDriverState and compat::kFeatureBytecodeBypassHashSupported. d3d12_feature_compat.h declares those two by value because some Windows SDK 10.0.26100 headers end the D3D12_FEATURE enum before them. On those SDKs the labels fall outside the enum, so every build of gta6rt_d3d12_com warns twice:

d3d12_vulkan_device.cpp(7794,9): warning C4063: case '56' is not a valid value for switch of enum 'D3D12_FEATURE'
d3d12_vulkan_device.cpp(7796,9): warning C4063: case '57' is not a valid value for switch of enum 'D3D12_FEATURE'

This PR answers the two features before the switch, with the same write_supported_feature<compat::FeatureSupportFlag>(method, data, size, FALSE) they used before. The size check, the payload and the HRESULTs are unchanged, and no other feature is touched. On a header that does declare 56 and 57, the switch simply no longer lists them.

Tested

Windows 11 Pro 26300, MSVC 14.44 (VS 2022, RelWithDebInfo), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, AMD Radeon RX 9070 XT (RDNA4), AMD driver 32.0.32029.2010.

On the current main (2d53a8055, this branch's base), gta6rt_d3d12_com doesn't compile on MSVC, with or without this change. There are 5 errors, all from the console descriptor heap merged with #9576: C2665/C2248 in d3d12_vulkan_device.cpp (DescriptorHeap constructor, private Device::identity) and rt::d3d12::create_console_descriptor_heap not found in d3d12_xs_device.cpp:1606. VEgE has offered to fix that. The compiler still reaches the switch, though. On 2d53a8055 it prints both C4063 warnings without this change and none with it.

The runtime results below are from the same change on main 5d74c2723, before that break:

  • Rebuilt gta6rt_d3d12_com and d3d12_vulkan_device_test. On main the build prints the two C4063 warnings above. With this change it prints none, and no new warnings appear. The remaining ones are on main too: C4189 in vulkan_present.h:669, which is #7442, and two C4456 in d3d12_vulkan_device_test.cpp:6982/6989.
  • d3d12_vulkan_device_test (run with VK_LOADER_LAYERS_DISABLE=~implicit~, see docs/testing.md): stdout is byte-identical to main's. That includes CheckFeatureSupport options (AMD Radeon RX 9070 XT): 45 feature queries compared (1 host-unsupported skipped), ... 0 mismatches, which compares 56 and 57 with the host runtime (compare_host at lines 2794/2799, query_ours at 2394-2400). stderr differs only in pointer values.
  • The test exits 1 at line 6574: tiles == 1 with and without this change. That is the Device10 CreateReservedResource2 path through the Xbox proxy's slot 78, which #9175, #8496 and #7125 address. It runs after the feature queries.
  • git diff --check and python -I scripts/check_no_game_data.py runtime/shims/d3d12_vulkan_device.cpp: clean.

No game files used. AI-assisted: yes (Claude Code); I reviewed the change and ran the tests.

  • 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: no translator change)

🤖 Generated with Claude Code

**@⁠Andretuta** on GitHub · 2026-11-24 02:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/49) `ubiquitarianism:old-pr/9771` → `main` · +6 −4 · 1 files · 1 commits · draft > Carried over from **old PR 9771** by `ThomasSAMP` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9771`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `ThomasSAMP`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115476617 (new item; no ID assigned yet) ### What and why `ID3D12Device::CheckFeatureSupport` in `runtime/shims/d3d12_vulkan_device.cpp` answers `APPLICATION_SPECIFIC_DRIVER_STATE` (56) and `BYTECODE_BYPASS_HASH_SUPPORTED` (57) through `case` labels on `compat::kFeatureApplicationSpecificDriverState` and `compat::kFeatureBytecodeBypassHashSupported`. `d3d12_feature_compat.h` declares those two by value because some Windows SDK 10.0.26100 headers end the `D3D12_FEATURE` enum before them. On those SDKs the labels fall outside the enum, so every build of `gta6rt_d3d12_com` warns twice: ``` d3d12_vulkan_device.cpp(7794,9): warning C4063: case '56' is not a valid value for switch of enum 'D3D12_FEATURE' d3d12_vulkan_device.cpp(7796,9): warning C4063: case '57' is not a valid value for switch of enum 'D3D12_FEATURE' ``` This PR answers the two features before the `switch`, with the same `write_supported_feature<compat::FeatureSupportFlag>(method, data, size, FALSE)` they used before. The size check, the payload and the HRESULTs are unchanged, and no other feature is touched. On a header that does declare 56 and 57, the `switch` simply no longer lists them. ### Tested Windows 11 Pro 26300, MSVC 14.44 (VS 2022, RelWithDebInfo), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, **AMD Radeon RX 9070 XT (RDNA4), AMD driver 32.0.32029.2010**. On the current `main` (`2d53a8055`, this branch's base), `gta6rt_d3d12_com` doesn't compile on MSVC, with or without this change. There are 5 errors, all from the console descriptor heap merged with `#9576`: `C2665`/`C2248` in `d3d12_vulkan_device.cpp` (`DescriptorHeap` constructor, private `Device::identity`) and `rt::d3d12::create_console_descriptor_heap` not found in `d3d12_xs_device.cpp:1606`. VEgE has offered to fix that. The compiler still reaches the switch, though. On `2d53a8055` it prints both C4063 warnings without this change and none with it. The runtime results below are from the same change on `main` `5d74c2723`, before that break: - Rebuilt `gta6rt_d3d12_com` and `d3d12_vulkan_device_test`. On `main` the build prints the two C4063 warnings above. With this change it prints none, and no new warnings appear. The remaining ones are on `main` too: C4189 in `vulkan_present.h:669`, which is `#7442`, and two C4456 in `d3d12_vulkan_device_test.cpp:6982/6989`. - `d3d12_vulkan_device_test` (run with `VK_LOADER_LAYERS_DISABLE=~implicit~`, see `docs/testing.md`): stdout is **byte-identical** to `main`'s. That includes `CheckFeatureSupport options (AMD Radeon RX 9070 XT): 45 feature queries compared (1 host-unsupported skipped), ... 0 mismatches`, which compares 56 and 57 with the host runtime (`compare_host` at lines 2794/2799, `query_ours` at 2394-2400). stderr differs only in pointer values. - The test exits 1 at `line 6574: tiles == 1` with and without this change. That is the Device10 `CreateReservedResource2` path through the Xbox proxy's slot 78, which `#9175`, `#8496` and `#7125` address. It runs after the feature queries. - `git diff --check` and `python -I scripts/check_no_game_data.py runtime/shims/d3d12_vulkan_device.cpp`: clean. No game files used. AI-assisted: yes (Claude Code); I reviewed the change and ran the tests. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Some Windows SDK 10.0.26100 headers end the D3D12_FEATURE enum before
APPLICATION_SPECIFIC_DRIVER_STATE (56) and BYTECODE_BYPASS_HASH_SUPPORTED
(57), which d3d12_feature_compat.h declares by value. Their case labels in
the CheckFeatureSupport switch were outside the enum, so every build of
gta6rt_d3d12_com warned twice (C4063). Answer the two before the switch,
with the same one-BOOL "not supported" payload through
write_supported_feature; nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:42:19 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/49/head:github-bot/gh-49'
git switch 'github-bot/gh-49'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-49'
git switch 'github-bot/gh-49'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-49'
git switch 'github-bot/gh-49'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-49'
git switch 'main'
git merge --squash 'github-bot/gh-49'
git switch 'main'
git merge --ff-only 'github-bot/gh-49'
git switch 'main'
git merge 'github-bot/gh-49'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.