libretro / melonDS

DS emulator, sorta
GNU General Public License v3.0
38 stars 40 forks source link

[Upstream regression] Two extra frames of input latency with OpenGL Renderer #100

Open Ryunam opened 3 years ago

Ryunam commented 3 years ago

Issue split from here: https://github.com/libretro/melonDS/issues/98

When using the OpenGL renderer, there is currently one additional frame of input latency compared to the software renderer.

This is easily verifiable with the "pause and advance" (P+K) method on RetroArch. On New Super Mario Bros. using OpenGL with the latest code from master, Mario reacts when jumping on the fourth frame. With another core version dating back to December, he reacts on the third frame.

The issue appears to have started with the shader refactoring introduced in this commit: https://github.com/libretro/melonDS/commit/25ec9c05e58944631e5c59711d0e3948c7b4f0ba. Reverting it eliminates the additional frame of input latency, but also causes graphical glitches and distorts the image.

Tatsuya79 commented 3 years ago

There's 2 frames of lag now. :persevere:

Ryunam commented 3 years ago

I haven’t had the time to test this yet, but is the software renderer still unaffected?

Tatsuya79 commented 3 years ago

Yes it's fine, 3 frames vs 5 for gl on mario kart title screen.

Ryunam commented 3 years ago

I finally had a chance to build the newly-updated core and test it. Unfortunately yeah, this regression got much worse and now we have 2 more latency frames with the OpenGL renderer compared to software.

For example, in New Super Mario Bros. Mario now reacts upon jumping on the fifth frame; with the software renderer it's the third frame.

@m4tsa Can you please look into this? Honestly this 2-frame latency regression is a pretty big issue for anybody and it makes the GL renderer terribly slow and quite frankly unusable in its current state. I understand it might be difficult to pinpoint what is causing this, but since the first latency regression started to come up 2 months ago with the January rebase, having at least some feedback on your part indicating that you are investigating it would be much appreciated. Thanks in advance.

Tatsuya79 commented 3 years ago

I asked upstream if they could add a frame step hotkey to verify it's not there already.