Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented May 7, 2023

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>

IMpeller Before TEss Fix   500ms
Impeller TOT   52ms
Impeller CPU   14ms
Impeller Vert   2.4ms

Benchmark is pending here: flutter/flutter#126728

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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See SkNextPow2 and SkNextLog2.

Copy link
Contributor

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
Copy link
Contributor Author

This is working and has the correct fallbacks, last remaining task is to fix the subdivision curve.

jonahwilliams added 2 commits May 12, 2023 11:02
@jonahwilliams jonahwilliams changed the title [Impeller][WIP] compute circle geometry in vertex shader [Impeller] Compute geometry for drawPoints in vertex shader, with fallback for optimized CPU routine. May 12, 2023
jonahwilliams added 2 commits May 12, 2023 19:45
@jonahwilliams
Copy link
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

![image](https://github.com/flutter/engine/assets/8975114/29d84e0d-7be6-426a-b5e3-5226c1953a47)
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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants