video_core: Emulate scaled min/max blending - #4768
Open
meh7an wants to merge 3 commits into
Open
Conversation
Contributor
|
The scaled min/max blending thing I would consider as an acceptable workaround for now since full min/max blending emulation is cumbersome. However the readback thing is a hack and not that clean. The real issue that needs solving is having texture cache properly validate rendering a subrect of an image with same pitch |
meh7an
force-pushed
the
fix/minmax-blend-factors
branch
from
July 29, 2026 05:21
39a0f5d to
623aabc
Compare
meh7an
marked this pull request as draft
July 29, 2026 05:35
meh7an
force-pushed
the
fix/minmax-blend-factors
branch
from
July 29, 2026 06:13
91bad68 to
623aabc
Compare
meh7an
marked this pull request as ready for review
July 29, 2026 06:17
raphaelthegreat
approved these changes
Aug 12, 2026
| color_buffer.swizzle = col_buf.Swizzle(); | ||
|
|
||
| const auto& bc = regs.blend_control[cb]; | ||
| color_buffer.blend_self_scale = |
Contributor
There was a problem hiding this comment.
When this is true add a warning log so it can be known when this emulation triggers
This file contains hidden or 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
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.Suggestion cannot be applied right now. Please check back later.
The problem
On GCN the color blender applies blend factors to min/max operations; Vulkan ignores them by spec. A pipeline blending
MIN/MAXwithsrc_factor=SRC_COLOR, dst_factor=DST_COLORexpectsmin/max(src*src, dst*dst)— squared-domain accumulation — but gets plainmin/max(src, dst). This is the case the existing "Unimplemented use of min/max blend op with blend factor not equal to one" warning points at. God of War 3 Remastered builds its screen-space light/shadow accumulation with exactly this state, washing out environment materials and leaving its stochastic shadow dither unresolved on screen.The fix
Flag the pattern in the graphics pipeline key; the fragment shader squares its RGB output for that attachment at export and the Vulkan blend factors are forced to
ONE, so fixed-function min/max produces exactlymin/max(src^2, dst^2)like the hardware does. Clear values 0 and 1 are fixed points of the transform, so the attachment stays coherent end to end. Pipelines without this blend state are unaffected.