GPU: return the output pointer from GetDesc methods #1093
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1093"
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?
Imported from Marvisak/VIctory. Originally posted by BlueCatsz on 2026-11-24T15:40:49Z.
Fixes #779
Summary
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.Changes
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 run (45374509224againstef2f8fa16e00856779e40bf1b3050eea508784c7):cargo clippy --workspace --all-targets --locked -- -D warnings— passedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings— passedcargo test --workspace --locked— passed across all workspace crates, including:victory-gpu:52 passed; 0 failed; 1 ignored(texture_checks_per_submissionbenchmark), 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)ec64d8datopef2f8fa) and returning the output pointer on RTX 4070 Ti + WARP (DrDarkDK,56 passed, 1 benchmark ignored).LAKSHYA-cmd-tech/VIctory#12and verified on Windows 11 D3D12 across all 88victory-gputests on that fork (LAKSHYA-cmd-tech).Disclosure
Verified with synthetic unit tests only (no game files or external dumps used). This patch and PR are AI-assisted.
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T15:49:23Z.
Independent Win64 check under Wine/GE 3.2:
ef2f8faapplied cleanly to our integration build (290b384), and all four guest vtable tests passed for the resource, heap, descriptor heap and command queue. Each GetDesc returned the address supplied by the caller.We also combined this change with #933 and checked the returned address and descriptor contents in the same call. On an RTX 4090, a committed 4×2 texture with nine array slices reported three automatic mip levels. A 4×2×9 volume reported four. Requesting two levels explicitly returned two for each. All four results matched GetDesc on the actual D3D12 backing resource, and the guest returned the original output pointer each time. All six focused tests passed on the combined build. This exercises synthetic resources; title use remains unmeasured.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T16:29:39Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
ef2f8fa:cargo test -p victory-gpupasses, 52 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:31:59Z.
Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Imported from Marvisak/VIctory. Originally posted by BlueCatsz on 2026-11-25T08:42:30Z.
This automated close appears to be a false positive:
mainby automated issue triage: After this PR was closed at2026-11-25T00:31:59Z, automated triage on companion issue #779 (2026-11-25T03:52:14Z) confirmed the exact same bug onmainacross all four methods touched here (heap_descandresource_descincrates/victory-gpu/src/resource.rs,descincrates/victory-gpu/src/queue.rs, anddescincrates/victory-gpu/src/descriptor.rs), labeled #779area: gpu,bug,triage: confirmed, andtriage: has patch, and explicitly requested opening a PR fromfix/gpu-getdesc-return-ptr(missing that this PR had already been opened from that branch before the auto-close).windows-latestCI run againstef2f8fa: https://github.com/BlueCatsz/VIctory/actions/runs/45374509224MichaelSmithAI(RTX 4090 / Wine GE 3.2): all fourGetDescvtable tests pass + verified combined with #933.Zipettte(AMD RX 7700 XT / Windows 11 / Rust 1.98.1 MSVC):victory-gpu52 passed / 0 failed.DrDarkDK(RTX 4070 Ti + WARP, on #779): verified return pointer and clean stacking with #773 (ec64d8donef2f8fa).LAKSHYA-cmd-tech(Windows 11 D3D12, on #779): cherry-picked inLAKSHYA-cmd-tech/VIctory#12, verified across allvictory-gputests.MERGEABLE) onto currentmain. Note that #2058 was opened later (04:16 UTC) for #779 after the issue triage comment said no open PR existed.Could this PR be reopened so it isn't duplicated by #2058?
Pull request closed