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

DriverDetails: Add broken dual source blending bug to MoltenVK on Intel GPUs #9945

Merged
merged 2 commits into from
Sep 29, 2021

Conversation

OatmealDome
Copy link
Member

The Metal driver on Intel GPUs appears to have a bug where if ocol1 is present in the fragment shader and dual source blending is enabled, entire primitives will not be written to the depth buffer if any fragment is discarded.

This causes many games to exhibit odd layering issues that look similar to Z-fighting. The problem is especially pronounced in the Paper Mario games, where it affects basically every sprite-like object.

Apparently, a similar-ish bug also involving ocol1 is also present in the OpenGL driver: see #4402, #6219.

Fixes https://bugs.dolphin-emu.org/issues/12137 and https://bugs.dolphin-emu.org/issues/12317.

(I'm not very experienced in graphics programming, so the comments / explanation might be wrong. Feel free to correct.)

Depth buffer comparison

Dual source blending enabled:

image

Dual source blending disabled:

image

@JMC47
Copy link
Contributor

JMC47 commented Jul 23, 2021

All of this sounds pretty logical based on the bugs we've seen.

@OatmealDome
Copy link
Member Author

Rebased and modified to be more in line with how OpenGL handles BUG_BROKEN_DUAL_SOURCE_BLENDING (i.e. only enable dual source blending when necessary to emulate destination alpha).

@phire phire merged commit a47b91e into dolphin-emu:master Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants