matinlotfali / KDE-Rounded-Corners

Rounds the corners of your windows in KDE Plasma 5 and 6
GNU General Public License v3.0
614 stars 20 forks source link

Amd FreeSync/Adaptive-Sync/VRR doesn't work while the effect is active #89

Closed kuunha closed 9 months ago

kuunha commented 1 year ago

While the effect is active, Freesync doesn't work Already tried to logoff / restart, but still have the same issue

Video showing my monitor overlay with the screen refresh rate: https://imgur.com/in9zZ8W (Sorry for the quality, had to record with my phone to show the monitor overlay)

More Info: Version: 0.4.0.6~4bf08dd (compiled from source) Game running in Wayland via XWayland (didn't test in X) Using Vulkan through vkd3d-proton Using dual monitors. Only one is capable of freesync

System info: Operating System: openSUSE Tumbleweed KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.107.0 Qt Version: 5.15.10 Graphics Platform: Wayland Graphics Processor: AMD Radeon RX 5700 XT

matinlotfali commented 1 year ago

For your games, I believe it is best to disable desktop effects. On X11, you can use the checkbox "allow applications to disable compositing." which is in:

System Settings -> Display and Monitor -> Compositor.

And you need games to run in fullscreen mode.

If that doesn't work, add your game to Lutris and right-click on the game in Lutris -> system options -> disable desktop effects. Lutris does it automatically (and re-enables it automatically) when you enable that setting.

RomanKode commented 1 year ago

AFAIK the compositor cannot be disabled on Wayland and on X some themes look like hot garbage when Compositor is off and you alt+tab, best solution would be to make a checkbox to disable rounded corners when a full-screen application is focused and when its unfocused the rounded corners should reactivate.

matinlotfali commented 1 year ago

@RomanKode that is a clever idea to disable the effect on all windows if the active window is maximized. I will implement it in a pull request and then @kturques can test if it fixes the issue for him.

matinlotfali commented 1 year ago

@RomanKode I just noticed that when I disable the effect after the active window is maximized, having two monitors, you can actually see unrounded windows on the other monitor. So just like you said, if it resolves @kturques' issue, we need a config checkbox like "Game Mode" with proper descriptions so users know it is a feature, not a bug.

RomanKode commented 1 year ago

@RomanKode I just noticed that when I disable the effect after the active window is maximized, having two monitors, you can actually see unrounded windows on the other monitor. So just like you said, if it resolves @kturques' issue, we need a config checkbox like "Game Mode" with proper descriptions so users know it is a feature, not a bug.

If only (for testing purposes) it was possible to selectively apply the shader to specific windows or possibly blacklist specify windows, the reason being is that probably the GLShader could be conflicting with VRR synching on the applied window. We also did not ask OP if it was happening with all games or just that one.

@kturques can you install vkbasalt, mangohud and goverlay, the reason is to see if VRR is affected by vkbasalt post processing of shaders, I want to doubt that it would cause a problem because I'm more inclined to believe that rounded corner shader is a top layer effect and is causing the system to sync for both the game and the window is attempting to render.

matinlotfali commented 1 year ago

If only (for testing purposes) it was possible to selectively apply the shader to specific windows or possibly blacklist specify windows

I am already applying the shader selectively. Maximized windows don't have rounded corners because I have blacklisted them. I think the issue is that the VRR syncing is still affected if unmaximized windows also have rounded corners, even behind the active maximized window. Hence, I created pull request #93 to test if I am right.

KingKrouch commented 10 months ago

I am already applying the shader selectively. Maximized windows don't have rounded corners because I have blacklisted them. I think the issue is that the VRR syncing is still affected if unmaximized windows also have

This sounds like a great pull request, because at the moment, I'm having an issue where a border appears around the maximized window.

Will give this a shot.

EDIT: It doesn't seem to do anything for me on KDE Wayland at least. Tried Half-Life and Strange Brigade on Steam with the Game Mode enabled, and the border effect still seems to happen.

Zamundaaa commented 9 months ago

With the Automatic setting, KWin checks for whether or not there's any effects doing stuff with fullscreen windows, that's most likely what's causing the issue here. It can be handled better in KWin (and I intend to do so for Plasma 6), but if you override the blocksDirectScanout method to return false in the effect, VRR should start working correctly in Plasma 5 and reduce some overhead for fullscreen too.

matinlotfali commented 9 months ago

@Zamundaaa Thanks for mentioning it. It is the first time I have noticed such a thing. Let's test its result in #127