Performance Optimization and Vulkan Consideration for Blur Effect
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 237
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 1
Description
Hey Wayfire devs,
so I’ve been looking at how the blur works in Wayfire, especially wf_gaussian_blur and the Kawase implementation. The shaders are clean and the visuals are great, the Gaussian blur shader uses five weighted samples per axis in horizontal and vertical passes, which is pretty standard (gaussian_fragment_shader_horz/_vert). But performance can get heavy, especially with bigger blur radii or high-res outputs, because blur_fb0() and render_iteration() do multiple framebuffer reads/writes. Some OpenGL tweaks could help, like reducing iterations when the blur radius is small, precomputing offsets/weights, or using half-float textures to cut memory bandwidth.
Honestly, if blur ran on Vulkan, it could be way faster. You could turn render_iteration() into a compute shader: use local workgroups, shared memory for row/column data, and preloaded kernel weights. That way, you keep the exact same visuals but leverage GPU parallelism fully. The damage region and framebuffer logic (prepare_blur(), copy_region()) can stay the same at first, so the visual behavior doesn’t change. You could even do this incrementally: first OpenGL optimizations, then a Vulkan compute shader pass. Overall, it’s about keeping the visuals intact while making the code way more efficient, especially for higher resolutions or heavier blur settings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating wf_gaussian_blur, gaussian_fragment_shader_horz, gaussian_fragment_shader_vert, blur_fb0(), render_iteration(), prepare_blur(), and copy_region(). Read how the current OpenGL passes, framebuffer operations, and damage-region handling work before deciding whether an optimization is defined. Done would require an agreed, measurable performance improvement while preserving the existing visual behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100