Skip to content

Vulkan - #192

Draft
ErikReider wants to merge 34 commits into
mainfrom
vulkan
Draft

Vulkan#192
ErikReider wants to merge 34 commits into
mainfrom
vulkan

Conversation

@ErikReider

@ErikReider ErikReider commented Jul 6, 2026

Copy link
Copy Markdown
Member

Depends on #179 and #190

Relies on the wlroots-vkfx fork as there are a few Vulkan functions that aren't publicly exposed by upstream wlroots. Thanks @ammen99! :D

TODO:

  • Quad effects
  • Texture effects
  • Blur
    • Regular blur
    • Optimized blur
  • Box shadow
  • Quad gradient
  • Quad gradient rounded (merge with regular quad_grad just like the regular quad frag? Could just merge with the regular quad.frag instead?)
  • Blitting for saved blur regions
  • Stenciling
  • Tracy support

We don't use stencils with our offscreen_buffers, and each attachment
consumes ~22MB VRAM (on my system). So we save ~100MB in VRAM
…bled

Checks if gles2 is enabled in SceneFX and in wlroots
If a fast clear is desired (doesn't support any effect anyway), use
wlr_render_pass_add_rect instead
Full support for quad effects work, nothing else
@WillPower3309

Copy link
Copy Markdown
Member

We can stub the other effects for now and add them incrementally, this is already a lot of great work

@WillPower3309

Copy link
Copy Markdown
Member

(I want to be sure I can properly review all the components as well!)

Comment thread render/vulkan/shaders/corner_alpha.glsl
ErikReider and others added 6 commits July 7, 2026 12:07
So apparently due to wlroots-vkfx sharing the same vulkan header file
structure as us, clangd wouldn't find local headers within vulkan.h as
there's no local vulkan.c file. Moving util.c -> vulkan.c fixes this
(thanks Claude)
Co-Authored-By: k3ff <m8l8th814n@gmail.com>
@fishman

This comment was marked as low quality.

@spoloxs

spoloxs commented Aug 11, 2026

Copy link
Copy Markdown

I have Vulkan blur working on top of this branch — #204. Dual-Kawase plus the padding
repair that keeps damage tracking alive, so WLR_SCENE_DEBUG_DAMAGE=rerender is no longer
needed. Blur and HDR compose, since both go through the two-pass pathway.

It needed two additions on the wlroots side, currently living in a fork of ammen99's
vulkan-effects:

  • Splitting the two-pass render pass into separate scene and output passes, plus
    wlr_vk_render_pass_suspend() / _resume(), so an effect can end the scene pass
    mid-frame and sample the blend image with neighbourhood taps. An input attachment only
    permits same-pixel reads, and Vulkan forbids ending a pass on a non-final subpass, so
    there was no way to do this from inside the existing pass.
  • SAMPLED + TRANSFER_SRC/TRANSFER_DST usage on the blend image, and accessors for its
    view and image, for the snapshot/restore the padding repair performs.

Before I go further: is there a plan to upstream the renderer-internals export?
Everything here is gated on it — wlr_vk_render_pass_get_texture_ds and friends are not in
upstream include/wlr/render/vulkan.h, so my two commits do not apply to wlroots master at
all. I would rather not open an unbuildable MR.

If the wholesale export is a hard sell upstream, would a narrower purpose-built hook be
more likely to land — just the suspend/resume pair and the blend-image accessors, without
exposing descriptor sets and pipelines? Happy to do that work and shape it however is most
useful.

One caveat I should flag on my own change: the split drops VK_DEPENDENCY_BY_REGION_BIT, so
subpass merging is lost and the full-screen 16F blend image is stored and reloaded every
frame. Effectively free on desktop discrete GPUs, not free on tilers. Keeping the merged
path when no effect suspends would fix it, and that should probably happen before any of
this goes upstream — especially given
wlroots#4035 (Vulkan
renderer efficiency vs GLES2), which this would otherwise make worse.

Possibly useful for framing it upstream:
wlroots#4043 already asks
for a blit-based framebuffer API for exactly this — "post-processing pipelines that require
access to intermediate render results", naming blur and bloom. The blend-image accessors
plus TRANSFER_SRC/TRANSFER_DST are effectively that capability for the Vulkan renderer,
so this may be worth proposing as a partial answer to that issue rather than as a
scenefx-specific export.

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.

4 participants