GPU: report default buffer alignment from GetDesc #2688
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2690"
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 andrewpozdnakov7-jpg on 2026-11-25T18:17:09Z.
Problem
GetDesc returns the creation description's alignment of zero for a buffer created with the default alignment. Native D3D12 reports the effective 64 KiB alignment for the same buffer. Zero is the creation shorthand for 64 KiB. D3D12 buffer description
Change
Resolve the default alignment in the buffer description returned by GetDesc.
Verification
13f91careports alignment 0, while native D3D12 WARP reports 65536. Both report 65536 after the change.Coordination claim
AI-assisted (Codex 2). Please retain the Git author on cherry-pick or rebase. If folding this change into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg [email protected].
Imported from Marvisak/VIctory. Originally posted by necrobytes on 2026-11-25T18:29:26Z.
Review: COMMENTED
I ran the guest
GetDesctest on a Radeon RX 9060 XT under Linux with Wine and vkd3d-proton 3.2.0. With the test copied onto the13f91caimplementation, a 256-byte buffer created with alignment0returned0through the guest vtable and65536through the host D3D12 API. The explicit65536control agreed on both paths.At
78bf751, both paths returned65536for both inputs. All 18resource::testspassed on the same adapter with--features diagnostics.AI-assisted review (Codex).
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T18:53:58Z.
Matches native semantics: GetDesc resolves the creation shorthand (0 = default 64 KiB for buffers) to the effective alignment. Verified the test compares against a real committed WARP buffer for both inputs, not just the constant.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T18:59:45Z.
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of
78bf751c(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo clippy --locked -p victory-gpu --all-targets -- -D warningsand--features diagnostics: 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib resource: 20 passed, 0 failed (buffer_get_desc_reports_the_effective_alignment:input 65536 -> native 65536, guest 65536;input 0 -> native 65536, guest 65536).VICTORY_D3D12_WARP=1):cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 199 passed, 0 failed, 1 ignored.Review Notes
0 -> KIB_64default strictly todesc.dimension == BUFFERmatches D3D12GetDesc()andresource::footprintwithout altering texture alignments (4 KiB/64 KiB/4 MiBMSAA). Clean and ready to merge.Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T19:41:13Z.
Independent WARP/CPU verification
Head:
78bf751c5baa2f2f7f9b8d0386512c31d34de971Base:
origin/main13f91caee25f2fdf2c062be5f7a27f058e51cbcaStatus: open, non-draft; clean merge tree; no
oni-swrcomment on this head.Environment: Windows x64, WARP selected (
VICTORY_WARP=1,VICTORY_D3D12_WARP=1),dxil.dll1.8.2502.11 from Windows SDK 10.0.26100.0; rustc 1.98.1.Commands (each with
CARGO_TARGET_DIR=D:\victory-warp-2690-targetand the WARP variables above):cargo test --locked -p victory-gpucargo test --locked -p victory-gpu --features diagnosticscargo test --locked -p victory-gpu buffer_get_desc_reports_the_effective_alignmentcargo clippy --locked -p victory-gpu --all-targets -- -D warningsResults: default baseline 195 passed, 1 ignored; PR 196 passed, 1 ignored. Diagnostics baseline 197 passed, 1 failed, 1 ignored; PR 199 passed, 1 ignored. The baseline-only failure was
memory::tests::a_submission_that_missed_leaves_the_copies_at_once; it passed in the PR run. Targeted alignment test 1/1 passed. Clippy passed.Negative control: restored the old
resource_descbehavior; the alignment regression failed (exit 101), as expected. No implementation bug found.Not tested: physical GPU, retail title, release build. AI-assisted: Codex (gpt-6-luna).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:19:34Z.
Automated triage for the maintainers.
Merge candidate (recommend a look).
resource_descincrates/victory-gpu/src/resource.rsnow reports 64 KiB instead of 0 for a buffer created with the default alignment. Nothing else changes: textures and explicit alignments are reported as before. The evidence is public D3D12 documentation plus a test that compares the guest's answer with a real committed buffer on the host device (it skips the comparison when there is no device), so the test checks native behaviour rather than repeating the code. The storeddescis not modified, so creation-side code that readsalignment == 0is unaffected. One limit: the reference is PC D3D12; no title-side measurement shows the title reads this field.CI:
checkpassing on this head.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T02:16:29Z.
Review: APPROVED
Looks good to me — accurate D3D12
GetDesc()behavior for buffers with zero impact on texture alignments or allocation footprint calculations.Review & Verification Notes
crates/victory-gpu/src/resource.rs:2152-2162:resource_desc(vtable slot0x50, the soleGetDescentry point) normalizesdesc.alignment == 0toKIB_64(D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT) strictly on the returned copy fordimension == BUFFER, leaving stored descriptions, texture alignments (4 KiB small / 4 MiB MSAA), andfootprint/GetResourceAllocationInfountouched.origin/main(63bcca43):cargo xtask policypasses (191 files ok).cargo clippy -p victory-gpu(--lib,--tests, and--features diagnostics--lib/--tests,-D warnings) is clean.victory-gpuresource::testspasses (19/19) on discrete D3D12 hardware (VICTORY_D3D12_DEBUG=1,VICTORY_D3D12_GBV=1) — confirminginput 65536 -> native 65536, guest 65536andinput 0 -> native 65536, guest 65536— and on WARP (19/19,--features diagnostics,VICTORY_D3D12_DEBUG=1,VICTORY_D3D12_WARP=1).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.