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

GS/HW: Add support for blend second pass for hw blending. #10994

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

lightningterror
Copy link
Contributor

@lightningterror lightningterror commented Mar 29, 2024

Description of Changes

Allows us to blend Cd with alpha range of 0-2 instead of 0-1. Not all Cd cases are covered, but it's a good start.
Second best scenario, something between sw rendering and previous hw rendering, there may be a slight performance impact, but nothing like reading the framebuffer.
Also allows us to do Ad cases where we can double the blend to get the
proper blend result since Ad range is 0-1 instead of 0-2.

Rationale behind Changes

Make hw blending suck even less, will help Direct3D.

Suggested Testing Steps

Test various of games that previously were broken on Direct3D or needed higher blending on Direct3D.
This won't affect Vk/GL unless we turn off barriers, so the same games can be smoke test on them just to know nothing broke.
There's 2 dumps I need to check and make sure they aren't actually broken so don't merge, image comparisons of fixes soon™.

Eye candy comparisons, DX basic blend:

image

image

image

image

image

image

@bigol83
Copy link

bigol83 commented Mar 30, 2024

This fixes the black spots in forest on Dx11. at basic blending too.

Cattura

Great job. It's not at Vulkan and Opengl level but it's a big improvement. Will check more later.

@lightningterror
Copy link
Contributor Author

This fixes the black spots in forest on Dx11. at basic blending too.

Nah that was an error, had a condition inverted so this won't be affected once I update the pr.

@lightningterror lightningterror force-pushed the gs_blend_second_pass branch 6 times, most recently from 8fedbad to b5d0104 Compare March 30, 2024 13:38
@GitHub-Khi
Copy link

Will this PR match the Direct3D blending to the blending of Vulkan (Blending Level High) and the Software renderer for Knight Rider - The Game?

Single Frame GS-Dump:
Knight Rider - The Game_SLES-51011_20240330175154.zip

@JordanTheToaster
Copy link
Member

Will this PR match the Direct3D blending to the blending of Vulkan (Blending Level High) and the Software renderer for Knight Rider - The Game?

Single Frame GS-Dump: Knight Rider - The Game_SLES-51011_20240330175154.zip

No

@lightningterror lightningterror force-pushed the gs_blend_second_pass branch 3 times, most recently from 1c9f62f to a4af461 Compare March 31, 2024 07:33
@lightningterror lightningterror force-pushed the gs_blend_second_pass branch 2 times, most recently from 9f455a0 to fdb9d41 Compare April 1, 2024 08:19
@lightningterror lightningterror force-pushed the gs_blend_second_pass branch 2 times, most recently from f5fbb84 to 386b8fb Compare April 1, 2024 18:50
@lightningterror lightningterror force-pushed the gs_blend_second_pass branch 4 times, most recently from b9f64eb to f3adc6b Compare April 2, 2024 09:54
@lightningterror lightningterror requested review from kamfretoz, JordanTheToaster and stenzek and removed request for kamfretoz and JordanTheToaster April 4, 2024 07:11
Allows us to blend Cd with full alpha range of 0-2 bypassing hw blend limitations.
Not all Cd cases are covered, but it's a good start.

Also allows us to do Ad cases where we can double the blend to get the
proper blend result since Ad range is 0-1 instead of 0-2.
@lightningterror lightningterror merged commit b1f4f67 into master Apr 7, 2024
22 checks passed
@lightningterror lightningterror deleted the gs_blend_second_pass branch April 7, 2024 18:05
@Bonney01
Copy link

This PR fixed #11001

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

Successfully merging this pull request may close these issues.

8 participants