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

Open
opened 2026-11-26 20:16:48 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/49
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9771


📝 Commits (1)

  • 72751d0 d3d12_vulkan_device: answer features 56 and 57 before the CheckFeatureSupport switch (MSVC C4063)

📊 Changes

1 file changed (+6 additions, -4 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+6 -4)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/49 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9771` --- ### 📝 Commits (1) - [`72751d0`](https://github.com/ubiquitarianism/leonida/commit/72751d02a8d282dab2bbb4c84343ebeaa6b37cfa) d3d12_vulkan_device: answer features 56 and 57 before the CheckFeatureSupport switch (MSVC C4063) ### 📊 Changes **1 file changed** (+6 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+6 -4) </details> ### 📄 Description > 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#101
No description provided.