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

Merged
Andretuta merged 2 commits from upstream-pr/360 into main 2026-11-24 13:44:21 +00:00
Andretuta commented 2026-11-24 03:53:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T03:53:40Z.


Claimed in the coordination issue as: RT-XS-DEVICE-VM-OPTIONS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121196296)

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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465759283 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/360). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T03:53:40Z. --- Claimed in the coordination issue as: RT-XS-DEVICE-VM-OPTIONS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121196296) ### 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)
Oliwettoo commented 2026-11-24 10:30:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:30:47Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7128879673 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/360#issuecomment-7128879673). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:30:47Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!360
No description provided.