Skip to content

runtime/shims: fix acphal context sizes and guard Vulkan heap helper on non-Vulkan builds - #87

Closed
Andretuta wants to merge 2 commits into
mainfrom
old-pr/9815
Closed

Andretuta wants to merge 2 commits into
mainfrom
old-pr/9815

Conversation

@Andretuta

Copy link
Copy Markdown
Collaborator

Carried over from old PR 9815 by piyonchu in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9815, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
This branch conflicts with the current main and needs a rebase.
piyonchu: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Fixes two CPU-only Windows MSVC build regressions on main (2d53a8055):

Changes

  1. runtime/shims/acphal.cpp:
    • Fix SHAPE_XMA_CONTEXT padding (reserved[10] -> reserved[11]): the preceding 24-bit bitfield group followed by 26-bit currentByteOffset splits into separate 32-bit storage units under MSVC, making the struct 60 bytes and failing static_assert(sizeof(SHAPE_XMA_CONTEXT) == 64). Static analysis of game_scarlett_master.exe confirms shl r8, 6 (64-byte stride) when zeroing the XMA context array.
    • Fix SHAPE_PCM_CONTEXT padding (reserved[1] -> reserved[2]): 6 32-bit bitfield words + 1 reserved dword was 28 bytes, failing static_assert(sizeof(SHAPE_PCM_CONTEXT) == 32).
  2. runtime/shims/d3d12_xs_device.cpp:
    • Include "d3d12_com.h" and call rt::d3d12::create_console_descriptor_heap(...) only when LEONIDA_VULKAN_DEVICE is defined, so CPU-only gta6rt builds (without Vulkan headers/device) compile and link cleanly and fall back to standard CreateDescriptorHeap.

Verification

  • Full cmake -S runtime -B build_fix + cmake --build build_fix --config Release -j: built gta6rt.exe and all CPU test targets cleanly on MSVC 19.44 (10.0.26100.0 SDK).
  • ctest --test-dir build_fix -C Release -R "acphal|device_proxy|xs_proxy|com_shim|bcrypt_rng": 12/12 passed.
  • python tests/test_acphal_abi.py: 4/4 OK.
  • python tests/test_ctest_registration.py: 4/4 OK.
  • gta6rt.exe --dry-run game_scarlett_master.exe: resolves AcpHal.dll (9/9 exports via shim).
  • python scripts/check_no_game_data.py, git diff --check.
  • Claimed on #9677 (https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116626255).

AI-assisted: yes

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 24, 2026
@aslan2142

Copy link
Copy Markdown
Collaborator

Thank you for this fix. The diagnosis was right, and current main already has it, so I'm closing this draft as superseded:

The Runtime windows job compiles all of these files with MSVC 14.52 again. The remaining slot-14 false positive (a stray 32 after a one-descriptor desc) is handled in #1148. If anything from this branch is still missing, please open a new PR from current main. The old-pr/* branch stays, and #17 lists the carried-over drafts.

AI-assisted (Claude Code, Claude Opus 5.5).

@aslan2142 aslan2142 closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants