Skip to content

Port upstream performance wave (pipeline saves, SRV copies, textures) - #13

Merged
devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1795563202-performance-wave
Nov 25, 2026
Merged

devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1795563202-performance-wave

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Performance-focused upstream wave, selected for high impact and comparatively low review risk:

  • #1653: split the host pipeline-library cache into 16 stable shards. A save now serializes/writes only shards that gained pipelines instead of rewriting one pipeline-library blob that upstream reports as 600+ MB in the world. This keeps the fork's newer parallel-load behavior: different pipeline names still load outside the shard lock, while same-name loads remain serialized as D3D12 requires.
  • #986 + #1260: support unaligned structured-buffer SRVs by copying their view range into element-aligned upload memory, then share that copy by (source, length, alignment) within each command list. The upstream follow-up measured the sharing change as avoiding 286k copies / 35 GB over a few minutes of world rendering and keeping GTT around 4.6 GB on RADV.
  • #603: copy uniform texture micro-tile runs with compile-time lengths (8/16/32 bytes), allowing small copies to inline instead of using variable-length copies for every run.
  • #993: share immutable swizzle coordinate tables across texture layouts with the same tile kind, block size and element size instead of allocating identical vectors for every layout. Includes upstream's texture_layout_bench example; it runs locally at roughly 130-154 ns/layout for its cases on this VM (no before/after baseline).

Not included yet: #1500 and #1799 are larger rendering/texture-upload rewrites with conflicts; #1551 is a larger pipeline scheduler rewrite. This wave intentionally favors contained optimizations first.

Validation on this Linux VM:

  • cargo run --locked --quiet --package xtask -- policy
  • CARGO_FEATURE_PURE=1 RUSTFLAGS='-D warnings' cargo check --locked --workspace --all-targets --target x86_64-pc-windows-msvc
  • same command with --all-features
  • Windows-target clippy, default and all features, with -D warnings
  • cargo test --locked -p victory-formats
  • cargo run --release -p victory-formats --example texture_layout_bench

Not run with the title, real GPU, Wine/Proton, or game data here.

Link to Devin session: https://app.devin.ai/sessions/75bbf6b4192940fea34014b13a016bee
Open in Devin Desktop: https://app.devin.ai/desktop/session/75bbf6b4192940fea34014b13a016bee?variant=devin
Requested by: @Personed

Personed and others added 4 commits November 25, 2026 04:08
Port the relevant part of upstream Marvisak/VIctory#1653 onto the fork's newer parallel-load design.

A save serialised the whole host pipeline library and wrote it as one blob even when only a few pipelines changed. The cache is now split into 16 stable shards chosen from each pipeline's hash, so steady-state saves serialise and publish only dirty shards.

Same-name loads remain serialised as required by D3D12, while different pipelines can still load in parallel. Stores and serialisation remain under each shard's lock; dirty counts are lowered only after that shard's bytes are published.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port upstream Marvisak/VIctory#1260 (including its #986 base).

Structured buffer SRVs whose shadow offset is not divisible by their element stride cannot be addressed with FirstElement on the shared shadow buffer. Their bytes now go into element-aligned upload memory and are bound through fresh dynamic descriptors.

Copies are cached per command list by source range and alignment, so repeated draws of the same view share one upload instead of copying the same bytes for every draw. The upstream follow-up measured this as avoiding 286k copies / 35 GB in a few minutes of world rendering and keeping GTT around 4.6 GB on RADV.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port upstream Marvisak/VIctory#603.

Rows made of uniform micro-tile runs now copy those runs with compile-time lengths (8/16/32 bytes), letting the compiler inline small copies instead of using a variable-length copy for every run.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port upstream Marvisak/VIctory#993.

Swizzle coordinate tables depend only on tile kind, block size and element size, not on texture dimensions. Layouts now share those immutable tables through keyed OnceLock slots instead of allocating identical vectors for every texture layout. Includes the upstream benchmark example and regression test that layouts with the same key share table storage.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot merged commit 7782492 into main Nov 25, 2026
4 checks passed
devin-ai-integration Bot added a commit that referenced this pull request Nov 25, 2026
The swizzle/de-swizzle lookup tables for tiled texture layouts are pure
functions of the tile geometry: build them once per shape in a shared
cache instead of per texture. Re-ported onto the fxceless base; the GPU-
side parts of the old performance wave (scratch chunks, pipeline library
sharding, unaligned SRV copies) conflict with the fxceless host/pipeline
architecture and stay out.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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