GPU: GetDesc methods do not return their output pointer in RAX (fix on a fork) #779
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#779
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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-24 10:32 UTC · original
Problem
Under the Microsoft x64 COM ABI, member methods returning a struct larger than 8 bytes by value receive a caller-allocated hidden output pointer (
out, afterthis) and must return that pointer inRAX.In
victory-gpu, all fourGetDescimplementations currently return(), leavingRAXundefined for callers that read the returned pointer rather than their own stack slot:ID3D12Heap::GetDesc(resource::heap_desc,HeapDesc= 48 B)ID3D12Resource::GetDesc(resource::resource_desc,ResourceDesc= 56 B)ID3D12CommandQueue::GetDesc(queue::desc,QueueDesc= 16 B)ID3D12DescriptorHeap::GetDesc(descriptor::desc,HeapDesc= 16 B)Other hidden-out-pointer methods in the workspace (
xsystem::analytics_info,resource::allocation_info,resource::allocation_info2, andresource::custom_heap_properties) already returnout.Fix on a fork
Since PR creation is currently limited to collaborators, the fix is pushed and CI-verified on a fork:
ef2f8fa16e00856779e40bf1b3050eea508784c7Changes
crates/victory-gpu/src/resource.rs: changeheap_descandresource_descto return*mut HeapDesc/*mut ResourceDesc(out); updateresource::tests::heaps_are_zeroed_aligned_memoryandresource::tests::committed_and_placed_resources_map_at_their_gpu_addressto verifyget_desc(obj, out_ptr) == out_ptr, the populated fields, and nullouthandling.crates/victory-gpu/src/queue.rs: changequeue::descto return*mut QueueDesc(out) and add synthetic testqueue::tests::queue_get_desc_returns_its_output_pointer(resolving vtable slot0xe0vs0xd0dynamically).crates/victory-gpu/src/descriptor.rs: changedescriptor::descto return*mut HeapDesc(out) and add synthetic testdescriptor::tests::heap_get_desc_returns_its_output_pointer.Verification (
windows-latestCI)Full workflow run on the fork against
ef2f8fa16e00856779e40bf1b3050eea508784c7:https://github.com/BlueCatsz/VIctory/actions/runs/45374509224
cargo clippy --workspace --all-targets --locked -- -D warnings— passedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings— passedcargo test --workspace --locked— passed across the workspace, including:victory-gpu: 52 passed, 0 failed (1 benchmark ignored:texture_checks_per_submission), including all fourGetDesctests (heaps_are_zeroed_aligned_memory,committed_and_placed_resources_map_at_their_gpu_address,queue_get_desc_returns_its_output_pointer,heap_get_desc_returns_its_output_pointer)xtask: 4 passed, 0 failed (includingpolicy::tests::repository_passes_policy)Disclosure
Verified solely with synthetic unit tests (no game files or external dumps used). The patch and this issue are AI-assisted.
@DrDarkDK on GitHub · 2026-11-24 10:40 UTC · original
Checked #773 and #779 together on their shared base
ffe310e. The #773 commitec64d8dapplied cleanly on top ofef2f8fa.A synthetic guest
ID3D12Resource::GetDescvtable test checked that the same call returns the output pointer and reports the native D3D12 mip count. It passed on RTX 4070 Ti and software WARP for automatic 1D, 2D-array and 3D textures, plus an explicit two-mip control. Withef2f8faalone, the same test returned the correct pointer but reported 0 mips for the 1D case, where native D3D12 reported 3.The combined
victory-gpudiagnostics library suite passed on both adapters: 56 passed, 1 benchmark ignored. Synthetic tests only. AI-assisted testing and reporting.@LAKSHYA-cmd-tech on GitHub · 2026-11-24 11:12 UTC · original
Cherry-picked and merged downstream in https://github.com/LAKSHYA-cmd-tech/VIctory/pull/12.
Verified clean on Windows 11 D3D12 across all 88 \ictory-gpu\ tests.
@Marvisak on GitHub · 2026-11-25 03:52 UTC · original · edited 2026-11-25 09:54 UTC
Automated triage for the maintainers.
Confirmed on
main(940d32f): the fourGetDescmethods return nothing, soRAXdoes not hold the hidden output pointer that the x64 ABI requires when a struct is returned by value. They areheap_descandresource_descincrates/victory-gpu/src/resource.rs,descincrates/victory-gpu/src/queue.rsanddescincrates/victory-gpu/src/descriptor.rs. Other hidden-pointer methods in the same file (allocation_info2,custom_heap_properties) already returnout.Correction to the earlier version of this comment: the branch was opened as #1093, which was closed unmerged before that triage ran. Open PR #2058 now carries the same change for this issue. Whether to reopen #1093 or review #2058 is the maintainers' call. #933 (mip count in
GetDesc, from #773) touches the same method, and the comments above say the two apply together.Generated by Claude Code
@BlueCatsz on GitHub · 2026-11-25 08:42 UTC · original
Quick clarification for maintainers/triage regarding "No open PR carries this change... please open one from
fix/gpu-getdesc-return-ptr":PR #1093 was already opened yesterday from
BlueCatsz:fix/gpu-getdesc-return-ptr(ef2f8fa16e00856779e40bf1b3050eea508784c7), and was mistakenly auto-closed at00:31 UTC(three hours before the03:52 UTCissue triage comment here). #2058 was then opened afterward at04:16 UTCfor the same fix.I've replied on #1093 per its triage close prompt so maintainers can reopen #1093 cleanly without needing a duplicate PR.