-
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
[Flutter GPU] Add missing MSAA stuff. #55424
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8af165e
[Flutter GPU] Add missing MSAA stuff.
bdero 4a29748
Use exceptions for errors
bdero 10ef5b4
Remove depthstencil resolve
bdero f64cd0d
Gracefully fallback to not using MSAA when normal MSAA is not supported.
bdero 29bd4c4
Remove clearBindings hack
bdero 930646f
The RenderPass isn't initialized yet, so pass the gpuContext to SetCo…
bdero fe13382
Correct test skip logic
bdero 00ee6f5
Fix skip logic more
bdero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just a thought. Maybe this doesn't actually need to be exposed at all.Just let folks construct the same MSAA or non-MSAA topolgy, and if its not supported then ignore the transient attachments and use the resolve attachment.
Practically speaking, the number of devices flutter targets that does not support MSAA is sooo small. I don't know if its worth carrying around in our API.
Additionaly, I don't know if this handles it but we need to do MSAA a bit differently for GLES. We don't ever actually allocate the transient attachment.
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.
Oooh, I think for the common case of
kMultisampleResolve
, coercing tokStore
and ignoring the multisample texture just about works. But unfortunately, things get funky withkStoreAndMultisampleResolve
and I don't think we can reasonably assume the user's intent.IIRC we did this in a way where it automagically does the right thing when you try to allocate a transient multisample texture on GLES (unless I'm thinking of the wrong thing). :)
If there's special HAL usage surrounding this, could you link to where we're doing it in the 2D renderer to help jog my memory?
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'm not sure if it would work automatically or not, see
engine/impeller/renderer/render_target.cc
Line 342 in 2d0eac0
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 think
SupportsImplicitResolvingMSAA
is just for MSAA against the onscreen textureThere 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.
No, this is used for all offscreen MSAA on the GLES backend.
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.
Oh I'm remembering this now. I don't know if I can easily hide this complexity under the API. With the way the HAL currently works, I would have to surface and document
SupportsImplicitResolvingMSAA
. The user is in an alternate reality where they have to creates, attach, and bind fake multisample textures.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'm not sure the right way to fix this in the API, but maybe consider only supporting MSAA on metal/vulkan for now and coming back to GLES?
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.
Yeah. I changed this to add a graceful fallback to not use MSAA when "normal" MSAA support is not possible. I kept the
doesSupportOffscreenMSAA
check, but now it also returns false if "implicit" MSAA is available.A renderer could easily use this check to fallback to other AA techniques (such as FXAA) when MSAA is unavailable.