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

[impeller] enable framebuffer blit when available #56596

Merged
merged 10 commits into from
Nov 18, 2024

Conversation

gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented Nov 14, 2024

depends on #56573
fixes flutter/flutter#158523

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@gaaclarke gaaclarke changed the title Blitopengles3 [impeller] enable framebuffer blit when available Nov 14, 2024
@gaaclarke
Copy link
Member Author

In the current state, images that are resized are rendered upside down.

@jonahwilliams
Copy link
Member

We need to set the upload intent differently

@jonahwilliams
Copy link
Member

Try changing the coordinate system on the destination texture in the resize.

  texture->SetCoordinateSystem(
      impeller::TextureCoordinateSystem::kUploadFromHost);

@gaaclarke
Copy link
Member Author

Try changing the coordinate system on the destination texture in the resize.

Ugh, that works. I don't like it. It seems wrong editing the destination when blitting to it. Looks like we are doing this elsewhere though.

@@ -92,7 +92,7 @@ AndroidContextGLImpeller::AndroidContextGLImpeller(
}

impeller::egl::ConfigDescriptor desc;
desc.api = impeller::egl::API::kOpenGLES2;
desc.api = impeller::egl::API::kOpenGLES3;
Copy link
Member

Choose a reason for hiding this comment

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

Is this valid to do? Defiintely outside of my wheelhouse. - we do a lot of GLES 2 stuff, do we need to worry about GLES 3 having different semantics?

@chinmaygarde

Copy link
Member

Choose a reason for hiding this comment

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

Nope. That's how you'd do it. ES3 is backwards compatible with the same sematics.

Copy link
Member

Choose a reason for hiding this comment

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

Coolio

@gaaclarke
Copy link
Member Author

There appears to be tests for the software path in ImageDecoderFixtureTest.CanDecodeWithResizes, BlitPassTest.CanResizeTextures for the blit path.

@gaaclarke gaaclarke marked this pull request as ready for review November 15, 2024 18:52
@@ -104,6 +104,15 @@ TEST_F(AndroidContextGLImpellerTest, FallbackForEmulator) {
EXPECT_CALL(
*display,
ChooseConfig(Matcher<ConfigDescriptor>(AllOf(
Field(&ConfigDescriptor::api, impeller::egl::API::kOpenGLES3),
Copy link
Member Author

Choose a reason for hiding this comment

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

@jonahwilliams looks like we could have used these tests for asserting we are asking for a depth buffer. It had been a while since I looked at these.

Copy link
Member

Choose a reason for hiding this comment

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

I thought I did that by adding EGL_DEPTH_SIZE 24 above?

Copy link
Member

Choose a reason for hiding this comment

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

🤷‍♂️

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.

LGTM

@@ -109,6 +109,10 @@ CapabilitiesGLES::CapabilitiesGLES(const ProcTableGLES& gl) {
default_glyph_atlas_format_ = PixelFormat::kR8UNormInt;
}

if (desc->GetGlVersion().major_version >= 3) {
Copy link
Member

Choose a reason for hiding this comment

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

Completely off topic, but we should do a GL version check in ProcTableGLES and reset or not bother to resolve FOR_EACH_IMPELLER_GLES3_PROC methods when we less than ES 3. On older versions of Android, I remember seeing instances where we'd get a function pointer for ES3 functions even on ES2 contexts but those wouldn't work if called.

When I first wrote that bit, I didn't think we'd ever resolve ES3 procs. So its a blind spot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, absolutely agree. I can file an issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gaaclarke
Copy link
Member Author

Drat, the added test is a playground test, but isn't wired up to be a golden test. I'd like to get that addressed so the test is automated.

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #56596 at sha d2fb626

@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 18, 2024
@gaaclarke gaaclarke merged commit 554786c into flutter:main Nov 18, 2024
37 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 18, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 18, 2024
…159093)

flutter/engine@9686de1...766370b

2024-11-18 30870216+gaaclarke@users.noreply.github.com Started only
loading gles3 functions if we have a gles3 context
(flutter/engine#56636)
2024-11-18 30870216+gaaclarke@users.noreply.github.com [impeller] enable
framebuffer blit when available (flutter/engine#56596)
2024-11-18 skia-flutter-autoroll@skia.org Roll Skia from 7594233ff914 to
0b74d5c3eb4f (4 revisions) (flutter/engine#56678)

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 jimgraham@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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 18, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 18, 2024
…159097)

flutter/engine@9686de1...878f593

2024-11-18 chris@bracken.jp EmbedderTest: Extract backend-specific
user_data (flutter/engine#56642)
2024-11-18 skia-flutter-autoroll@skia.org Roll Dart SDK from
ae5111067032 to 625e0a9cb67a (1 revision) (flutter/engine#56679)
2024-11-18 30870216+gaaclarke@users.noreply.github.com Started only
loading gles3 functions if we have a gles3 context
(flutter/engine#56636)
2024-11-18 30870216+gaaclarke@users.noreply.github.com [impeller] enable
framebuffer blit when available (flutter/engine#56596)
2024-11-18 skia-flutter-autoroll@skia.org Roll Skia from 7594233ff914 to
0b74d5c3eb4f (4 revisions) (flutter/engine#56678)

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 jimgraham@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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 18, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 18, 2024
…159097)

flutter/engine@9686de1...878f593

2024-11-18 chris@bracken.jp EmbedderTest: Extract backend-specific
user_data (flutter/engine#56642)
2024-11-18 skia-flutter-autoroll@skia.org Roll Dart SDK from
ae5111067032 to 625e0a9cb67a (1 revision) (flutter/engine#56679)
2024-11-18 30870216+gaaclarke@users.noreply.github.com Started only
loading gles3 functions if we have a gles3 context
(flutter/engine#56636)
2024-11-18 30870216+gaaclarke@users.noreply.github.com [impeller] enable
framebuffer blit when available (flutter/engine#56596)
2024-11-18 skia-flutter-autoroll@skia.org Roll Skia from 7594233ff914 to
0b74d5c3eb4f (4 revisions) (flutter/engine#56678)

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 jimgraham@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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
depends on flutter/engine#56573
fixes flutter#158523

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller platform-android will affect goldens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Impeller] Enable texture to texture blit in OpenGLES 3.0+
3 participants