libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.28k stars 1.83k forks source link

Turning on shaders on Metal build 1.14.0 stable for Mac OS will slow emulation drastically #14789

Closed Sethur closed 1 year ago

Sethur commented 1 year ago

Description

Mac OS Version: 12.6.2 Monterey Core: SNES 9x - Current (1.61) Hardware: Intel CPU Mac with Intel HD Graphics 515

Turning on shaders via the Quick Menu => Shaders => Video Shaders item for the first time on a fresh install of the current stable Metal build (1.14.0) with a wiped $HOME/Library/Application Support/RetroArch directory and freshly download slang shaders will make the emulation so slow that one can barely exit RetroArch because keyboard inputs are often not coming through any longer (mostly, not even command-Q works). That happens even though at this point no slang file has been loaded yet.

Weirdly enough, restarting RetroArch will fix this issue with Video Shaders staying enabled, but loading any slang file might trigger it again, even for very simple shaders like bilinear, etc., although this does not seem to happen every time.

Steps to reproduce the bug

  1. Do a fresh install of RetroArch Metal Stable 1.14.0 on an Intel Mac with Intel HD Graphics
  2. Install SNES 9x current core and load any SNES ROM
  3. Enable Video Shaders via the Quick Menu without actually loading a shader
  4. Observe drastic slow down

EDIT, UPDATE:

I fiddles around with this a bit more and found that in addition to the issue mentioned above, changing the shader settings does not seem to apply until RetroArch is restarted, even when Apply Changes is explicitly selected. This does include setting Shader passes to 0, and thus effectively deactivating the current shader.

personaone commented 1 year ago

I've seen similar results - On a M1 MacBook Pro 14". Sometimes going fullscreen first helps, but not often. I ended up copying my present from a Windows machine instead and it ran fine as a Global preset xD

Sethur commented 1 year ago

@personaone This sounds like this is an issue across different Mac hardware options, which makes it all the more worth fixing. I originally thought it would somehow be connected to my rather low end graphics card.

LibretroAdmin commented 1 year ago

I can reproduce this. We really need more dedicated Mac coders since it seems there are several issues with RetroArch on more recent macOS versions that have never happened on older OSX versions, and we really lack the inhouse experience to do much about it other than poking around.

personaone commented 1 year ago

Yeah I had multiple other things to report, like random crashes, that go away after restarting the system, crashing on button presses on the keyboard xD Not a developer per se but I can definetely help testing out!

LibretroAdmin commented 1 year ago

Definitely report all issues you can find. We would like to eventually publish the macOS version on Steam, and we'd really like to iron out these issues before we get to that stage.

Sethur commented 1 year ago

@warmenhoven This is not fixed for me with today's metal build (1.15.0, build date: May 9th 2023).

I am using the "metal" video driver and a simple hq2x slang shader, which runs fine on my (rather slow) Intel CPU/GPU combination. When I press any Mac keyboard function keys that cause an overlay (i.e. volume up/down), however, the emulation speed suffers severely and audio crackling is immediately setting in. As soon as the overlay disappears, emulation speed picks up again.

Maybe this issue can be re-opened.

warmenhoven commented 1 year ago
  1. I can't reproduce it on my M1
  2. That's a different issue anyway and a new issue should be filed for it
Sethur commented 1 year ago

@warmenhoven

  1. Seems to be an Intel Mac specific issue then.
  2. You are right, I had thought I had opened an issue for this already and mistakenly thought it was this one. I have opened a new issue now here: #15274