switchbrew / libnx

Library for Switch Homebrew

Home Page:https://switchbrew.github.io/libnx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Libnx 2.0.0 slower graphics than older version

rsn8887 opened this issue · comments

I updated libnx (and all other dkp-pacman packages) from previous stable version to 2.0.0. I re-compiled uae4all2. I am now getting more graphics stutters during scrolling than before. I double-checked by direct comparison between versions compiled with older libnx and 2.0.0.

The app uses SDL2 which used EGL. Has anything changed in 2.0.0 in the way vsync is done, or frames are drawn, or gfx is initialized, or anything else maybe timing or graphics related that could cause increased frame drops and stuttering during scrolling?

Maybe Vsync is now disabled by default? And it was enabled before?

I am not sure what happened under the hood, but it certainly seems as if the calls to SDL_RenderPresent are now completing out of sync with Vsync timing, when before, they only completed after a Vsync had actually taken place.

I figured it out. The latest version requires SDL_RENDERER_PRESENTVSYNC flag to be set. The old version seemed to sync fine without this flag.

commented

Some clarification here. libnx changes have nothing to do with this. It's mesa changes that had to do with this. Basically; our egl driver does triple buffering now and allows you to disable the swap interval using eglSwapInterval(0). It's very likely that SDL picked this up and decided to call eglSwapInterval to set it to zero when PRESENTVSYNC isn't passed in the flags.