feat(wallpaper): add wallpaper-prefetch IPC to warm cache - #4216
Open
landerbro wants to merge 1 commit into
Open
feat(wallpaper): add wallpaper-prefetch IPC to warm cache#4216landerbro wants to merge 1 commit into
landerbro wants to merge 1 commit into
Conversation
Prefetch decodes and uploads wallpaper into SharedTextureCache without displaying it. Useful for fast workspace/blur toggles and Mod+W prewarm of next wallpapers. - wallpaper-prefetch [connector] <path> IPC - uses m_textureCache->peek to avoid refCount leak on hit - acquire keeps refCount 1 until eviction or next set Bench: cold set 130-150ms -> warm hit 28-90ms after prefetch
Collaborator
|
No PR template body = no cookies |
Author
|
Updated PR body to follow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
wallpaper-prefetch [connector] <path>IPC to warmSharedTextureCachewithout displaying. Prefetch decodes and uploads wallpaper in background so nextwallpaper-setis a cache hit.m_textureCache->peekto avoid refCount leak on hitacquirekeeps refCount 1 until eviction or next setprefetched/prefetch hitwallpaper-set/wallpaper-next/wallpaper-randombehaviorMotivation
Fast workspace/blur toggles (
active_window_id-> blur/original) and Mod+W prewarm of next wallpapers. Currently eachwallpaper-setcold decodes + uploads.Cold path for 2560x1440 q95: ~130-150ms (95ms warm same-file). With prefetch of next orig+blur (2 textures, ~29MB VRAM) next set becomes hit (~28-90ms). Reduces visible flicker on niri workspace switch.
Fixes slow wallpaper switch when cycling wallpapers quickly or toggling blur.
Type of Change
Related Issue
None.
Testing
noctalia wallpaper-prefetch <path>thennoctalia wallpaper-set <same path>-> logsprefetch hit, visually instantwall-lib.shprewarm next wallpaper after each set -> Mod+W instantjust formatwith clang-format 22+ - no diffjust build- clean, no new warningsManual Coverage
Screenshots / Videos
N/A - IPC only, no UI change. Effect is reduced latency on wallpaper switch (bench above).
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.docs/user/when this PR changes documented behavior or configuration, or this PR does not require documentation changes.assets/translations/en.json, or this PR adds no new user-facing strings.Additional Notes
VRAM cost: ~14.5MB per 2560x1440 texture, ~29MB for orig+blur pair. Evicted via LRU / next set.
Use case:
wall-lib.shcallswallpaper-prefetchfor next wallpaper after eachwallpaper-setfor instant Mod+W / blur toggle.Commit: f962950 - single commit, additive.