feat(d3d12_x): add D3D12 fence and command queue objects on Vulkan #60
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!60
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/60/head"
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?
@Dark3581 on GitHub · 2026-11-23 00:20 UTC · original
Dark3581:feat/fence-queue→main· +689 −7 · 13 files · 1 commits · merged 2026-11-23 00:22 UTCWhat
The first D3D12 objects as real COM objects on the public interfaces, so the device can hand them to a title:
objects/ObjectBase.hpp:DeviceChildBase<Interface>gives reference counting,QueryInterfaceover the object's interface chain (IUnknown,ID3D12Object,ID3D12DeviceChildplus each object's own), private data with D3D12's semantics (size queries,DXGI_ERROR_MORE_DATA,DXGI_ERROR_NOT_FOUND, stored interfaces kept referenced), names, and a parent device that the child keeps a reference to.objects/Fence.cpp:ID3D12Fence1on a Vulkan timeline semaphore:GetCompletedValue, CPUSignal,SetEventOnCompletionwith an event (signalled from a waiting thread that holds a duplicate handle and a reference) or without one (a blocking wait).objects/CommandQueue.cpp:ID3D12CommandQueueSignalandWaitthroughvkQueueSubmit2,GetTimestampFrequencyfrom the device's timestamp period, andGetDesc. All D3D12 queues share the device's one Vulkan queue, so aWaitrecorded before the matchingSignal(legal in D3D12, common across queues) would block the Vulkan queue forever. A queue therefore holds a wait whose value nothing has promised yet, and every operation after it, on the CPU; a fence that gets a promise (a submitted GPU signal or a CPU signal) wakes the queues watching it, as D3D12 itself stalls such queues.timelineSemaphore, loads the semaphore andvkQueueSubmit2functions, and serializes queue submission with a lock thatSubmitalso takes.GetDesc) need the MSVC ABI the title is built with; MinGW builds of the objects defineWIDL_EXPLICIT_AGGREGATE_RETURNS, which declares them with the explicit return pointer that ABI uses.ExecuteCommandListswith lists, tile mappings and clock calibration stop the title for now; markers do nothing (listed as silent stubs).Tested
Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer.
pso_probe fence-gpu --validate, 37 checks: shared fences and video queues refused; six interfaces queried from a fence, a foreign one refused; private data (missing, size, short buffer, value, a stored interface); names and creation flags; a queue description read back throughGetDesc; the timestamp frequency; a GPU signal waking an event; a wait recorded on one queue before the signal on another holds two operations back and then runs them once the other queue signals, without a deadlock; a CPU signal releasing a held GPU wait; signalling the current value again and a blocking wait on a reached value. 0 validation errors. Runs in thepipeline_statetest.ctest: 72 of 72. With MSVC 2022 the targets build andfence-gpupasses (by-valueGetDesc).python tools/check_conventions.pyanddebt_fold.py --check: ok.Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragmentdocs/dev/debt/changes/<branch>.md