-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Metal backend #1287
base: main
Are you sure you want to change the base?
WIP: Metal backend #1287
Conversation
Very impressive work so far! I did not expect anyone to take on adding a whole new renderer. From past experience when working on the OpenGL and Vulkan renderer I learned that the hardest problems come up at the end in regards to performance optimizations, weird API limitations which require workarounds or specifically for Metal: lack of geometry shaders. If the Metal backend gets past those problems into a fully functional state that is on par with the Vulkan renderer then we can talk about getting this merged and discuss any long term support plans. A proper full code review would also be necessary of course. Looking forward to seeing this progress! |
this is some good work, thank you for it Samo |
I don't think I use any Metal 3 functionality. Regarding geometry shaders, they could be emulated with compute shaders, though I would much rather use mesh shaders and give up on Metal 2 compatibility. |
Built again with the debug version - the duplicated frame issue has gone away so must have not had some of your latest commits in, I am still finding the game hangs around the same place on Metal, even with the screenshot implementation, log attached: |
First of all, awesome work on this. We definitely needed a Metal implementation. Seems the crash I mentioned earlier must have been an issue with my device, as it is now running the Metal engine smoothly. Awesome work! |
Thanks! And exactly what game was crashing? |
Alright, good to hear that. I have no idea what could be causing the game to freeze though. |
Paper Mario Color Splash. When I first launched the game using Metal FPS was 1-2 then when I got past the start screen it hard crashed (macOS froze), but after the restart I tried it again with Vulkan and it was fine so I decided to risk it and suddenly Metal was working. Still not sure if it was my device or Cemu. |
Amazing work on this project! I'm on an M1 MacBook Pro and gave your Metal backend a go with Wind Waker HD. In general, things are much snappier than Vulkan with no graphical weirdness I can see, though the areas with many particles e.g. Dragonroost Island are still very choppy / low framerate (fluctuates between 8-15fps on my system). Other places with the same issue include the purple sparkles on the title screen and bomb explosion particles, which also tank the framerate. Is there a fix for this in the pipeline? Would be happy to keep testing. |
Thank you for your feedback! I have heard about the frame drop in Wind Waker HD. I don’t know if there is much I can do about it, but if you would make a frame capture (guide: https://github.com/SamoZ256/cemu-frame-capture), I could take a look at it and see if I could make a hack specifically for this game to improve it. Also, is the frame rate better than Vulkan in the areas with many particles? |
Any workaround would be amazing! Have Discord DM'd you the frame captures. The frame rate is perhaps very slightly better in the particle-heavy areas on Dragonroost Island. With Vulkan that area is more like 8-13fps. |
thanks for the hard work. Unfortunately, Mario Kart doesn't start the second time |
Hi! This could probably (temporarily) be solved by clearing the shader cache. Also, make sure you are on the latest testing release. |
For anyone wanting to report game status/issues, please use this guide: https://github.com/SamoZ256/cemu-metal-game-compatibility. |
This PR implements a Metal backend for macOS. It should bring better performance compared to Vulkan, as well as fix some issues that wouldn't be possible with Vulkan due to MoltenVK limitations. I haven't tested many games, but those that I tried worked pretty well.
TODO:
Screenshots:
New Super Mario Bros U
Captain Toad Treasure Tracker
Super Mario 3D World
Mario Kart 8
The Legend of Zelda: Breath of the Wild
Super Mario Maker