GPU: return hidden output pointer from GetDesc COM methods #2058
No reviewers
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!2058
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2058/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?
@fuzeofficlal on GitHub · 2026-11-25 04:16 UTC · original
fuzeofficlal:fix/gpu-getdesc-return-outptr-779→main· +91 −5 · 3 files · 1 commits · closed without mergingCloses #779.
Summary
outinRAXfromdescriptor::desc(0x40),queue::desc(0xd0/0xe0),resource::heap_desc(0x40), andresource::resource_desc(0x50) to satisfy the x64 COM ABI for by-value structure returns (GetDesc), matchingallocation_infoandcustom_heap_properties.thisin addition to nulloutbefore writing the descriptor.Testing
descriptor::tests,queue::tests, andresource::testsverifying thatRAXequals the caller'soutbuffer pointer, the returned descriptor fields match, and nullthis/outpointers are handled safely.cargo test -p victory-gpu,cargo clippy --workspace --all-targets --all-features -- -D warnings, andcargo xtask policy.@upipibi on GitHub · 2026-11-25 04:41 UTC · original
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
600abfd.victory-gpu: 143 passed, 2 failed, 2 ignored; the newheap_get_desc_returns_its_output_pointerandqueue_get_desc_returns_its_output_pointerpass. The 2 failures are #1744's heap-cap failures onmain. Same asmainon this hardware. Not run: a title.AI-assisted (Claude Code).
@BlueCatsz on GitHub · 2026-11-25 08:42 UTC · original
Heads-up for maintainers and @fuzeofficlal: #779 already had PR #1093 opened from
BlueCatsz:fix/gpu-getdesc-return-ptr(ef2f8fa1), which was mistakenly auto-closed at00:31 UTCshortly before#779's03:52 UTCtriage comment asked for a PR from that branch. I've appealed on #1093 to have it reopened so maintainers don't end up reviewing the same change twice.@Marvisak on GitHub · 2026-11-25 09:24 UTC · original · edited 2026-11-25 11:23 UTC
Automated triage for the maintainers.
Merge candidate.
The new head
d4bbd6fkeeps the fix for #779.descriptor.rsdesc,queue.rsdesc,resource.rsheap_descandresource.rsresource_descnow return the hiddenoutpointer in RAX, which the Microsoft x64 convention requires for struct returns and whichallocation_info/custom_heap_propertiesalready do. As suggested, the unreachablethis.is_null()guards and their assertions are gone. The tests call each method through its vtable slot and check the returned pointer and the descriptor fields.mainstill has the four()-returning versions, so this is not yet landed.#1093 (same change) is still closed. If it is reopened, only one of the two should land. This one merges cleanly and credits the other author.
CI: passing (
check).On your reply: thanks, the update addresses the earlier nit.
Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-25 10:41 UTC · original
Updated in
d4bbd6f2: dropped the unreachablethis.is_null()checks/assertions per the triage note, and addedCo-authored-byattribution for @BlueCatsz (#1093) — happy with whichever PR maintainers prefer to land.@Marvisak on GitHub · 2026-11-25 22:05 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because the premise does not hold. On the console these
GetDesctable entries take an explicit out pointer and return nothing, and the inline wrapper returns its own local copy, so no caller reads the return register.GetResourceAllocationInfoandGetCustomHeapPropertiesare different (they really return a struct through a hidden pointer), which is whyallocation_infoandcustom_heap_propertiesreturn it. The new tests only assert the new return value.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed