This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Compute geometry for drawPoints in vertex shader, with fallback for optimized CPU routine. #41803
Closed
Conversation
This file contains hidden or 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
jonahwilliams
commented
May 8, 2023
impeller/entity/geometry.cc
Outdated
Comment on lines
1001
to
1012
| // note: this formula is completely arbitrary, we should find a reasonable | ||
| // curve based on experimental data. | ||
| if (scaled_radius < 4.0) { | ||
| return 8; | ||
| } | ||
| if (scaled_radius < 16) { | ||
| return 16; | ||
| } | ||
| if (scaled_radius < 32) { | ||
| return 32; | ||
| } | ||
| return 64; |
Contributor
Author
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.
TODO
Contributor
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.
See SkNextPow2 and SkNextLog2.
Contributor
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 see, this is supposed to be modelling a curve not just always getting the next power of 2)
jonahwilliams
commented
May 8, 2023
jonahwilliams
commented
May 8, 2023
jonahwilliams
commented
May 8, 2023
Contributor
Author
|
This is working and has the correct fallbacks, last remaining task is to fix the subdivision curve. |
1c267a6 to
0591bf1
Compare
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
May 15, 2023
Add a benchmark that measures the improvements from flutter/engine#41803
Contributor
Author
|
Closing in favor of compute based approach |
auto-submit bot
pushed a commit
that referenced
this pull request
May 19, 2023
…etry computation with compute, fallback to specialized CPU. (#42060) Compute shader implementation of #41803 I found this to be generally more straightforward, and we can revisit the vertex shader approach with GLES. Benchmark is pending here: flutter/flutter#126728 Note: rendering behavior is identical even though this is now a single draw call. This is becuase strokes have overdraw prevention enabled by default, while this new contents does not 
CaseyHillers
pushed a commit
to CaseyHillers/flutter
that referenced
this pull request
May 24, 2023
Add a benchmark that measures the improvements from flutter/engine#41803
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Example of using disabling rasterization and using a vertex shader for computing circle geometry. This is only wired up in Metal, but could be supported in GLES 3.0 / WebGL with Transform_Feedback
<style type="text/css"></style>
Benchmark is pending here: flutter/flutter#126728