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
+255
−46
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75a7a03
to
7edf66d
Compare
7edf66d
to
5eb56aa
Compare
phire
reviewed
Nov 24, 2021
To do this, I had to decouple framebuffer fetch from shader blending. We need to be able to access framebuffer fetch input when using shader logic ops.
…mebuffer_fetch We will automatically choose between real_ocol0 and ocol0 in the fragment shader.
5eb56aa
to
1c42144
Compare
JMC47
approved these changes
Dec 17, 2021
There was a problem hiding this 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.
|
Are you planning to add the MVK patch to upstream? |
|
@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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.


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_fetchorGL_ARM_shader_framebuffer_fetchcan take advantage of this PR.TODO
The following issues need to be resolved / investigated:
Verify Mario Kart Wii box isn't backbox appears on dev, not related to this PR