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

VideoCommon: copy software renderer logic for blend mode priorities #12287

Merged
merged 1 commit into from Nov 12, 2023

Conversation

Tilka
Copy link
Member

@Tilka Tilka commented Nov 12, 2023

I've not tested this on hardware, but it fixes issue 12271 (shadow people in Deal or No Deal - Special Edition).

The software renderer uses (pseudo code):

  if (bpmem.blendmode.blendenable)
  {
    if (bpmem.blendmode.subtract)
      SubtractBlend
    else
      BlendColor
  }
  else if (bpmem.blendmode.logicopenable)
    LogicBlend
  else
    dstClrPtr = color;

Until now VideoCommon used:

  if (bpmem.blendmode.subtract)
    SubtractBlend
  else if (bpmem.blendmode.blendenable)
    BlendColor
  else if (bpmem.blendmode.logicopenable)
    LogicBlend
  else
    dstClrPtr = color;

The diff is much smaller when whitespace is ignored.

I've not tested this on hardware, but it fixes issue 12271 (shadow
people in Deal or No Deal - Special Edition).
@Tilka
Copy link
Member Author

Tilka commented Nov 12, 2023

Before:
00000000_2023-11-12_06-02-52

After:
00000000_2023-11-12_06-03-24

@Pokechu22
Copy link
Contributor

This seems like a plausible fix. It looks like OpenGL handled it this way prior to 90254bd (March 2009), and that commit doesn't seem to be specifically targeting this behavior. (The authoritative-sounding comment was added in 3df8284/#4581.) The software renderer has always had it, ever since it was added in 9b16c36 (October 2009 - odd that this is after the other commit).

Hardware testing of some sort would be nice, but probably isn't needed.

Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change matches sw renderer and LGTM. Tested with a handful of games/personal fifologs.

@Tilka Tilka merged commit e5d2deb into dolphin-emu:master Nov 12, 2023
11 checks passed
@Tilka Tilka deleted the blending branch November 12, 2023 07:31
@JosJuice
Copy link
Member

Has a FIFO log for this been added to FifoCI?

@Tilka
Copy link
Member Author

Tilka commented Nov 12, 2023

Has a FIFO log for this been added to FifoCI?

No, how do I do that?

@Pokechu22
Copy link
Contributor

I think @JMC47 needs to add them (it's part of an admin interface of some sort), which requires both a fifolog (DOND_SE_Blend_Issue_Career.zip from https://bugs.dolphin-emu.org/issues/12271) and a description for it (something like "Deal or No Deal - Special Edition renders its character models with blending disabled but with the blending subtract bit set. If subtraction blending is actually used, the scene renders incorrectly.")

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