Game: guarantee 8-byte alignment for pipeline stream subobjects and input elements #2533
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!2533
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2533"
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?
@reeledMarek on GitHub · 2026-11-25 15:23 UTC · original
reeledMarek:fix/game-pipeline-stream-alignment→main· +34 −25 · 1 files · 1 commits · openProblem
victory_game::pipelines::Streambacked its D3D12 pipeline state subobject stream withVec<u8>and itsD3D12_INPUT_ELEMENT_DESCarray withVec<[u8; 32]>. Both types have alignment 1, whereas D3D12 requires 8-byte alignment for subobject streams and input element descriptors, andvictory-gpu/src/pipeline.rscasts stream offsets directly to&Bytecode(alignment 8).Fix
#[repr(C, align(8))] struct AlignedBytes<const N: usize>([u8; N])and storebytes: Box<AlignedBytes<0x2b0>>and_elements: Vec<AlignedBytes<32>>inStream.Testing
a_record_becomes_the_engines_creation_stream(crates/victory-game/src/pipelines.rs).cargo test -p victory-game --lockedand Windows cross-clippy (-D warnings).@Marvisak on GitHub · 2026-11-25 15:53 UTC · original
Automated triage for the maintainers.
Recommended for a look.
pipelines::stream(crates/victory-game/src/pipelines.rs) now stores the 0x2b0-byte creation stream and the input element array in an 8-byte-aligned wrapper instead ofVec<u8>/Vec<[u8; 32]>. I checked the consumer: apps/victory/src/prebuild.rs handsstream.bytes()to victory-gpu, whose pipeline.rs takes&*ptr.cast::<Bytecode>()at stream offsets, so the alignment was only guaranteed by the allocator in practice, not by the types; the change is mechanical otherwise. CI (clippy + tests on Windows): passing.Generated by Claude Code
@futurepro62 on GitHub · 2026-11-26 01:37 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
41ab323(on its base940d32f).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 696 passed, 0 failed, 10 ignored.#[test]functions in the diff.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
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.