VideoCommon: copy software renderer logic for blend mode priorities

I've not tested this on hardware, but it fixes issue 12271 (shadow
people in Deal or No Deal - Special Edition).
This commit is contained in:
Tillmann Karras 2023-11-12 05:47:22 +00:00
parent f35ee22755
commit ac9079f2ca
2 changed files with 37 additions and 39 deletions

View File

@ -11,8 +11,8 @@ BPMemory bpmem;
bool BlendMode::UseLogicOp() const
{
// Logicop bit has lowest priority.
if (subtract || blendenable || !logicopenable)
// Blending overrides the logicop bit.
if (blendenable || !logicopenable)
return false;
// Fast path for Kirby's Return to Dreamland, they use it with dstAlpha.

View File

@ -120,7 +120,8 @@ void BlendingState::Generate(const BPMemory& bp)
const bool dstalpha = bp.dstalpha.enable && alphaupdate;
usedualsrc = true;
// The subtract bit has the highest priority
if (bp.blendmode.blendenable)
{
if (bp.blendmode.subtract)
{
blendenable = true;
@ -135,9 +136,7 @@ void BlendingState::Generate(const BPMemory& bp)
dstfactoralpha = DstBlendFactor::Zero;
}
}
// The blendenable bit has the middle priority
else if (bp.blendmode.blendenable)
else
{
blendenable = true;
srcfactor = bp.blendmode.srcfactor;
@ -159,8 +158,7 @@ void BlendingState::Generate(const BPMemory& bp)
dstfactoralpha = DstBlendFactor::Zero;
}
}
// The logicop bit has the lowest priority
}
else if (bp.blendmode.logicopenable)
{
if (bp.blendmode.logicmode == LogicOp::NoOp)