summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderState.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2023-02-14 18:27:40 +1300
committerGitHub <noreply@github.com>2023-02-14 18:27:40 +1300
commitba3c38a63f9812ca7ab427960c3543a3c9dbc324 (patch)
tree43f35d1c60cb282d11aeaba6ff42d53b6de61b06 /Source/Core/VideoCommon/RenderState.cpp
parent5f929d00eb6d24c6159ec28323100a3a81dbd7b7 (diff)
parent4f6ce51d69612ae448bcfed7b7e27fa9ace5b756 (diff)
Merge pull request #11406 from Pokechu22/intel-less-dual-source
VideoCommon: Clear blend configuration if color/alpha update disabled
Diffstat (limited to 'Source/Core/VideoCommon/RenderState.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderState.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/RenderState.cpp b/Source/Core/VideoCommon/RenderState.cpp
index 93359e13df..0860488b8a 100644
--- a/Source/Core/VideoCommon/RenderState.cpp
+++ b/Source/Core/VideoCommon/RenderState.cpp
@@ -180,6 +180,22 @@ void BlendingState::Generate(const BPMemory& bp)
}
}
}
+
+ // If we aren't writing color or alpha, don't blend it.
+ // Intel GPUs on D3D12 seem to have issues with dual-source blend if the second source is used in
+ // the blend state but not actually written (i.e. the alpha src or dst factor is src alpha, but
+ // alpha update is disabled). So, change the blending configuration to not use a dual-source
+ // factor. Note that in theory, disabling writing should render these irrelevant.
+ if (!colorupdate)
+ {
+ srcfactor = SrcBlendFactor::Zero;
+ dstfactor = DstBlendFactor::One;
+ }
+ if (!alphaupdate)
+ {
+ srcfactoralpha = SrcBlendFactor::Zero;
+ dstfactoralpha = DstBlendFactor::One;
+ }
}
void BlendingState::ApproximateLogicOpWithBlending()