fix(d3d12_x): one waiter thread per fence, ordered copies and zero-count rasterizer calls #67
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!67
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/67/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 02:06 UTC · original
Dark3581:fix/fence-waiter→main· +165 −11 · 7 files · 1 commits · merged 2026-11-23 02:10 UTCWhat
Three robustness fixes in the d3d12_x objects, for problems titles are known to trigger:
Fence event waits (
objects/Fence.cpp). EachSetEventOnCompletionwith an event used to start a detached thread that held a reference to the fence until the value arrived. That caused three problems:vkWaitSemaphoreswhen the device went away at shutdown;Now one waiter thread per fence serves all its events:
VK_SEMAPHORE_WAIT_ANY_BIT), which new waits and destruction signal under the lock so wake values stay increasing;Copy ordering (
objects/CommandList.cpp). Back-to-backCopyBufferRegion,CopyTextureRegion,CopyResourceandResolveSubresourcecalls with no barrier between them were recorded as unordered Vulkan transfers, so a second copy over the same range could land before the first. A transfer-to-transfer barrier now goes before each copy that follows another; a resource barrier clears that state. Titles rely on D3D12 copies running in order. This also serializes independent copies, a cost noted in the debt entry.Zero-count
RSSetViewportsandRSSetScissorRectsrecorded an error and stopped the title; they now record nothing.Tested
Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer.
pso_probe fence-gpu --validate, now 96 checks:It passed 15 repeated runs.
pso_probe commandlist-gpu --validate, now 28 checks: a 4 KiB copy followed by a 2 KiB copy over its first half reads back the second copy's bytes; the pending-copy state is tracked; zero-count viewport and scissor calls don't stop the title.descriptors-gpustill passes. 0 validation errors in all three.MinGW
ctest: 73 of 73. With MSVC 2022,fence-gpuandcommandlist-gpupass, and every target builds exceptab_gameinput, which needsgameinput.lib, which this machine doesn't have.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>.mdVK_SEMAPHORE_WAIT_ANY_BIT, transfer synchronization); D3D12 documentation (fence events, device removal)