feat(d3d12_x): map D3D12 resource states to Vulkan barriers #48
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!48
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/48/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-22 21:19 UTC · original
Dark3581:feat/resource-states→main· +391 −3 · 9 files · 1 commits · merged 2026-11-22 21:23 UTCWhat
The barrier half of command lists, which does not depend on a title's calls:
commands/ResourceState.cpp:UsageOfStateturns aD3D12_RESOURCE_STATESmask into Vulkan 2 stages, access and an image layout. Each state maps by name (render target to colour attachment,UNORDERED_ACCESSto storage read and write inGENERAL, depth write and read, the two shader resource states, indirect arguments, copy and resolve source and destination).COMMONisGENERALwith all commands and memory access. Read states combine: they share a layout when they can (ALL_SHADER_RESOURCEstays shader read-only, copy plus resolve source stays transfer source) and fall back toGENERALotherwise (GENERIC_READ, copy source plus shader resource). A depth image in a shader resource state uses the depth read-only layout, soDEPTH_READ | PIXEL_SHADER_RESOURCEneeds no layout change.ImageTransitionandBufferTransitionbuildVkImageMemoryBarrier2andVkMemoryBarrier2(buffers share one buffer, so a global memory barrier covers them);UnorderedAccessBarrierandAliasingBarriercover the other two barrier types.synchronization2(core in Vulkan 1.3) and loadsvkCmdPipelineBarrier2.What is left for command lists (implicit promotion and decay, split barriers, per-subresource tracking) is in the debt fragment.
Tested
Windows 10, MinGW build, RTX 3070 Ti (driver 621.14), Khronos validation layer.
pso_probe states-selftest: the layout of 13 single and combined states, sampled depth, the access ofGENERIC_READ(all its reads, no writes), a render-target-to-shader-resource transition field by field, a buffer transition, the UAV and aliasing barriers, and 6 refusals with their messages.pso_probe states-gpu --validate: a colour image through 11 states, a depth image through 7 and a buffer through 6, with UAV and aliasing barriers, recorded and executed: 26 barriers, 0 validation errors. Both run in thepipeline_statetest.ctest: 66 of 66.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