[PR #216] Select the slot 14 descriptor layout when creating the device proxy #268

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/216
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9951


📝 Commits (1)

  • 85d1e80 Select the console descriptor heap layout per device proxy

📊 Changes

7 files changed (+96 additions, -91 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+7 -14)
📝 runtime/shims/d3d12_xs.cpp (+1 -1)
📝 runtime/shims/d3d12_xs_device.cpp (+13 -18)
📝 runtime/shims/d3d12_xs_device.h (+14 -1)
📝 runtime/test/d3d12_console_descriptor_heap_test.cpp (+49 -47)
📝 runtime/test/d3d12_translated_draw_test.cpp (+7 -6)
📝 runtime/test/fixtures/tiny_frame.cpp (+5 -4)

📄 Description

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

Claimed in the coordination issue as the Windows slot 14 build fix.

Depends on: #9809, #9857, #9873 (overlap in the slot 14 implementation). This branch builds the D3D12 targets independently. The full-runtime integration check below also uses the audio-only commit from #9809.

What and why

The Xbox and PC versions of device slot 14 share a 16-byte descriptor prefix. The Xbox version also supplies a heap address and size. Reading those words on a PC call can turn adjacent stack data into an apparently valid heap address. This affected the existing descriptor, present and half-float tests. Measured Xbox layout · Windows runtime report

Select the layout when constructing each proxy. The Xbox Vulkan entry point supplies the console allocator. PC-layout proxies call the underlying device with the ordinary descriptor. Both heap paths now share the Vulkan device's allocation and COM ownership logic, and the standalone proxy can link without the Vulkan library.

The regression test passes identical bytes, including a plausible address and size, to both kinds of proxy. Only the Xbox proxy returns that address from heap slots 9 and 10. It also checks that an Xbox descriptor with a zero address gets ordinary storage. The two synthetic Xbox callers now pass the measured layout.

Tested

  • Windows x64, MSVC 19.44, Ninja RelWithDebInfo, GeForce RTX 4080, NVIDIA driver 621.01. Reproduced the original MSVC errors on 2d53a8055, then built the D3D12 COM library, standalone proxy targets and guest fixtures. All 16 focused CTests passed, including d3d12_console_descriptor_heap, d3d12_descriptor, d3d12_translated_draw, both present paths and the standalone mocks.
  • The full runtime built with just the separate audio correction 8403c4c2b from #9809 applied on top. On the PR alone two existing acphal.cpp size assertions block that build. The default CTest run gave 256 passes, 12 skips, one disabled and five failures. All five also failed in a control build of 2d53a8055 with the upstream slot 14 change (3630610ca) reverted: root_sig, d3d12_com, d3d12_vulkan_device, d3d12_execute_indirect_validation and d3d12_depth_resolve.
  • Enabled LEONIDA_TEST_GUEST_DRAW separately and ran the synthetic guests through gta6rt --run. Both run_tiny_frame cases passed the clear/readback check. d3d12_translated_draw_guest passed its pixel comparison.
  • The translator suite ran 6,046 tests across 459 files. The same two files, test_exec_computed and test_image_atomics_guard, failed when rerun on the clean base.

AI-assisted: yes, with OpenAI Codex.

Checklist

  • All seven changed files are C++ source or headers. scripts/check_no_game_data.py passed on them.

🔄 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/216 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9951` --- ### 📝 Commits (1) - [`85d1e80`](https://github.com/ubiquitarianism/leonida/commit/85d1e807a351055413dc7d3e28f7af85bf3a6f6b) Select the console descriptor heap layout per device proxy ### 📊 Changes **7 files changed** (+96 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+7 -14) 📝 `runtime/shims/d3d12_xs.cpp` (+1 -1) 📝 `runtime/shims/d3d12_xs_device.cpp` (+13 -18) 📝 `runtime/shims/d3d12_xs_device.h` (+14 -1) 📝 `runtime/test/d3d12_console_descriptor_heap_test.cpp` (+49 -47) 📝 `runtime/test/d3d12_translated_draw_test.cpp` (+7 -6) 📝 `runtime/test/fixtures/tiny_frame.cpp` (+5 -4) </details> ### 📄 Description > Carried over from **old PR 9951** by `tcurtsinger` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9951`, 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. > `tcurtsinger`: 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): Claimed in the coordination issue as [the Windows slot 14 build fix](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116539991). Depends on: `#9809`, `#9857`, `#9873` (overlap in the slot 14 implementation). This branch builds the D3D12 targets independently. The full-runtime integration check below also uses the audio-only commit from `#9809`. ### What and why The Xbox and PC versions of device slot 14 share a 16-byte descriptor prefix. The Xbox version also supplies a heap address and size. Reading those words on a PC call can turn adjacent stack data into an apparently valid heap address. This affected the existing descriptor, present and half-float tests. [Measured Xbox layout](https://github.com/ProjectLeonida/Leonida/issues/313#issuecomment-7107265058) · [Windows runtime report](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116662920) Select the layout when constructing each proxy. The Xbox Vulkan entry point supplies the console allocator. PC-layout proxies call the underlying device with the ordinary descriptor. Both heap paths now share the Vulkan device's allocation and COM ownership logic, and the standalone proxy can link without the Vulkan library. The regression test passes identical bytes, including a plausible address and size, to both kinds of proxy. Only the Xbox proxy returns that address from heap slots 9 and 10. It also checks that an Xbox descriptor with a zero address gets ordinary storage. The two synthetic Xbox callers now pass the measured layout. ### Tested - Windows x64, MSVC 19.44, Ninja `RelWithDebInfo`, GeForce RTX 4080, NVIDIA driver 621.01. Reproduced the original MSVC errors on `2d53a8055`, then built the D3D12 COM library, standalone proxy targets and guest fixtures. All 16 focused CTests passed, including `d3d12_console_descriptor_heap`, `d3d12_descriptor`, `d3d12_translated_draw`, both present paths and the standalone mocks. - The full runtime built with just the separate audio correction `8403c4c2b` from `#9809` applied on top. On the PR alone two existing `acphal.cpp` size assertions block that build. The default CTest run gave 256 passes, 12 skips, one disabled and five failures. All five also failed in a control build of `2d53a8055` with the upstream slot 14 change (`3630610ca`) reverted: `root_sig`, `d3d12_com`, `d3d12_vulkan_device`, `d3d12_execute_indirect_validation` and `d3d12_depth_resolve`. - Enabled `LEONIDA_TEST_GUEST_DRAW` separately and ran the synthetic guests through `gta6rt --run`. Both `run_tiny_frame` cases passed the clear/readback check. `d3d12_translated_draw_guest` passed its pixel comparison. - The translator suite ran 6,046 tests across 459 files. The same two files, `test_exec_computed` and `test_image_atomics_guard`, failed when rerun on the clean base. AI-assisted: yes, with OpenAI Codex. ### Checklist - [x] All seven changed files are C++ source or headers. `scripts/check_no_game_data.py` passed on them. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#268
No description provided.