WillPower3309 / swayfx

SwayFX: Sway, but with eye candy!
MIT License
1.18k stars 48 forks source link

1.9 merge #277

Closed fishman closed 2 months ago

fishman commented 4 months ago

render layoer_shell, render, and seatop_move_tiling and fx_renderer are currentlyt he main things that seem to require major changes.

WillPower3309 commented 4 months ago

Thanks for the work here! We'd like to use the 1.9 release to transition our fx_renderer to use the fx_renderer we've built in scenefx, which will have feature parity with the fx_renderer bundled in swayfx. As part of that, we will simply just have to import fx_renderer from scenefx and it should be plug and play for that portion of the rebase.

WillPower3309 commented 4 months ago

I'm going to make a few additions to this branch to move along some of the WIP parts, I hope you don't mind :)

WillPower3309 commented 4 months ago

Should just be render.c that needs fixing now

WillPower3309 commented 4 months ago

Relies on the swayfx-compat scenefx branch

WillPower3309 commented 3 months ago

right now it is sort of functional but black screens a lot with

00:00:19.617 [wlr] [render/swapchain.c:98] No free output buffer slot
WillPower3309 commented 3 months ago

Once the buffer slot issue is fixed, we can start adding back some of the eye candy (lots of TODOs)

ErikReider commented 3 months ago

Seems like there's a lot of missing code from sway 1.9, like the root.c file not compiling without manually copy/pasting the contents from sway 1.9

WillPower3309 commented 3 months ago
Event.WINDOW subscribed
Event.MODE subscribed
 err: wayland.c:1470: no compositor00:00:00.486 
[swaynag/swaynag.c:441] failed to register with the wayland display

New fun bug!

ErikReider commented 3 months ago

Not sure if the rebase was applied correctly

WillPower3309 commented 3 months ago

All that's left now are adding back the compositor effects in render.c (see the many TODOs), and scenefx

ErikReider commented 3 months ago

Shadow offset and blur is now in :)

ErikReider commented 3 months ago

So this is what's left (feel free to edit this comment with additional features that I've missed):

WillPower3309 commented 3 months ago

So this is what's left (feel free to edit this comment with additional features that I've missed):

  • [ ] Expose fx_renderer as public?
  • [ ] Window corners
  • [ ] Rounded rects
  • [ ] Border corners
  • [ ] Titlebar bottom broder compensation

Yup! We should also test everything scaled + rotated.

WillPower3309 commented 3 months ago

The bottom border compensation works but also applies when it shouldn't. Will fix tomorrow

WillPower3309 commented 3 months ago

scaled shadow damage tracking is broken

WillPower3309 commented 3 months ago

While it would be best to hide the fx_renderer implementation details, we will likely need to expose fx_renderer as public before scene is ready

WillPower3309 commented 3 months ago

I'm not opposed to backporting scene changes from mainline sway to swayfx early (but only after this is merged)

WillPower3309 commented 3 months ago

also need to discuss dimming + saturation. Personally I am starting to think we should deprecate saturation

ErikReider commented 3 months ago

Personally I am starting to think we should deprecate saturation

Agreed! Not really that useful due to direct scanout needing to be disabled

cvincent commented 3 months ago

Was there a feature for using custom shaders? If so, that would supersede custom saturation, wouldn't it?

WillPower3309 commented 3 months ago

Was there a feature for using custom shaders? If so, that would supersede custom saturation, wouldn't it?

Yup! We have an open issue for it, but don't have an implementation yet. It would be possible to get saturation with custom shaders, but wouldn't work on Fullscreen windows due to direct scan out

WillPower3309 commented 3 months ago

titlebars mostly done, need to properly render the border corners and the tabbed edge container titlebars

WillPower3309 commented 3 months ago

ok! All that is left is scaled + rotated effects. Right now there are a couple issues on the scenefx side that I have called out in that PR as well

WillPower3309 commented 3 months ago

Shadow scaling mostly fixed, some weird effects between windows evident: 2024-04-07_22-04-1712543450

WillPower3309 commented 3 months ago

Fine-grained TODO:

WillPower3309 commented 3 months ago

Found another issue, when moving a floating window the bottom border can be 1 px off in some positions - likely a rounding issue

EDIT: probably just https://github.com/WillPower3309/swayfx/issues/113

WillPower3309 commented 3 months ago

We need to have a discussion on if we should keep scaling in the scene side or make it a compositor responsibility

WillPower3309 commented 2 months ago

Annoying shadow issue when there are no borders (1px wide black "border" between window and shadow, stencil issue?): 2024-04-11_21-04-1712886133

ErikReider commented 2 months ago

Annoying shadow issue when there are no borders (1px wide black "border" between window and shadow, stencil issue?): 2024-04-11_21-04-1712886133

Narrowed it down to the stencil smoothstep function acting up. Very strange since we're using the same logic in master 🥴

Edit: Nvm, seems to be present in master as well, so it's at least not a regression :)

WillPower3309 commented 2 months ago

Annoying shadow issue when there are no borders (1px wide black "border" between window and shadow, stencil issue?): 2024-04-11_21-04-1712886133

Narrowed it down to the stencil smoothstep function acting up. Very strange since we're using the same logic in master 🥴

Edit: Nvm, seems to be present in master as well, so it's at least not a regression :)

Ugh hopefully it'll be fixed once we switch to a matte

WillPower3309 commented 2 months ago

With that in mind I think we have feature parity with upstream swayfx now, @ErikReider do you mind giving the render logic another look through? I'll do the same before merging

OriginCode commented 2 months ago

Maybe a little bit off-topic, but will scenefx be tagged soon after or before this PR is merged? It will help a lot for distribution packagers.

WillPower3309 commented 2 months ago

Maybe a little bit off-topic, but will scenefx be tagged soon after or before this PR is merged? It will help a lot for distribution packagers.

Yup! As soon as the corresponding scene PR is merged I will tag a release