Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11406 from Pokechu22/intel-less-dual-source
VideoCommon: Clear blend configuration if color/alpha update disabled
  • Loading branch information
phire committed Feb 14, 2023
2 parents 5f929d0 + 4f6ce51 commit ba3c38a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/Core/VideoCommon/RenderState.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit ba3c38a

Please sign in to comment.