feat(d3d12_x): add the Vulkan backend's capability query and a GPU report #32

Manually merged
github merged 1 commit from gh-pr/32/head into gh-pr/32/base 2026-11-26 19:14:35 +00:00
Owner

@⁠Dark3581 on GitHub · 2026-11-22 03:35 UTC · original
Dark3581:feat/vulkan-backend → main · +615 −2 · 17 files · 1 commits · merged 2026-11-22 03:38 UTC

What

Third of the three pull requests planned in #4: the first piece of the Vulkan backend, testable without an executable.

  • d3d12_x_vulkan (core/libs/xdll/d3d12_x/vulkan/, linked into ab_d3d12_x.dll): loads vulkan-1.dll from the system folder only, creates an instance at the loader's version (capped at 1.3) and, for every physical device, reports name, type, API and driver version, vendor and device ID, maxPushConstantsSize, subgroup size, size range, stages, operations and required-size stages, the device extensions, and 29 features, among them bufferDeviceAddress, runtimeDescriptorArray, meshShader, storage image read/write without format, barycentrics, pixel interlock, subgroupSizeControl, descriptorBuffer. A feature struct is chained only when the device's API version or extension provides it. The loader library and the instance are RAII objects. It creates no device yet; D3D12XboxCreateDevice keeps stopping until the executable's call sites give its parameters.
  • anybox-gpu-report.exe prints that report as JSON (exit 3 when no Vulkan loader or device).
  • tools/gpu_report.py [--store <folder>] lists the devices and, given a shader store (#31), whether each device supports what its modules need: the union of their features, the largest push constant block, each subgroup operation per stage (bits checked against vulkan_core.h), and wave64 modules translated without emulation.
  • Vulkan-Headers v1.4.363 (2026-09-18) as 3rdparty/Vulkan-Headers; the C headers are Apache-2.0 OR MIT, used under MIT. The Windows CI job now checks out submodules; a missing submodule stops configuration with the command to fetch it. Relinker-only builds do not need it.
  • BUILD.md (submodules, the two probe executables in the outputs), GAME_TESTING.md ("Before a run"), and debt: the Inventory entry now names the Vulkan decision, plus a VulkanBackend entry.

Tested

  • Windows 10, MinGW WinLibs GCC 15.2 UCRT, Ninja, Release, clean build directory: no warnings, CTest 57/57; gpu_report, shader_store and the crash scenarios passed 5 repeats. Relinker-only build: 26/26.
  • gpu_report (CTest) runs anybox-gpu-report.exe and checks the JSON shape; on a machine without Vulkan it checks the error path instead (expected on CI runners).
  • test_gpu_report (Python): requirement union, a capable device, every kind of gap (missing or unqueried feature, push constants, subgroup operation per stage, unchecked capability, native wave64), and a 64-wide device. Tools suite 60/60.
  • On an NVIDIA GeForce RTX 3070 Ti (Vulkan 1.4.357): 29 of 29 queried features present, subgroup size fixed at 32, push constants 256 bytes; against one title's shader store (25,889 modules) it reports that the device supports every module. No game data in the PR.
  • check_conventions.py, debt_fold.py --check (14 fragments), progress.py --json pass.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • python tools/check_conventions.py passes (no comments in code, one declaration per export, Conventional Commit subjects)
  • Unimplemented paths stop (AbxNotImplemented / AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragment
  • Known gaps added, changed or removed through docs/dev/debt/changes/<branch>.md
  • Generic behaviour, not specific to one title
  • No game files, keys, notes or logs added to the repository
  • Depends on: #31 (merged)
  • Fixes: none
  • Unblocks: none
  • Source of behaviour: Vulkan 1.3 specification and vulkan_core.h from Vulkan-Headers v1.4.363
  • AI-assisted: yes
**@⁠Dark3581** on GitHub · 2026-11-22 03:35 UTC · [original](https://github.com/Dark3581/AnyBox/pull/32) `Dark3581:feat/vulkan-backend` → `main` · +615 −2 · 17 files · 1 commits · merged 2026-11-22 03:38 UTC ### What Third of the three pull requests planned in #4: the first piece of the Vulkan backend, testable without an executable. - **`d3d12_x_vulkan`** (`core/libs/xdll/d3d12_x/vulkan/`, linked into `ab_d3d12_x.dll`): loads `vulkan-1.dll` from the system folder only, creates an instance at the loader's version (capped at 1.3) and, for every physical device, reports name, type, API and driver version, vendor and device ID, `maxPushConstantsSize`, subgroup size, size range, stages, operations and required-size stages, the device extensions, and 29 features, among them `bufferDeviceAddress`, `runtimeDescriptorArray`, `meshShader`, storage image read/write without format, barycentrics, pixel interlock, `subgroupSizeControl`, `descriptorBuffer`. A feature struct is chained only when the device's API version or extension provides it. The loader library and the instance are RAII objects. It creates no device yet; `D3D12XboxCreateDevice` keeps stopping until the executable's call sites give its parameters. - **`anybox-gpu-report.exe`** prints that report as JSON (exit 3 when no Vulkan loader or device). - **`tools/gpu_report.py [--store <folder>]`** lists the devices and, given a shader store (#31), whether each device supports what its modules need: the union of their features, the largest push constant block, each subgroup operation per stage (bits checked against `vulkan_core.h`), and wave64 modules translated without emulation. - **Vulkan-Headers** `v1.4.363` (2026-09-18) as `3rdparty/Vulkan-Headers`; the C headers are `Apache-2.0 OR MIT`, used under MIT. The Windows CI job now checks out submodules; a missing submodule stops configuration with the command to fetch it. Relinker-only builds do not need it. - BUILD.md (submodules, the two probe executables in the outputs), GAME_TESTING.md ("Before a run"), and debt: the `Inventory` entry now names the Vulkan decision, plus a `VulkanBackend` entry. ### Tested - Windows 10, MinGW WinLibs GCC 15.2 UCRT, Ninja, Release, clean build directory: no warnings, CTest 57/57; `gpu_report`, `shader_store` and the crash scenarios passed 5 repeats. Relinker-only build: 26/26. - `gpu_report` (CTest) runs `anybox-gpu-report.exe` and checks the JSON shape; on a machine without Vulkan it checks the error path instead (expected on CI runners). - `test_gpu_report` (Python): requirement union, a capable device, every kind of gap (missing or unqueried feature, push constants, subgroup operation per stage, unchecked capability, native wave64), and a 64-wide device. Tools suite 60/60. - On an NVIDIA GeForce RTX 3070 Ti (Vulkan 1.4.357): 29 of 29 queried features present, subgroup size fixed at 32, push constants 256 bytes; against one title's shader store (25,889 modules) it reports that the device supports every module. No game data in the PR. - `check_conventions.py`, `debt_fold.py --check` (14 fragments), `progress.py --json` pass. ### Checklist <!-- Rules behind each item: CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] `python tools/check_conventions.py` passes (no comments in code, one declaration per export, Conventional Commit subjects) - [x] Unimplemented paths stop (`AbxNotImplemented` / `AbxUnsupported`); silent stubs are listed under Silent stubs through a debt fragment - [x] Known gaps added, changed or removed through `docs/dev/debt/changes/<branch>.md` - [x] Generic behaviour, not specific to one title - [x] No game files, keys, notes or logs added to the repository - [x] Depends on: #31 (merged) - [x] Fixes: none - [x] Unblocks: none - [x] Source of behaviour: Vulkan 1.3 specification and `vulkan_core.h` from Vulkan-Headers v1.4.363 - [x] AI-assisted: yes
d3d12_x goes to Vulkan (#4). The d3d12_x_vulkan library loads vulkan-1.dll from the system folder, creates a 1.3 instance and reports each device's features, extensions, subgroup sizes and push constant limit, chaining a feature struct only where the device's version or extensions provide it. anybox-gpu-report.exe prints that as JSON, and tools/gpu_report.py checks it against a shader store's needs: features, push constants, subgroup operations per stage and wave64 without emulation. Vulkan-Headers v1.4.363 (Apache-2.0 OR MIT) is a submodule; the Windows CI job checks submodules out.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:14:32 +00:00
github manually merged commit fbf4edaff8 into gh-pr/32/base 2026-11-26 19:14:35 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.