GPU: validate pipeline stream input layouts #3557
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3557"
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 pablogonz12 on 2026-11-27T17:28:13Z.
Summary
Invalid layouts now return
E_INVALIDARGinstead of clamping a slot or dereferencing a null name. Empty layouts clear the previous elements. I credit @geiyiliyabumo for identifying these cases in #1079.Part of #1079; this covers stream input-layout validation, not all the originally proposed tests.
Evidence
E_INVALIDARG; 32 elements including slot 31 are accepted.-D warnings); Windows-target workspace tests compile;xtask policypasses.63bcca43c6a00a758510398fa43096ce7e4f7df0main control. Core, formats, game, PE and pipeline library tests had no failures. Workspace integration tests were compiled but not run.Merge Danger
Door: two-way; the validation can be reverted.
Blast Radius: pipeline creation for malformed input-layout streams.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T18:11:25Z.
Independent verification of
cf6a9c2d(basemain63bcca43; the PR is a single branch off that base). AI-assisted (Claude Sonnet 5.5); claim: #1633.VICTORY_WARP=1,VICTORY_D3D12_WARP=1,--features diagnostics), dxil.dll from Windows SDK 10.0.26100.0. No physical GPU used.cargo test -p victory-gpu --lib: main63bcca43= 246 passed, 0 failed, 1 ignored. PR head = 250 passed, 0 failed, 1 ignored. The four newinput_layout_*tests all pass (33 elements, slot 32 and null semantic giveE_INVALIDARG; 32 elements with slot 31 giveS_OK).cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean.Review notes (no blockers found):
create_streampath.invalid_input_layoutstays set once raised, even if a later layout subobject in the same stream is valid. I'd expect that to be intended, but it is unproven either way.CreateGraphicsPipelineState) parses input layouts and needs the same checks. Unproven.Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-27T21:45:25Z.
NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head
cf6a9c2(on its base63bcca4).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: 870 passed, 0 failed, 10 ignored.input_layout_rejects_more_than_32_elements,input_layout_rejects_slot_32,input_layout_rejects_null_semantic,input_layout_accepts_32_elements_and_slot_31.--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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.