[PR #913] [MERGED] d3d12_xs: ask the host D3D12CreateDevice for feature level 11_0 (BL-2) #950

Closed
opened 2026-11-26 20:19:36 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/913
Author: @kawaii-shakal
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @aslan2142

Base: main ← Head: bl2-feature-level


📝 Commits (1)

  • 245c959 d3d12_xs: ask the host D3D12CreateDevice for feature level 11_0 (BL-2)

📊 Changes

5 files changed (+135 additions, -8 deletions)

View changed files

📝 docs/d3d12_xs_surface.md (+14 -0)
📝 runtime/shims/d3d12_xs.cpp (+6 -7)
📝 runtime/shims/d3d12_xs_device.cpp (+27 -0)
📝 runtime/shims/d3d12_xs_device.h (+12 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+76 -1)

📄 Description

Claimed in the coordination issue as: BL-2 (claim). See docs/boot_leads.md §BL-2.

What and why

The host path of D3D12XboxCreateDevice (runtime/shims/d3d12_xs.cpp) called the PC D3D12CreateDevice with D3D_FEATURE_LEVEL_12_0 as the minimum. The comment called that "the least restrictive floor", but it is the other way round: the minimum refuses every adapter below it, so a host that tops out at 11_x failed with E_INVALIDARG (BL-2's finding, and @abnalstlll-byte's in #14). Asking for 11_0 refuses nothing the title could run on, and the device keeps its highest level.

  • rt::d3d12_xs::create_host_device(create, adapter, out) asks for kHostDeviceFloor = 11_0, the lowest level D3D12 creates a device at. It clears *out on every failure: a null host function gives E_NOTIMPL, and S_OK with no device gives E_FAIL. It also logs the device's top level, for example "host device created at minimum feature level 11_0; highest level 12_1".
  • max_feature_level(device) returns the top of 11_0…12_2 from D3D12_FEATURE_FEATURE_LEVELS.
  • D3D12XboxCreateDevice uses create_host_device. The rest of that function is unchanged.
  • The Vulkan-backed device (LEONIDA_D3D12=vulkan) takes no feature level. It still answers FEATURE_LEVELS up to 12_1, because it reports no ray tracing tier and no sampler feedback, and 12_2 needs both. That is what the lead asks for: "12_2 only where mesh shaders and ray tracing are present".

Tests

xs_proxy_mock_test, new check_host_device_floor, with no D3D12 runtime and no GPU:

  • mock hosts that top out at 11_0, 11_1, 12_0, 12_1 and 12_2. Each is created at 11_0, the device keeps its top level, and the Xbox-ABI proxy's slot 13 (CheckFeatureSupport) reports that level;
  • the same hosts asked for the old 12_0 floor: the 11_x ones fail, as on the hosts BL-2 describes;
  • the failure paths: no host function, a failing host, S_OK with no device, and a null output.

Mutation check: with create_host_device asking for 12_0, xs_proxy_mock_test fails at the 11_0 host.

Tested

Windows 11 Pro 26300, MSVC 19.50.35721.0, Vulkan SDK 1.4.363.0. Tested on main 8f05e09e2, then rebased onto a28927849 with no conflicts.

  • ctest -R "xs_proxy|d3d12_xs|device_proxy|queue_proxy": 9/9 passed. The WARP and RTX 5070 Ti host devices log "highest level 12_1".
  • Whole ctest -C RelWithDebInfo: 295 run, 294 passed. The one failure is d3d12_execute_indirect_validation, which fails on main too (#337 / #306).
  • python -I scripts/check_no_game_data.py on the changed files: clean. tests/test_docs_*.py: all pass except test_docs_links, which flags docs/boot_leads.md → CONTRIBUTING.md. That file is not touched here; the failure comes from main.

Not reproduced: the original 11_x failure on a Wine/Proton host (none available here). The mock host stands in for it.

GPUs tested: NVIDIA GeForce RTX 5070 Ti (Blackwell, PCI 10de:2c05), driver 617.42, Vulkan 1.4.351, Windows 11 Pro 26300; WARP for the host-device path.

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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/913 **Author:** [@kawaii-shakal](https://github.com/kawaii-shakal) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `bl2-feature-level` --- ### 📝 Commits (1) - [`245c959`](https://github.com/ubiquitarianism/leonida/commit/245c959ea0a109904b0fb6f1f6f1bafee241f8f4) d3d12_xs: ask the host D3D12CreateDevice for feature level 11_0 (BL-2) ### 📊 Changes **5 files changed** (+135 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_xs_surface.md` (+14 -0) 📝 `runtime/shims/d3d12_xs.cpp` (+6 -7) 📝 `runtime/shims/d3d12_xs_device.cpp` (+27 -0) 📝 `runtime/shims/d3d12_xs_device.h` (+12 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+76 -1) </details> ### 📄 Description Claimed in the coordination issue as: BL-2 ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135268627)). See [docs/boot_leads.md §BL-2](docs/boot_leads.md). ### What and why The host path of `D3D12XboxCreateDevice` (`runtime/shims/d3d12_xs.cpp`) called the PC `D3D12CreateDevice` with `D3D_FEATURE_LEVEL_12_0` as the minimum. The comment called that "the least restrictive floor", but it is the other way round: the minimum refuses every adapter below it, so a host that tops out at 11_x failed with `E_INVALIDARG` (BL-2's finding, and @abnalstlll-byte's in #14). Asking for 11_0 refuses nothing the title could run on, and the device keeps its highest level. - `rt::d3d12_xs::create_host_device(create, adapter, out)` asks for `kHostDeviceFloor` = 11_0, the lowest level D3D12 creates a device at. It clears `*out` on every failure: a null host function gives `E_NOTIMPL`, and `S_OK` with no device gives `E_FAIL`. It also logs the device's top level, for example "host device created at minimum feature level 11_0; highest level 12_1". - `max_feature_level(device)` returns the top of 11_0…12_2 from `D3D12_FEATURE_FEATURE_LEVELS`. - `D3D12XboxCreateDevice` uses `create_host_device`. The rest of that function is unchanged. - The Vulkan-backed device (`LEONIDA_D3D12=vulkan`) takes no feature level. It still answers `FEATURE_LEVELS` up to 12_1, because it reports no ray tracing tier and no sampler feedback, and 12_2 needs both. That is what the lead asks for: "12_2 only where mesh shaders and ray tracing are present". ### Tests `xs_proxy_mock_test`, new `check_host_device_floor`, with no D3D12 runtime and no GPU: - mock hosts that top out at 11_0, 11_1, 12_0, 12_1 and 12_2. Each is created at 11_0, the device keeps its top level, and the Xbox-ABI proxy's slot 13 (`CheckFeatureSupport`) reports that level; - the same hosts asked for the old 12_0 floor: the 11_x ones fail, as on the hosts BL-2 describes; - the failure paths: no host function, a failing host, `S_OK` with no device, and a null output. Mutation check: with `create_host_device` asking for 12_0, `xs_proxy_mock_test` fails at the 11_0 host. ### Tested Windows 11 Pro 26300, MSVC 19.50.35721.0, Vulkan SDK 1.4.363.0. Tested on `main` 8f05e09e2, then rebased onto a28927849 with no conflicts. - `ctest -R "xs_proxy|d3d12_xs|device_proxy|queue_proxy"`: 9/9 passed. The WARP and RTX 5070 Ti host devices log "highest level 12_1". - Whole `ctest -C RelWithDebInfo`: 295 run, 294 passed. The one failure is `d3d12_execute_indirect_validation`, which fails on `main` too (#337 / #306). - `python -I scripts/check_no_game_data.py` on the changed files: clean. `tests/test_docs_*.py`: all pass except `test_docs_links`, which flags `docs/boot_leads.md` → `CONTRIBUTING.md`. That file is not touched here; the failure comes from `main`. Not reproduced: the original 11_x failure on a Wine/Proton host (none available here). The mock host stands in for it. GPUs tested: NVIDIA GeForce RTX 5070 Ti (Blackwell, PCI 10de:2c05), driver 617.42, Vulkan 1.4.351, Windows 11 Pro 26300; WARP for the host-device path. AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:36 +01:00
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#950
No description provided.