-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Impeller] Fix GL depth state. #51040
Conversation
// https://github.com/flutter/flutter/issues/136322 | ||
#if !FML_OS_MACOSX | ||
gl.ClearDepthf(pass_data.clear_depth); | ||
#endif |
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.
This was one of the issues for OpenGLES playground runs on MacOS. OpenGL defaults the depth clear value to 1. But my new depth clipping scheme relies on clearing to 0.
And so not being able to modify the depth clear value meant nothing could draw in subpasses that had a depth attachment.
@@ -242,6 +241,9 @@ struct RenderPassData { | |||
gl.Disable(GL_CULL_FACE); | |||
gl.Disable(GL_BLEND); | |||
gl.ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | |||
gl.DepthMask(GL_TRUE); | |||
gl.StencilMaskSeparate(GL_FRONT, 0xFFFFFFFF); | |||
gl.StencilMaskSeparate(GL_BACK, 0xFFFFFFFF); |
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.
When depth buffer clipping + StC is enabled, the depth mask toggles very frequently, so we need to make sure it's on before clearing.
We've yet to utilize the stencil mask in the 2D renderer, which is why we haven't noticed this problem up until now.
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.
LGTM
…144338) flutter/engine@91898e3...c9381fb 2024-02-28 [email protected] Revert "Bump everything to Android 21" (flutter/engine#51056) 2024-02-28 [email protected] Roll Skia from 0c294ee206e8 to 93f245da0097 (2 revisions) (flutter/engine#51055) 2024-02-28 [email protected] [Android] update fallback and rendering state to combine impeller + android backend. (flutter/engine#51008) 2024-02-28 [email protected] [Impeller] Fix GL depth state. (flutter/engine#51040) 2024-02-28 [email protected] Roll buildroot to 7b537de78ac2239982ace130d1845374e5dcf113 (flutter/engine#51053) 2024-02-28 [email protected] Roll Skia from d935943bedcd to 0c294ee206e8 (3 revisions) (flutter/engine#51051) 2024-02-28 [email protected] When run_tests.py is in --quiet mode, write verbose logs to a file (flutter/engine#51029) 2024-02-28 [email protected] Roll Skia from fe34002ee826 to d935943bedcd (1 revision) (flutter/engine#51049) 2024-02-28 [email protected] Bump everything to Android 21 (flutter/engine#51032) 2024-02-28 [email protected] Add flutter prefix to import (flutter/engine#51042) 2024-02-28 [email protected] Roll Skia from d591703635b0 to fe34002ee826 (1 revision) (flutter/engine#51048) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Resolves flutter/flutter#136322.
This patch fixes problems with GL depth (in service of #50856):
glClearDepth
andglDepthRange
rather thanglClearDepthf
andglDepthRangef
.