feat(d3d12_x): build buffer descriptors for constant buffer and buffer views #55
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!55
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/55/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 23:22 UTC · original
Dark3581:feat/buffer-descriptors→main· +444 −3 · 8 files · 1 commits · merged 2026-11-22 23:26 UTCWhat
On the console a view is not a driver object:
CreateConstantBufferViewand the buffer forms ofCreateShaderResourceView/CreateUnorderedAccessViewwrite hardware buffer descriptors (V#, four words) into the descriptor heap, and the translated shaders read them directly. This adds the encoder for those words:resources/BufferDescriptor.cpp:EncodeBufferDescriptor/DecodeBufferDescriptorwith the fields where the translator reads them (its design notes): base address = word 0 and word 1 bits 15:0 (48 bits), stride = word 1 bits 29:16, records = word 2, component selects = word 3 bits 11:0 (3 bits each; 0 and 1 are constants, 4 to 7 are X to W), format = word 3 bits 18:12 (GFX10 buffer format), bounds mode = word 3 bits 29:28; resource level (word 3 bit 24) is 1, as in the translator's own test descriptor0x31016fac, which the test reproduces exactly.FirstElementmoves the base address.TypedBufferFormatOf: DXGI formats to GFX10 buffer format codes, from the public hardware format enumeration the translator also uses (the channel order of the names runs from the top bit, soR11G11B10_FLOATis10_11_11_FLOATandR10G10B10A2is2_10_10_10).R32_TYPELESS, formats without a typed encoding, views past the buffer or with no elements, unknown flags, texture dimensions and UAVs with a counter.Which values the console driver itself writes for each view type is not known; these follow how the shaders read them, and the debt fragment says so. Nothing writes the words yet: that needs the device's view methods and descriptor heaps.
Tested
pso_probe buffers-selftest(no GPU): an encoded descriptor word by word and its decode, the translator's reference word 3, the address and stride limits, the format codes, a constant buffer view, raw, structured and typed shader resource views field by field (offsets fromFirstElement, records, stride, format, bounds, selects; one typed view word by word), a component-mapped view, a typed UAV, and 10 refusals with their messages. Runs in thepipeline_statetest.ctest: 66 of 66. Thed3d12_xtargets also build with MSVC 2022.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