mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1521] d3d12: break title buffer device reference cycle (RT-TITLE-WINDOW-CLEANUP) #1550
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1550
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1521
Author: @exoticLgk
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix-title-window-cleanup📝 Commits (1)
d314442d3d12: break title buffer device reference cycle📊 Changes
2 files changed (+28 additions, -7 deletions)
View changed files
📝
runtime/shims/d3d12_vulkan_device.cpp(+9 -0)📝
runtime/test/d3d12_draw_test.cpp(+19 -7)📄 Description
Claimed in the coordination issue as: RT-TITLE-WINDOW-CLEANUP (#14).
What and why
Fix a COM reference cycle between the D3D12 device and its internally owned title-memory buffers.
The device retains buffers created by
make_title_buffer()intitle_buffers_, while each buffer retains a reference to the device. This prevents normal device destruction and resource cleanup.With Vulkan validation enabled, both
d3d12_title_index_windowandd3d12_title_vertex_windowpreviously passed despite reporting 11 leaked Vulkan objects each (VUID-vkDestroyDevice-device-05137).This PR:
xbox_geometry_upload_batch, previously relaxed in commit7be70a9f5.Tested
Built successfully using
scripts/build_runtime.ps1on Windows.With
LEONIDA_VK_VALIDATION=1:d3d12_draw: PASSd3d12_title_index_window: PASSd3d12_title_vertex_window: PASSxbox_geometry_upload_batch: PASSThe previously observed Vulkan object leaks were no longer reported after the runtime fix. All four tests also pass with strict device reference-count assertions enabled.
Additional targeted regression tests: 10/10 passed.
Full runtime CTest suite:
Tested against main
f78385646, with a successful conflict-free merge simulation against1cfc29af7. The newer merged tree has not been independently tested.GPUs tested
NVIDIA GeForce RTX 4070 SUPER (12 GB)
AMD, Linux and actual game execution have not been tested. XMA and SDL3-dependent GameInput coverage was unavailable in the local build.
AI-assisted
ChatGPT assisted with diagnosis, patch design, implementation, test selection and preparation of this PR. Compilation and tests were executed locally, and their actual outputs were reviewed.
Checklist
No shader translator changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.