Skip to content

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

Merged
ubiquitarianism merged 2 commits into
mainfrom
feat/xs-device-vm-options
Nov 24, 2026
Merged

ubiquitarianism merged 2 commits into
mainfrom
feat/xs-device-vm-options

Conversation

@Andretuta

@Andretuta Andretuta commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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

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

…2_OPTIONS and Xbox slots 81/86/108 (RT-XS-DEVICE-VM-OPTIONS)
# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
#	runtime/shims/d3d12_xs_device.h
#	runtime/test/xs_proxy_mock_test.cpp
@Andretuta Andretuta changed the title d3d12_xs: fill D3D12ConfigureVirtualMemoryX VA bounds, 0x40-byte D3D12_OPTIONS and Xbox slots 81/86/108 d3d12_vulkan_device: accept the console's 0x40-byte D3D12_OPTIONS query (RT-XS-DEVICE-VM-OPTIONS) Nov 24, 2026
@Oliwettoo

Copy link
Copy Markdown

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.

@ubiquitarianism
ubiquitarianism merged commit 56245df into main Nov 24, 2026
8 of 13 checks passed
demoz53 added a commit to demoz53/leonida that referenced this pull request Nov 24, 2026
Brings 58 PRs integration did not have (among them ProjectLeonida#359 ProjectLeonida#360 ProjectLeonida#402 ProjectLeonida#497 ProjectLeonida#557 ProjectLeonida#558
ProjectLeonida#560 ProjectLeonida#561 ProjectLeonida#572 ProjectLeonida#573 ProjectLeonida#574 ProjectLeonida#577) and the newer heads of ProjectLeonida#401 and ProjectLeonida#404. 15 files
conflicted; resolved by hand:

- frame_pacer.h, d3d12_xs_device.h/.cpp: ProjectLeonida#402's pacer (per-event ticks,
  issue_token_locked) now issues from ProjectLeonida#414's shared FrameTokenSource, so a token
  from the device-side WaitFrameEventX is one the pacer accepts (towade's ProjectLeonida#14
  finding: without it every PresentX is refused). The dead frame_next_token and
  issued_ counters are dropped. Queue slot 32 stays ProjectLeonida#414's PresentX; ProjectLeonida#402's
  presentation-handler routes serve slot 30 or LEONIDA_XS_PRESENT_X_SLOT.
  ProjectLeonida#402's GetFrameStatisticsX route moves into ProjectLeonida#385's route_xbox_device_slot.
- acphal.cpp/acphal_test.cpp: upstream's reworked SHAPE allocation and release;
  the release writes nothing through its first argument, as ProjectLeonida#405 requires; both
  sides' tests kept. Upstream's ProjectLeonida#401/ProjectLeonida#404 heads remove lifecycle.cpp and the C++
  xma2_decoder.cpp (replaced by runtime/xma_decoder), so build_runtime.ps1's
  cl.exe list drops them and keeps ProjectLeonida#549's and ProjectLeonida#400's files.
- vulkan_backend.h, statistics_sum.comp, its SPIR-V header, d3d12_mesh_test,
  replay_query_edges_test, d3d12_vulkan_device.cpp, docs: ProjectLeonida#577's clipping
  counter on top of ProjectLeonida#540, which both sides carry; the Timestamps sentence keeps
  integration's corrected wording (c33ce87).
- xs_proxy_mock_test.cpp: both sides' cases; pr_conflict_label.py keeps the
  guarded reconfigure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants