d3d12_vulkan_device: accept the console's 0x40-byte D3D12_OPTIONS query (RT-XS-DEVICE-VM-OPTIONS) #360

Manually merged
github merged 2 commits from gh-pr/360/head into gh-pr/360/base 2026-11-26 08:55:30 +00:00
Owner

@⁠Andretuta on GitHub · 2026-11-24 03:53 UTC · original
ubiquitarianism:feat/xs-device-vm-options → main · +31 −18 · 2 files · 2 commits · merged 2026-11-24 13:44 UTC

Claimed in the coordination issue as: RT-XS-DEVICE-VM-OPTIONS (#14)

What and why

Reduced after review to the part with a public measurement behind it:

  • CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS) (runtime/shims/d3d12_vulkan_device.cpp): accepts the 0x40-byte (16-dword) buffer console titles ask for (docs/d3d12_xs_surface.md §7.1: XCL measured the 0x40 request; the extra 4 bytes are unnamed) as well as the 0x3C-byte PC structure, fills the 15-field PC prefix and zeroes the trailing word. Coverage in runtime/test/d3d12_vulkan_device_test.cpp.

Dropped from this pull request: the D3D12ConfigureVirtualMemoryX VA bounds and device slots 86/108 (no measurement; slot 108 forwarded GetResourceAllocationInfo2's D3D12_RESOURCE_DESC1 array to PC GetResourceAllocationInfo). Slot 81 (GetFrameStatisticsX) moved to #402, which owns the presentation slots.

Tested

  • Not built locally: MinGW's d3d12.h lacks ID3D12GraphicsCommandList8, so d3d12_vulkan_device_test needs the MSVC CI build.

GPUs tested: n/a

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)

🤖 Generated with Claude Code

**@⁠Andretuta** on GitHub · 2026-11-24 03:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/360) `ubiquitarianism:feat/xs-device-vm-options` → `main` · +31 −18 · 2 files · 2 commits · merged 2026-11-24 13:44 UTC Claimed in the coordination issue as: RT-XS-DEVICE-VM-OPTIONS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Reduced after review to the part with a public measurement behind it: - **`CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS)` (`runtime/shims/d3d12_vulkan_device.cpp`):** accepts the 0x40-byte (16-dword) buffer console titles ask for (`docs/d3d12_xs_surface.md` §7.1: XCL measured the 0x40 request; the extra 4 bytes are unnamed) as well as the 0x3C-byte PC structure, fills the 15-field PC prefix and zeroes the trailing word. Coverage in `runtime/test/d3d12_vulkan_device_test.cpp`. Dropped from this pull request: the `D3D12ConfigureVirtualMemoryX` VA bounds and device slots 86/108 (no measurement; slot 108 forwarded `GetResourceAllocationInfo2`'s `D3D12_RESOURCE_DESC1` array to PC `GetResourceAllocationInfo`). Slot 81 (`GetFrameStatisticsX`) moved to #402, which owns the presentation slots. ### Tested - Not built locally: MinGW's `d3d12.h` lacks `ID3D12GraphicsCommandList8`, so `d3d12_vulkan_device_test` needs the MSVC CI build. GPUs tested: n/a 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) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:55:28 +00:00
github manually merged commit bff649b34d into gh-pr/360/base 2026-11-26 08:55:30 +00:00
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-24 10:30 UTC · original

Read-through, not built (the shims are Windows-only and I had no Windows box). The size math is right: the PC D3D12_FEATURE_DATA_D3D12_OPTIONS is 15 dwords = 0x3C, so 0x40 is one extra UINT, and the tail is zeroed. This makes the code do what docs/d3d12_xs_surface.md already describes as current behaviour (§7.1 and the CheckFeatureSupport answers row), which main doesn't do yet: it still returns E_INVALIDARG for 0x40. The test pre-fills the tail with 0xdeadbeef, so it does check the zeroing. Looks good to me; a Windows build/ctest run from someone with the toolchain would close it. AI-assisted review.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/360#issuecomment-7128879673) Read-through, not built (the shims are Windows-only and I had no Windows box). The size math is right: the PC `D3D12_FEATURE_DATA_D3D12_OPTIONS` is 15 dwords = 0x3C, so 0x40 is one extra `UINT`, and the tail is zeroed. This makes the code do what `docs/d3d12_xs_surface.md` already describes as current behaviour (§7.1 and the `CheckFeatureSupport` answers row), which `main` doesn't do yet: it still returns `E_INVALIDARG` for 0x40. The test pre-fills the tail with `0xdeadbeef`, so it does check the zeroing. Looks good to me; a Windows build/ctest run from someone with the toolchain would close it. AI-assisted review.
This discussion has been locked. Commenting is limited to contributors.
No description provided.