Skip to content

GPU: hash short PSO descriptions in one frame, borrow shader bytecode - #22

Open
Jineggegg wants to merge 1 commit into
readmet3xt-lab:mainfrom
Jineggegg:hot-pso-prebuild
Open

Jineggegg wants to merge 1 commit into
readmet3xt-lab:mainfrom
Jineggegg:hot-pso-prebuild

Conversation

@Jineggegg

Copy link
Copy Markdown

What this fixes

Hot PSO prebuild copies every shader stage's bytes before hashing the pipeline name, and hashes the name parts one by one. This change:

  • Hashes small pipeline descriptions as one contiguous BLAKE3 input, so short shader chunks hash in parallel. Large descriptions still use the original streaming path.
  • Passes the DXIL slices straight to library::name instead of copying each stage's bytes through code_bytes (now removed).

The name output is unchanged, so pipeline libraries written before still load. A new test pins the old name hash and checks the length framing at the 8 KiB buffer limit.

Testing

  • cargo check -p victory-gpu --lib: clean (only pre-existing warnings elsewhere).
  • cargo test -p victory-gpu --lib pipeline::library: 7 passed, 0 failed, including the new framing test.
  • On an RTX 5090 in Jineggegg/VIctory round 1, the same change made hot PSO prebuild about 18% faster (hot-start prebuild about 107 us down to about 86 us, 380,000 rounds, no failure).

Origin

Adapted from Jineggegg/VIctory 2b98109 (round-1 item #5). Foxhound names its mesh pipeline "mesh triangles" and has a separate "graphics rectangles" name with its own geometry stage, so those call sites were adapted to the same borrow form.

Hash small pipeline descriptions as one contiguous BLAKE3 input, so short shader chunks hash in parallel; stream large descriptions as before. The name output is unchanged (pinned by test), so libraries written before still load.

Pass the DXIL slices straight to library::name instead of copying each stage bytes through code_bytes. In Jineggegg/VIctory round 1 this made hot PSO prebuild about 18% faster on an RTX 5090 (hot-start prebuild about 107 us to about 86 us, 380,000 rounds, no failure).

Adapted from Jineggegg/VIctory 2b98109. Foxhound names its mesh pipeline "mesh triangles" and has a separate "graphics rectangles" name with its own geometry stage, so those call sites were adapted to the same borrow form.
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.

1 participant