Skip to content
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] compute UVs in vertex stage. #52106

Merged
merged 12 commits into from
Apr 20, 2024

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Apr 13, 2024

Split the functionality of texture_fill and tiled_texture_fill vertex stages:

  • The former will accept uvs as part of the vertex data and pass it to the fragment stage.
  • The latter will compute the uv geometry in the vertex stage from the position and the normalizing transform.

With this functionality, we can delete all of the CPU based uv computation code. Additionally, there is some clean up to remove support for external textures (which use the tiled texture mode) from the texture contents. The external textures are used with an image shader/draw rect by internal engine code and won't go down the drawImageRect path anymore.

@jonahwilliams jonahwilliams marked this pull request as ready for review April 19, 2024 22:57
@@ -79,7 +80,6 @@ impeller_shaders("modern_entity_shaders") {
"shaders/gradients/radial_gradient_ssbo_fill.frag",
"shaders/gradients/sweep_gradient_ssbo_fill.frag",
"shaders/geometry/points.comp",
"shaders/geometry/uv.comp",
Copy link
Member Author

Choose a reason for hiding this comment

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

1 for 1!

float16_t(frag_info.y_tile_mode) // y tile mode
) *
float16_t(frag_info.alpha);
if (supports_decal == 1.0) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Allows metal, vulkan, and most gles devices to use this shader at no additional cost over the texture_fill shader.

@@ -129,10 +129,8 @@ using TexturePipeline =
using TextureStrictSrcPipeline =
RenderPipelineHandle<TextureFillVertexShader,
TextureFillStrictSrcFragmentShader>;
using PositionUVPipeline = RenderPipelineHandle<TextureFillVertexShader,
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused

@jonahwilliams
Copy link
Member Author

come on goldens, please be good lol

@chinmaygarde
Copy link
Member

📿

@jonahwilliams
Copy link
Member Author

And we're good

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

This works way nicer! I didn't pay super close attention to the deletions on of the calculation on the CPU but trust they were mechanical.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 20, 2024
@auto-submit auto-submit bot merged commit 1ac3ce3 into flutter:main Apr 20, 2024
31 checks passed
@jonahwilliams jonahwilliams deleted the compute_uv_vertex_stage branch April 20, 2024 19:41
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 20, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 20, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 21, 2024
…147125)

flutter/engine@40110ec...1ac3ce3

2024-04-20 jonahwilliams@google.com [Impeller] compute UVs in vertex stage. (flutter/engine#52106)

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 jsimmons@google.com,rmistry@google.com,zra@google.com 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
jonahwilliams added a commit to jonahwilliams/engine that referenced this pull request Apr 22, 2024
@jonahwilliams jonahwilliams restored the compute_uv_vertex_stage branch April 22, 2024 21:11
gilnobrega pushed a commit to gilnobrega/flutter that referenced this pull request Apr 22, 2024
…lutter#147125)

flutter/engine@40110ec...1ac3ce3

2024-04-20 jonahwilliams@google.com [Impeller] compute UVs in vertex stage. (flutter/engine#52106)

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 jsimmons@google.com,rmistry@google.com,zra@google.com 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
auto-submit bot pushed a commit that referenced this pull request Apr 23, 2024
Compute texture UVs in the vertex stage. Reland of #52106 which was reverted to investigate golden failures during the x64 to arm64 mac switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
None yet
2 participants