libretro / flycast

Flycast is a multiplatform Sega Dreamcast emulator. NOTE: No longer actively developed, use upstream repo for libretro from now on - https://github.com/flyinghead/flycast
http://reicast.com
GNU General Public License v2.0
155 stars 77 forks source link

Graphical glitches in some games when switching to fullscreen/windowed with GL. #1033

Closed bslenul closed 3 years ago

bslenul commented 3 years ago

Noticed this in Ikaruga, Marvel vs. Capcom 2 and Confidential Mission: if your video driver is set to "glcore" the games will have some graphical glitches if you press F to switch to fullscreen or windowed, it seems to affect 2D stuff only and it doesn't happen in every game.

image

image

barbudreadmon commented 3 years ago

It has always been the case, iirc it only happens with per-pixel alpha sorting ? Well, the issue here is that retroarch destroys GL context when switching fullscreen/windowed, so everything needs to be deinitialized/reinitialized properly. I remember @flyinghead spent some time on this but never figured out the issue.

bslenul commented 3 years ago

Hm it wasn't happening with 0e10e86 anyway (with per-pixel, I double checked), and with current commit it's happening with the 3 alpha sorting modes available.

bslenul commented 3 years ago

Done bisecting, started with c2f735809c054b89060d19cf39a629b524e3d5f3, same commit that broke VMU and gun crosshair (#953, but fixed since a few days).

inactive123 commented 3 years ago

Is this still an ongoing issue?

bslenul commented 3 years ago

Hey! Yes unfortunately, still happening with 30da0c5.

bslenul commented 3 years ago

Update on this: I always thought it was a core issue because switching to fullscreen/window in standalone didn't trigger it but I was wrong, it was happening in standalone too by switching from vulkan to gl for example while the game is running.

However, https://github.com/flyinghead/flycast/commit/affc9f262c574b18ff661604930425c3881e9649 fixed it, so now it works properly on standalone. I compiled the core with the fix but unfortunately that didn't work.

edit: PR sent with a fix, big thank you to Flyinghead! 👍