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

VertexManagerBase: Skip drawing objects with mismatched xf/bp stages #8717

Merged
merged 2 commits into from
Apr 21, 2020
Merged

VertexManagerBase: Skip drawing objects with mismatched xf/bp stages #8717

merged 2 commits into from
Apr 21, 2020

Conversation

stenzek
Copy link
Contributor

@stenzek stenzek commented Apr 1, 2020

Hardware tests have shown that if the number of texgens/channels do not match, you get garbage rendering. Presumably because the output registers from the XF stage are fed into the incorrect input registers for TEV/BP.

Currently, this causes Dolphin to crash/generate invalid shaders with an assertion failure in the hardware backends. Instead, we log an error.

Perhaps in the future we should just spit out all texgens/colors anyway from both stages, and let cross-stage optimization take care of DCE'ing it away. But doing so would require changing the UIDs and invalidating everyone's shader caches.

@iwubcode
Copy link
Contributor

iwubcode commented Apr 1, 2020

Just curious, what games were affected by this?

@stenzek
Copy link
Contributor Author

stenzek commented Apr 1, 2020

According to the discussion on IRC, Super Paper Mario at least.

@@ -344,6 +344,17 @@ void VertexManagerBase::Flush()

m_is_flushed = true;

if (xfmem.numTexGen.numTexGens != bpmem.genMode.numtexgens ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it hurt that this block (which can early return) is after m_is_flushed = true ?

Copy link
Contributor Author

@stenzek stenzek Apr 1, 2020

Choose a reason for hiding this comment

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

Nope, we want to skip the object, i.e. set it as flushed.

@Sintendo
Copy link
Member

Sintendo commented Apr 1, 2020

Would it make sense to add this as a new GameQuirk and have analytics report this?

@stenzek
Copy link
Contributor Author

stenzek commented Apr 1, 2020

Would it make sense to add this as a new GameQuirk and have analytics report this?

Yep, sounds like a good idea!

@JosJuice
Copy link
Member

JosJuice commented Apr 1, 2020

Is this related to https://bugs.dolphin-emu.org/issues/10180?

@stenzek
Copy link
Contributor Author

stenzek commented Apr 1, 2020

@JosJuice yes, I believe so.

stenzek added 2 commits April 2, 2020 12:51
Hardware tests have shown that if the number of texgens/channels do not
match, you get garbage rendering. Presumably because the output
registers from the XF stage are fed into the incorrect input registers
for TEV/BP.

Currently, this causes Dolphin to crash/generate invalid shaders with an
assertion failure in the hardware backends. Instead, we log an error.

Perhaps in the future we should just spit out all texgens/colors anyway
from both stages, and let cross-stage optimization take care of DCE'ing
it away. But doing so would require changing the UIDs and invalidating
everyone's shader caches.
@Miksel12
Copy link
Contributor

Miksel12 commented Apr 6, 2020

SSX Tricky (https://wiki.dolphin-emu.org/index.php?title=SSX_Tricky) and Harley-Davidson: Road Trip (https://wiki.dolphin-emu.org/index.php?title=Harley-Davidson:_Road_Trip) are also affected by this issue.

@JMC47 JMC47 merged commit d845b31 into dolphin-emu:master Apr 21, 2020
if (xfmem.numChan.numColorChans != bpmem.genMode.numcolchans)
{
DolphinAnalytics::Instance().ReportGameQuirk(
GameQuirk::MISMATCHED_GPU_TEXGENS_BETWEEN_XF_AND_BP);

Choose a reason for hiding this comment

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

Shouldn't this be MISMATCHED_GPU_COLORS_BETWEEN_XF_AND_BP?

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

Successfully merging this pull request may close these issues.

8 participants