GPU: return the output pointer from GetDesc methods #126
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!126
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/126/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?
@BlueCatsz on GitHub · 2026-11-25 15:01 UTC · original
BlueCatsz:fix/gpu-getdesc-return-ptr→main· +87 −5 · 3 files · 1 commits · closed without mergingProblem
Under the Microsoft x64 COM ABI, methods returning a struct larger than 8 bytes by value receive a caller-allocated hidden output pointer (
out) afterthisand must returnoutinRAX.On
main(01aadd1), all fourGetDescmethods invictory-gpureturned(), leavingRAXundefined, unlikecustom_heap_propertiesandallocation_infoinresource.rs:crates/victory-gpu/src/descriptor.rs:desc(ID3D12DescriptorHeap::GetDesc)crates/victory-gpu/src/queue.rs:desc(ID3D12CommandQueue::GetDesc)crates/victory-gpu/src/resource.rs:heap_desc(ID3D12Heap::GetDesc) andresource_desc(ID3D12Resource::GetDesc)(Ported from upstream PR
Marvisak/VIctory#1093forMarvisak/VIctory#779.)Fix & Tests
outfromdescriptor::desc,queue::desc,resource::heap_desc, andresource::resource_desc(*mut HeapDesc/*mut QueueDesc/*mut ResourceDesc).descriptor::tests::heap_get_desc_returns_its_output_pointerandqueue::tests::queue_get_desc_returns_its_output_pointer.resource::tests::heaps_are_zeroed_aligned_memoryandresource::tests::committed_and_placed_resources_map_at_their_gpu_addressto call vtable slots0x40/0x50expecting the*mutreturn pointer, verifyRAX == outand fields, and check nullout.Verification
windows-latestMSVC CI run (scoped tovictory-gpuon a temporary verification branch): https://github.com/BlueCatsz/VIctory-Belobug-AMD/actions/runs/45639197846cargo clippy -p victory-gpu --all-targets --lockedand--all-features: passed, 0 warnings indescriptor.rs,queue.rs, orresource.rs(only pre-existing warnings inshadow.rs).cargo test -p victory-gpu --lib --locked: 113 passed, 0 failed, 4 ignored (all fourGetDesctests ran and passed).Belobug/VIctory-Belobug-AMDmain's default workspace CI currently stops earlier invictory-shaderon pre-existing clippy lints (#3) andlower.rspolicy size (noted inREADME.md), sovictory-gpuchecks were verified on the temporary fork branch (closed/deleted afterward). This PR touches only those threevictory-gpufiles.Disclosure
windows-latestCI via synthetic unit tests only (no game files, not run in-world on hardware).@BlueCatsz on GitHub · 2026-11-25 22:27 UTC · original
Closing this PR: upstream second-look triage on Marvisak/VIctory#2058 clarified that on console D3D12.X these GetDesc vtable entries take an explicit out pointer and return void (the inline wrapper returns its own local copy, so callers do not read RAX), invalidating the PC D3D12 ABI premise behind this port. Apologies for the noise!
Pull request closed