Skip to content

GPU: zero graphics/mesh PSO padding bytes and deduplicate pipeline library stores - #1041

Closed
gabrielcruzg3 wants to merge 1 commit into
Marvisak:mainfrom
gabrielcruzg3:fix/pipeline-library-padding
Closed

gabrielcruzg3 wants to merge 1 commit into
Marvisak:mainfrom
gabrielcruzg3:fix/pipeline-library-padding

Conversation

@gabrielcruzg3

Copy link
Copy Markdown

Addresses #264 (Finding #3): \ID3D12PipelineLibrary\ description mismatches (id=972) caused by uninitialized struct padding bytes, and redundant \StorePipeline\ calls across worker threads (id=970).

Changes

  • \crates/victory-gpu/src/pipeline/host.rs: Copy graphics and mesh PSO sub-descriptors (\D3D12_BLEND_DESC, \D3D12_RASTERIZER_DESC, \D3D12_DEPTH_STENCIL_DESC, \D3D12_INPUT_ELEMENT_DESC, \D3D12_RT_FORMAT_ARRAY, and mesh \Stream) field-by-field into zeroed memory so padding bytes are deterministic.
  • \crates/victory-gpu/src/pipeline/library.rs: Track pipeline names already stored in the current run to avoid duplicate \StorePipeline\ calls across worker threads.

Verification

  • Added synthetic unit test \cleaned_graphics_descs_zero_padding_bytes.
  • Passed \cargo clippy -- -D warnings, \cargo test -p victory-gpu, and \cargo xtask policy.

@Zipettte

Copy link
Copy Markdown

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 4111946: cargo test -p victory-gpu passes, 44 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

@Bullet18x

Copy link
Copy Markdown
Contributor

RTX 5090 A/B of the pipeline-library debug-layer messages, this PR vs #352 vs main, details and protocol in my comment on #352.

Build 972 (desc does not match) 970 (already exists)
main ffe310e 350 358
+ this PR (4111946) 288 211
+ #352 (f77bd28) 0 5

On this machine the remaining 972 / 970 pairs come from mesh pipelines stored without a topology (#352, #780); zeroing padding lowers the counts but does not remove them. The de-duplication of stores may still be worth keeping on top of #352 (the two conflict in pipeline/host.rs today).

AI use: Claude Code (Claude Opus 5.5) ran and counted; I checked the results.

@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants