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

[Impeller] Add support for external GL textures to TiledTextureContents. #47586

Merged
merged 6 commits into from
Nov 17, 2023

Conversation

bdero
Copy link
Member

@bdero bdero commented Nov 2, 2023

Resolves flutter/flutter#135881.

OES_EGL_image_external only allows CLAMP_TO_EDGE address sampling modes, so emulate the other tiling modes.

@bdero bdero self-assigned this Nov 2, 2023
@jonahwilliams
Copy link
Member

There are extensions we can check for for the remaining tile modes:

We also currently draw the texture with a repeat mode when we add it to the display list. Maybe we should change that to clamp to edge too


// Also, external textures cannot be bound to color filters, so ignore this
// case for now.
FSExternal::BindSAMPLEREXTERNALOESTextureSampler(
Copy link
Member

Choose a reason for hiding this comment

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

I think we cannot actually hit this case with the API we have today (which doesn't allow adding color/image filters directly to external textures) - so perhaps a DCHECK is appropriate.

Copy link
Member Author

Choose a reason for hiding this comment

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

which doesn't allow adding color/image filters directly to external textures

Where is this disallowed? 🤔 There is no separate API for external textures in Aiks.

Copy link
Member

Choose a reason for hiding this comment

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

The optimization only applies to color filters that are on the paint object used in the draw call. External texture API does not accept a paint object so all filters need to be applied by a separate composited later

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I see, you mean how we expose it to plugins/framework. Added a dcheck. We can easily add support later for other customers if requested.

@bdero
Copy link
Member Author

bdero commented Nov 2, 2023

There are extensions we can check for for the remaining tile modes

Since we'll still sometimes need this emulation if supporting all the tiling modes, I think we should add faster paths in a less urgent follow-up.

@jonahwilliams
Copy link
Member

This PR isn't urgent, so take your time 😄

@bdero bdero force-pushed the bdero/tiled-texture-contents-oes branch from 79b8149 to bc43e90 Compare November 2, 2023 23:02
@bdero bdero force-pushed the bdero/tiled-texture-contents-oes branch from da0d242 to 628d0b7 Compare November 14, 2023 02:28
@bdero bdero marked this pull request as ready for review November 14, 2023 02:29
@bdero
Copy link
Member Author

bdero commented Nov 15, 2023

Alright, this should be good to review, although I should probably try running the failing benchmark against it before landing.

@bdero bdero requested a review from jonahwilliams November 15, 2023 04:08
@@ -85,6 +88,19 @@ class MockBlitPass : public BlitPass {
(override));
};

class MockRenderPass : public RenderPass {
Copy link
Member

Choose a reason for hiding this comment

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

nit: unused.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

Overall LGTM, though of course please test on device too.

Also please file issues for the oes tile mode extensions.

@bdero
Copy link
Member Author

bdero commented Nov 17, 2023

Alrighty, I ran the benchmark on device and it didn't crash. Hopefully the builder will stop failing once this rolls in (Linux_android platform_views_scroll_perf_impeller__timeline_summary).

@bdero bdero merged commit 739b2fe into flutter:main Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 17, 2023
…138599)

flutter/engine@5064aef...90c3ada

2023-11-17 skia-flutter-autoroll@skia.org Roll Dart SDK from 12c5efc94edf to 46e8b18047eb (1 revision) (flutter/engine#48168)
2023-11-17 skia-flutter-autoroll@skia.org Roll Skia from c7d2a4933dfa to c8ee25282849 (2 revisions) (flutter/engine#48164)
2023-11-17 dnfield@google.com Only run systrace test on API 29+, avoid building scenario app for 28 (flutter/engine#48163)
2023-11-17 matanlurey@users.noreply.github.com Make `lib/ui/text/...` compatible with `.clang-tidy`. (flutter/engine#48156)
2023-11-17 matanlurey@users.noreply.github.com Make `flow/...` compatible with `.clang_tidy`. (flutter/engine#48148)
2023-11-17 bdero@google.com [Impeller] Add support for external GL textures to TiledTextureContents. (flutter/engine#47586)
2023-11-17 skia-flutter-autoroll@skia.org Roll Dart SDK from 906f23c1cb20 to 12c5efc94edf (1 revision) (flutter/engine#48157)
2023-11-17 skia-flutter-autoroll@skia.org Roll Skia from 762d95ed65e0 to c7d2a4933dfa (1 revision) (flutter/engine#48159)
2023-11-16 1961493+harryterkelsen@users.noreply.github.com [canvaskit] Size the PictureRecorder when calling Scene.toImage (flutter/engine#48142)

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 jonahwilliams@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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Impeller] Linux_android platform_views_scroll_perf_impeller__timeline_summary hitting GL error.
2 participants