Skip to content
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

VideoCommon: Support shader logic ops on Metal (Apple GPUs) and OpenGL ES #10215

Merged
merged 12 commits into from Dec 22, 2021

Conversation

OatmealDome
Copy link
Member

@OatmealDome OatmealDome commented Nov 14, 2021

This PR adds a shader logic ops implementation for Metal on Apple Silicon GPUs and OpenGL ES on mobile GPUs using framebuffer fetch.

Fixes Kirby's Air Ride (https://bugs.dolphin-emu.org/issues/11843).

Metal

All Apple Silicon GPUs support framebuffer fetch, so they will all gain logic ops support. However, Intel, AMD, and NVIDIA GPUs do not support it, so Intel Macs are not affected by this PR.

MoltenVK has been patched to enable SPIRV-Cross to convert Vulkan's subpass inputs into framebuffer fetch.

OpenGL ES

Devices that support either GL_EXT_shader_framebuffer_fetch or GL_ARM_shader_framebuffer_fetch can take advantage of this PR.

TODO

The following issues need to be resolved / investigated:

@JMC47
Copy link
Contributor

JMC47 commented Dec 17, 2021

I checked the notes and was going to yell at people to test this, but it turns out I was the person that was supposed to test this. Oops. Verified as working.

BEFORE:

KirbyBroken

AFTER:

KirbyAirRideFixed

Framerate differences are from me spawning in different parts of the city.

Copy link
Contributor

@JMC47 JMC47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is working in other games to the degree you'd expect as well.

@JMC47 JMC47 merged commit b1f79d9 into dolphin-emu:master Dec 22, 2021
10 checks passed
@pizuz
Copy link

pizuz commented Dec 23, 2021

Are you planning to add the MVK patch to upstream?

@OatmealDome
Copy link
Member Author

@pizuz No plans to. The patch is honestly a bit of a kludge. That sort of behaviour may not be wanted by other applications using MoltenVK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants