-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
Just curious, what games were affected by this? |
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 || |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
Would it make sense to add this as a new GameQuirk and have analytics report this? |
Yep, sounds like a good idea! |
Is this related to https://bugs.dolphin-emu.org/issues/10180? |
@JosJuice yes, I believe so. |
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.
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. |
if (xfmem.numChan.numColorChans != bpmem.genMode.numcolchans) | ||
{ | ||
DolphinAnalytics::Instance().ReportGameQuirk( | ||
GameQuirk::MISMATCHED_GPU_TEXGENS_BETWEEN_XF_AND_BP); |
There was a problem hiding this comment.
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?
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.