-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Do depth copy in through mode as well #5071
Conversation
@@ -879,7 +879,7 @@ void FramebufferManager::SetRenderFrameBuffer() { | |||
|
|||
#ifdef MAY_HAVE_GLES3 | |||
// Let's only do this if not clearing. | |||
if (!gstate.isModeClear() || !gstate.isClearModeDepthMask()) { | |||
if (!gstate.isClearModeDepthMask() && gstate.isModeThrough()) { |
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.
Why did you remove the gstate.isModeClear()
check? What is the rationale/reasoning for not allowing this in throughmode?
I'm pretty sure that throughmode is just as capable of doing depth testing.
-[Unknown]
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.
Indeed , I only test it based on real game to see if it works propertly and how's the compability in general case .
Of course it may not cover all cases and only best effort .
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.
I still don't understand the clearmode check removal.
At the least it should have a comment saying that why throughmode is excluded, and that it is a hack to attempt to improve performance.
-[Unknown]
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.
I have added comment to specific mention it is a hack and why throughmode is excluded.
if (!gstate.isModeClear() || !gstate.isClearModeDepthMask()) { | ||
// Note : It is a hack to improve performance in general case .Exclude throughmode is used for the | ||
// intermittent sprite missing in Star Wars Force Unleashed | ||
if (!gstate.isClearModeDepthMask() && gstate.isModeThrough()) { |
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.
I still don't understand why you removed the isModeClear() check, and if I read this correctly, you're ONLY doing it during throughmode, not excluding throughmode.
-[Unknown]
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.
Done .I put the !gstate.isModeClear() back :)
And what about #5064 ? Wouldn't it be fixed as well? |
It does not fix #5064 |
The newly changed commit in this pull request causes the performance to be bad again. To clarify, for line 882 in
However, putting back
Just an observation, since if this pull request is merged as it is right now, #5070 will not be fixed since the commit has been altered. It seems like adding back the |
Well, as I said, it's necessary to check both, but the code didn't make sense in the beginning and still doesn't make sense. If if (!(gstate.isModeClear() && gstate.isClearModeDepthMask())) It happens that this is logically identical to: if (!gstate.isModeClear() || !gstate.isClearModeDepthMask()) That's what the code currently does. If a hack is added to skip this except in throughmode, (which I still expect there may be better ways, and sitll doesn't really make sense to me), then it would be one of: if (gstate.isModeThrough() && !(gstate.isModeClear() && gstate.isClearModeDepthMask()))
if (gstate.isModeThrough() && (!gstate.isModeClear() || !gstate.isClearModeDepthMask())) The current code does not make sense. It says to copy the framebuffer always if clear mode is off, OR if (clear depth is off AND it's not throughmode.) The point is that -[Unknown] |
Anyway , I gonna close this and hopefully we can have a better option here :) |
As always , not too sure if it is totally correct and may need more testing .Tested on my NV system and better performance loss than previously .(less than 10 FPS in unthrottling mode)
Tested with the following games that may require depth copy to work propertly