hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.11k stars 884 forks source link

Buffer synchronization issues in CS2 after AQ MR #6964

Closed vaxerski closed 2 months ago

vaxerski commented 3 months ago

Regression?

Yes

System Info and Version

You wish. Aq merge.

RX 6700 XT

Description

Basically what @romanstingler said: https://github.com/hyprwm/Hyprland/pull/6608#issuecomment-2238992134

How to reproduce

Use the steam overlay in CS2, can also happen with the viewmodel / buy menu

Crash reports, logs, images, videos

No response

vaxerski commented 3 months ago

@ikalco any progress here?

ikalco commented 3 months ago

setting vsync fixes the flickering after game restart ds also works

its probably something with the new explicit sync stuff messing with implicit sync I have a feeling surface commits are somehow broken, like commitPendingState

ps: the proton thing was because it was in ds lol also putting a glFinish() in renderSurface makes it better, but thats wrong

vaxerski commented 3 months ago

setting vsync fixes the flickering after game restart

in cs2?

ds also works

speak for yourself

its probably something with the new explicit sync stuff messing with implicit sync

I have explicit disabled

ikalco commented 3 months ago

in cs2?

yes open game, turn on vsync, still flickering, exit game and reopen, no more flickering

its probably something with the new explicit sync stuff messing with implicit sync

I have explicit disabled

i meant that some of the code that was changed for explicit sync might have broken implicit sync even with the option off

edit: also forgot to mention that if you lower fps below rr the flickering only happens when the mouse is moved

vaxerski commented 3 months ago

hm, I thought all of it would be neutered with the opt disabled

vaxerski commented 3 months ago

I have vsync enabled in cs2 and nothign changed

vaxerski commented 3 months ago

also forgot to mention that if you lower fps below rr the flickering only happens when the mouse is moved

not the case here, it does it constantly

ikalco commented 3 months ago

yeah i cant find what got reverted prob in aq or something

vaxerski commented 2 months ago

debug's glitches go away when I fullscreen

can't say the same about release

vaxerski commented 2 months ago

okay. It's direct scanout. With DS, it's gone. Without, it is there. Too bad I can't play cs2 with ds.

ikalco commented 2 months ago

egl init stuff looks the same except for maybe a few extension checks and the version eglCreateImage/eglDestroyImage are used the same as before

this is so fucked

ikalco commented 2 months ago

as far as i can tell there's only one surface being rendered for csgo which means that for some reason the steam overlay just isnt drawn by it every few frames...

I have a theory: CSGO is trying to put out frames at max fps but the overlay is only rendering at rr This means some frames submitted by CSGO have game stuff but not overlay stuff, therefore flickering

no idea how to test that but ill try later

vaxerski commented 2 months ago

not possible. Before aq and sway work correctly.

Furthermore, in-game, sometimes the buy menu or viewmodel also flicker

LOSEARDES77 commented 2 months ago

I dont know if this is the same issue but i'm getting this effect. If i restart the game or something it goes away for a bit but allways comes back

https://github.com/user-attachments/assets/1f598a69-1021-4f22-8ff8-bfc86cd9d9ab

vaxerski commented 2 months ago

plausible

LOSEARDES77 commented 2 months ago

untitled.mp4

Maybe an nvidia issue too I am using the 560 drivers with this

romanstingler commented 2 months ago

untitled.mp4

Maybe an nvidia issue too I am using the 560 drivers with this

also very possible. 560 is borked, according to CachyOS devs

mahkoh commented 2 months ago

Current xwayland and radv require the compositor to support explicit sync. https://gitlab.freedesktop.org/mesa/mesa/-/issues/11294

vaxerski commented 2 months ago

are you sure? because of two things:

mahkoh commented 2 months ago

mesa on my pc will not use explicit sync at all even if I enable it in hyprland (it just doesnt bind the protocol at all)

My comment is about current radv/mesa. If your mesa is older than 24.1 then you are likely not affected by the linked issue.

are you sure?

The issue says as much. But I'm not saying that hyprland doesn't have additional bugs.

vaxerski commented 2 months ago

hm, right, I see my mesa ver is 24.1.4. Explicit sync is kinda wonky in Hyprland atm, weird though that sway works then (despite the lack of explicit sync support...?)

vaxerski commented 2 months ago

thanks @mahkoh for linking the issue though, after some tinkering with explicit sync it seems to be working, though I have some doubts about our internal sync mechanisms, I'll make a MR and we'll test more there