mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #438] d3d12: implement ID3D12Device5::CreateLifetimeTracker and ID3D12LifetimeTracker::DestroyOwnedObject (D3D-LIFETIME-TRACKER) #489
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#489
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/438
Author: @jujumoneylol
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:pr/d3d12-lifetime-tracker📝 Commits (1)
811039fd3d12: implement ID3D12Device5::CreateLifetimeTracker and ID3D12LifetimeTracker::DestroyOwnedObject📊 Changes
3 files changed (+280 additions, -4 deletions)
View changed files
📝
runtime/CMakeLists.txt(+9 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+48 -4)➕
runtime/test/d3d12_lifetime_tracker_test.cpp(+223 -0)📄 Description
Claimed in the coordination issue as: D3D-LIFETIME-TRACKER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7122816234)
What and why
Implements PC
ID3D12Device5::CreateLifetimeTrackerandID3D12LifetimeTracker::DestroyOwnedObjectin the Vulkan D3D12 shim (runtime/shims/d3d12_vulkan_device.cpp), replacing theE_NOTIMPLstub.LifetimeTracker(ID3D12LifetimeTracker/ID3D12DeviceChild/ID3D12Object) holding a non-owningID3D12LifetimeOwner*pointer (matching Windows D3D12, which does notAddRefthe owner at creation).d3d12.dll) parameter validation onCreateLifetimeTracker:owner == nullptr→E_INVALIDARG(0x80070057)out == nullptr→E_UNEXPECTED(0x8000FFFF)riid→E_NOINTERFACE(0x80004002)S_OK, owner refcount delta(+0 -> +0), 0 callbacks at creation,GetDevicereturns the owning device.DestroyOwnedObject(ID3D12DeviceChild*): rejectsnullptrand foreign-device objects withE_INVALIDARG, drains submitted Vulkan work (vkDeviceWaitIdleundersubmit_mutex()), and invokesowner->LifetimeStateUpdated(D3D12_LIFETIME_STATE_NOT_IN_USE).d3d12_lifetime_tracker_testcomparing our Vulkan device side-by-side against host Windows D3D12 (WARP).ID3D12Device5/ID3D12LifetimeTrackercontract; it does not make any assumptions about Xbox Series device slot 57 semantics beyond PC fallback.Tested
d3d12_lifetime_tracker_testandd3d12_existing_heap_testwith MSVC 19.44 (vcvars64) + Ninja on top ofmain8f481cf16.d3d12_lifetime_tracker_test: ALL CHECKS PASSED —EXACT MATCHagainst host Windows D3D12 (WARP) onCreateLifetimeTrackererror codes, refcounting, andGetDevice, plusDestroyOwnedObjectvalid/null/foreign-device checks on Vulkan.d3d12_existing_heap_test: PASSED — existing-heap and lifetime-tracker refusal checks match both host GTX 1650 D3D12 and WARP (8/8OpenExistingHeapFromAddresscases match).py -3.13 -I scripts/check_no_game_data.py runtime/shims/d3d12_vulkan_device.cpp runtime/test/d3d12_lifetime_tracker_test.cpp runtime/CMakeLists.txt: clean.GPUs tested: NVIDIA GeForce GTX 1650 (driver 592.00, Windows 11 26200) and Microsoft WARP (
d3d12.dll, Windows 11 26200)AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — runtime D3D12 shim only)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.