[PR #141] [CLOSED] runtime: build again on MSVC after #9576 (slot 14 console descriptor heap) #193

Closed
opened 2026-11-26 20:17:05 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/141
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/9873


📝 Commits (1)

  • 2e3b559 runtime: build again on MSVC after #9576 (console descriptor heap on slot 14)

📊 Changes

4 files changed (+34 additions, -5 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+8 -2)
📝 runtime/shims/d3d12_xs_device.cpp (+11 -2)
📝 runtime/shims/d3d12_xs_device.h (+11 -0)
📝 runtime/test/d3d12_console_descriptor_heap_test.cpp (+4 -1)

📄 Description

Carried over from old PR 9873 by MiguelMatMar in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9873, 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.
MiguelMatMar: 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):

main 2d53a8055 doesn't build the runtime on Windows/MSVC. This fixes the #9576 half; the #9515 half (acphal.cpp struct sizes) is left alone.

  • d3d12_xs_device.cpp called rt::d3d12::create_console_descriptor_heap, which isn't declared there and isn't linked into the tests that build the file without the Vulkan layer (device_proxy_test, bvh_builder_test, …). It now goes through a handler, set_console_descriptor_heap_handler, like slot 133's set_placed_at_va_handler.
  • The handler is opt-in. Slot 14 reads 16 bytes past a PC descriptor and takes any non-zero word there for a console address. When the handler was registered by default, d3d12_f16_halves crashed, because that stack word held garbage.
  • create_console_descriptor_heap used the private Device::identity() and passed a const DeviceState& to DescriptorHeap. Device::new_console_descriptor_heap now makes the heap.
  • The test now compiles: Ref<T> gets operator->, create_device_proxy gets its IID, and the test registers the handler.

Still open: d3d12_console_descriptor_heap fails on its own check: proxy CPU heap start mismatch: got <host pointer> want 0x556677880000. The console-address feature needs more work. This change only makes the build work again without changing behaviour for PC callers.

The SHAPE structs in acphal.cpp are 60 and 28 bytes as written, against static_asserts of 64 and 32, so each is one dword short of the GDK layout. Every compiler fails on that, not just MSVC. It needs the #9515 author.

Tested: Windows 11, MSVC 14.44, Ninja RelWithDebInfo, RTX 4080 SUPER (driver 621.24). With acphal.cpp still failing, every other target builds. device_proxy, device_proxy_trace and d3d12_f16_halves pass; fsr_dispatch, bvh_builder and d3d12_first_light skip. root_sig fails two all-zero-checksum cases, as it does on main without this change (unrelated).

AI-assisted (Claude Code).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/141 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9873` --- ### 📝 Commits (1) - [`2e3b559`](https://github.com/ubiquitarianism/leonida/commit/2e3b55965f3216542ef9fe0a220efcd802a94ce3) runtime: build again on MSVC after #9576 (console descriptor heap on slot 14) ### 📊 Changes **4 files changed** (+34 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+8 -2) 📝 `runtime/shims/d3d12_xs_device.cpp` (+11 -2) 📝 `runtime/shims/d3d12_xs_device.h` (+11 -0) 📝 `runtime/test/d3d12_console_descriptor_heap_test.cpp` (+4 -1) </details> ### 📄 Description > Carried over from **old PR 9873** by `MiguelMatMar` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9873`, 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. > `MiguelMatMar`: 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): `main` 2d53a8055 doesn't build the runtime on Windows/MSVC. This fixes the `#9576` half; the `#9515` half (`acphal.cpp` struct sizes) is left alone. - `d3d12_xs_device.cpp` called `rt::d3d12::create_console_descriptor_heap`, which isn't declared there and isn't linked into the tests that build the file without the Vulkan layer (`device_proxy_test`, `bvh_builder_test`, …). It now goes through a handler, `set_console_descriptor_heap_handler`, like slot 133's `set_placed_at_va_handler`. - The handler is **opt-in**. Slot 14 reads 16 bytes past a PC descriptor and takes any non-zero word there for a console address. When the handler was registered by default, `d3d12_f16_halves` crashed, because that stack word held garbage. - `create_console_descriptor_heap` used the private `Device::identity()` and passed a `const DeviceState&` to `DescriptorHeap`. `Device::new_console_descriptor_heap` now makes the heap. - The test now compiles: `Ref<T>` gets `operator->`, `create_device_proxy` gets its IID, and the test registers the handler. **Still open:** `d3d12_console_descriptor_heap` fails on its own check: `proxy CPU heap start mismatch: got <host pointer> want 0x556677880000`. The console-address feature needs more work. This change only makes the build work again without changing behaviour for PC callers. The SHAPE structs in `acphal.cpp` are 60 and 28 bytes as written, against `static_assert`s of 64 and 32, so each is one dword short of the GDK layout. Every compiler fails on that, not just MSVC. It needs the `#9515` author. Tested: Windows 11, MSVC 14.44, Ninja RelWithDebInfo, RTX 4080 SUPER (driver 621.24). With `acphal.cpp` still failing, every other target builds. `device_proxy`, `device_proxy_trace` and `d3d12_f16_halves` pass; `fsr_dispatch`, `bvh_builder` and `d3d12_first_light` skip. `root_sig` fails two all-zero-checksum cases, as it does on main without this change (unrelated). AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:05 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#193
No description provided.