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

PixelShaderGen: only use dual-source if bpmem requires dual-src blending #6219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ligfx
Copy link
Contributor

@ligfx ligfx commented Nov 25, 2017

This fixes Issue 9373: Depth issues on Mario Kart Double Dash.

There seems to be some interaction between having ocol1 in the fragment shader and calling glBindFragDataLocationIndexed: removing either one fixes the issue. Adding stronger dual source requirements to the fragment shader seemed like the cleaner option.

Before:

screen shot 2017-11-25 at 2 18 01 pm

After:

screen shot 2017-11-25 at 2 17 32 pm

@iwubcode
Copy link
Contributor

Seems fine to me but @stenzek or @degasus should give it a second look.

@CrossVR
Copy link
Contributor

CrossVR commented Nov 25, 2017

This seems redundant, why not just add MacOS to the BUG_BROKEN_DUAL_SOURCE_BLENDING in the driver details and update the description to make it more general?

Copy link
Contributor

@CrossVR CrossVR left a comment

Choose a reason for hiding this comment

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

To summarize what was discussed on IRC. I'd rather not add new UID fields. Another solution is to get rid of the glBindFragDataLocationIndexed calls by specifying the locations in the shader.

This requires OpenGL 3.3 however, so either we need to check if the relevant extension is supported or decide that OpenGL 3.3 is the minimum to run Dolphin. Also we need to check whether this is supported on OpenGL (ES) on Android.

@degasus
Copy link
Member

degasus commented Nov 26, 2017

always doing dual source blend was on purpose, as we want to use the color as blend factors with 24 bit accuracy and write the color with rgb565 accuracy.

@kemenaran
Copy link
Contributor

Just tested this PR on macOS 10.12: I can confirm this fixes issue Issue 9373 (Depth issues on Mario Kart Double Dash), and similar depth issues on Mario Kart Wii.

@ligfx thank you so much for your work on this!

@ghost
Copy link

ghost commented Dec 26, 2021

This can help my issue (dark blue filter overlay)?

Screenshot_2021-12-26-10-21-12-121_org dolphinemu dolphinemu

Android 11
Vulkan
Mali-G52

@JosJuice
Copy link
Member

@Gamemulatorer No.

@dreamsyntax
Copy link
Member

@JMC47 please close this per https://bugs.dolphin-emu.org/issues/9373#note-20

@JosJuice
Copy link
Member

Was this ever actually fixed in macOS OpenGL though?

@dreamsyntax
Copy link
Member

Was this ever actually fixed in macOS OpenGL though?

I own this game and a mac, ill test and report back.

@dreamsyntax
Copy link
Member

Works on an M1 Mac running Sequoia (15.2). Probably unrelated, I get a warning about performance so noting that here.
Stock Dolphin settings on 2412-183.
boot
OpenGL
opengl

Metal
metal

Oddly enough I get the same warning if I pick Metal, even though it says OpenGL in the warning.

@dreamsyntax
Copy link
Member

dreamsyntax commented Jan 24, 2025

Since the original image shows an Intel GPU, my above test may not be sufficient to confirm if it is resolved. Someone with an older mac with an Intel GPU would need to check.

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.

7 participants