perf(vk): convert complete texture tiles eight rows at a time #1603
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1603
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/texture-upload-tile-rows"
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?
Type perf · Risk medium
Change
The CPU texture uploader now converts one complete horizontal strip of eight rows at a time. This keeps destination cache lines hot while it converts the GPU block layout to linear pixels or compressed blocks. Both the single-thread and split-row callers use the same conversion. Partial tiles and 3D levels use the existing decoder.
Measurements
On a Ryzen 9 7900X with resident synthetic RGBA8 input, the median for six alternating trials fell from 0.161 to 0.096 ms at 1024×1024 and from 0.308 to 0.157 ms at 1920×960. Across four shapes the conversion speedup ranged from 1.68× to 2.60×. No synthetic trial met the cold-page residency criterion.
One instrumented run per arm used the same host build and warmed driver cache. Stock recorded 56.54 FPS in Market and 63.58 FPS in Field. The new renderer recorded 67.74 and 79.60 FPS respectively. Host pressure varies between runs and repeated lightly instrumented controls are still needed to attribute a gameplay FPS change. The largest complete Field crossing interval was 370.05 ms on stock and 357.35 ms with the change. Linux sampled 642 replay-thread major faults in the new conversion routine during that interval.
Testing
The generic fallback and the diagnostic reference now use the same block pitch as the host and GPU layout for odd-width RGB textures. The expanded synthetic pixel comparison first failed on the previous revision and passed with the fix under GCC and Clang. The corrected renderer completed the headless Market and Field route on the RTX 3090. That run verifies the route. The fixture supplies the odd-width coverage. The full Linux suite on this revision had 721 passes, 41 control-reproduced failures and 19 skips.
GCC and Clang passed the synthetic byte-for-byte comparison against the project's reference decoder. The fixture compares the entire destination including guard bytes, checks short spans and exercises both the fast path and the fallback across 1- to 16-byte blocks, multiple depths and tile heights. Review added an explicit fallback-call count so the fixture will detect changes that send complete tiles down the reference path. The updated check passed under GCC and Clang. A queued Linux pack build and a headless fixed-marker Market and Field route completed on an RTX 3090 with NVIDIA 620.70.06, CachyOS Linux and 32 GiB RAM.
Remaining work
Tested in game: CachyOS Linux, RTX 3090, driver 620.70.06, Ryzen 9 7900X. Ran the changed renderer headless through Market and into Hyrule Field. Replay major-fault samples confirmed execution of the optimized path during the crossing.
Possibly related, for context:
Updated the source fixture after the full suite caught an overly broad function cut. Both GCC and Clang pass the guest-memory fixture and the conversion routing regression. The 41 other suite failures reproduced on the control.
2ac87bcea9681d11ff97The full game-free suite rerun finished with 721 passed, 41 failures also seen on the control and 19 skips. Both GCC and Clang passed the updated conversion and guest-memory checks.
The generic fallback and the diagnostic reference now use the same block pitch as the host and GPU layout for odd-width RGB textures. The expanded synthetic pixel comparison first failed on the previous revision and passed with the fix under GCC and Clang. The corrected renderer completed the headless Market and Field route on the RTX 3090. That run verifies the route. The fixture supplies the odd-width coverage. The full Linux suite on this revision had 721 passes, 41 control-reproduced failures and 19 skips.
WIP: perf(vk): convert complete texture tiles eight rows at a timeto perf(vk): convert complete texture tiles eight rows at a time