Skip to content

Backport faster GFX10 tiled texture copies and measure Rosetta throughput - #163

Merged
pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
gdemontalivet:perf/macos-tiled-copies
Nov 26, 2026
Merged

pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
gdemontalivet:perf/macos-tiled-copies

Conversation

@gdemontalivet

Copy link
Copy Markdown
Contributor

Backports brainbudt’s tiled texture copy traversal onto macOS main. It derives contiguous run width from the swizzle, copies adjacent rows together for short runs, and processes depth slices while their tiled blocks are still in cache. The tests compare with the per-element address calculation and check that invalid inputs leave the destination intact.

I ran the same generated release benchmark against the old and new implementations on an M5 Max. Median throughput across three trials under CrossOver Preview / Rosetta, in decimal GB/s:

Surface and copy direction Current main Backport
1080p RGBA8 64KB_D, tiled to linear 16.66 27.51
1080p RGBA8 64KB_D, linear to tiled 4.34 14.52
128 × 128 × 64 RGBA8 volume, tiled to linear 10.04 28.47
BC7 64KB_D, 4096², tiled to linear 17.99 21.68
BC7 64KB_D, 4096², linear to tiled 17.85 13.63

The last case regressed 24%. Across the 14 tested directions and layouts it was the only Rosetta regression in these trials. The native arm64 medians ranged from 1.02× to 2.19× baseline throughput. The benchmark uses synthetic surfaces. The native and Rosetta format suites each passed 39 tests with six ignored. The staged asset-policy check passed.

I also compared two separate integration builds differing only in this file, with the same prologue checkpoint and starting shader cache, at 720p. Both reached world frame +90. Frames +8 through +48 ran at 1.12 FPS on the control and 1.14 FPS with this patch. Frames +48 through +90 ran at 0.86 and 0.81 FPS respectively. Those single runs do not establish a gameplay frame-rate improvement.

The benchmark can be repeated with cargo test --release -p victory-formats detile_throughput -- --ignored --nocapture.

Adapt Marvisak/VIctory#2736 (d33104738a) to the macOS branch. Includes the offset oracle and deterministic copy-error regression tests.

Co-authored-by: brainbudt <32467201+brainbudt@users.noreply.github.com>
@pragyaangaur
pragyaangaur merged commit 478a6da into pragyaangaur:main Nov 26, 2026
1 check passed
@pragyaangaur pragyaangaur added area:gpu Host GPU runtime: resources, copies, presenting area:title The game's own startup and runtime behaviour labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Host GPU runtime: resources, copies, presenting area:title The game's own startup and runtime behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants