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

Using Impeller as a rendering runtime #15

Open
swift-kim opened this issue Aug 10, 2022 · 16 comments
Open

Using Impeller as a rendering runtime #15

swift-kim opened this issue Aug 10, 2022 · 16 comments
Labels
performance Performance-related topics

Comments

@swift-kim
Copy link
Member

swift-kim commented Aug 10, 2022

About Impeller: https://medium.com/flutter/announcing-flutter-3-3-at-flutter-vikings-6f213e068793#8c9a

The code: https://github.com/flutter/engine/tree/main/impeller

Wiki page: https://github.com/flutter/flutter/wiki/Impeller

I don't even currently know how it works, but I'm wondering if Impeller can be enabled for Tizen and how effective it will be on Tizen devices. Apparently the repository has GLES as one of its supported backends.

@swift-kim swift-kim added the performance Performance-related topics label Aug 10, 2022
@swift-kim
Copy link
Member Author

The Android embedder source code (android_surface_gl_impeller.cc and etc.) might help implementing a Tizen renderer that uses Impeller.

@swift-kim
Copy link
Member Author

I temporarily disabled Impeller due to a build error: 0b43118508f2a495a7255c350e6dd2b7f6579172. Please re-enable it for testing.

@swift-kim
Copy link
Member Author

The build error will be fixed by flutter/engine@c294429.

@swift-kim
Copy link
Member Author

Currently blocked by flutter/flutter#112230.

@swift-kim swift-kim transferred this issue from flutter-tizen/engine Dec 13, 2022
@swift-kim swift-kim changed the title Using Impeller as a rendering backend Using Impeller as a rendering runtime Dec 13, 2022
@swift-kim
Copy link
Member Author

Vulkan for Impeller has been disabled on engine build: flutter-tizen/engine@02e4b7b. Need to re-enable by applying these patches if you're going to work on it.

I couldn't find a way to override vulkan_use_x11 without modification to the buildroot. (I tried declaring vulkan_use_x11 using declare_args and passing as a GN argument but it didn't have any effect.)

@swift-kim
Copy link
Member Author

Impeller build now requires glibc 2.30 (Tizen 6.0). glibc 2.24 (Tizen 5.5) is not compatible:

In file included from ../../flutter/impeller/core/shader_types.cc:5:
In file included from ../../flutter/impeller/core/shader_types.h:15:
../../flutter/impeller/geometry/half.h:19:22: error: _Float16 is not supported on this target
using InternalHalf = _Float16;
                     ^
1 error generated.

I'll add a temporary workaround to bypass the error.

@swift-kim
Copy link
Member Author

The Impeller support for desktop platforms has landed to the embedder API:

I think we can now start evaluating Impeller on Tizen using the OpenGL backend. cc @haesik

@jonahwilliams
Copy link

We don't currently recommend shipping production applications with the OpenGL backend.

@xuelian-bai
Copy link

It's possible to enable vulkan backend on Tizen, we need time to investigate about impeller

@JSUYA
Copy link
Member

JSUYA commented May 28, 2024

These patches are for running the impeller that @xiaowei-guan worked on in the 3.21 candidate branch.
engine : https://github.com/xiaowei-guan/engine/commits/flutter-3.21-candidate.10/
embedder : https://github.com/xiaowei-guan/embedder/commits/flutter-3.21-candidate.10/
+) JSUYA@f593694
flutter-tizen : https://github.com/xiaowei-guan/flutter-tizen/commits/3.21-candidate.10/

We can discuss these patches once 3.22 migration is completed.
If there is anything we would like to discuss before a PR for the above patch is created, we can do so on this page.

@JSUYA
Copy link
Member

JSUYA commented May 28, 2024

@xiaowei-guan
When i tested impeller, there was no problem with video_player running even without using ExternalTextureWithType.
Are there any cases where ExternalTextureWithType must be used?

If you really need ExternalTextureWithType ...
I am concerned about putting platform specific code in embedder.h because it will affect future migration.
Can you separate the EmbedderExternalTextureGLImpellerSurface(/PixelBuffer) in and embedder_external_texture_gl.h. and differentiate them at the gn level? How about adding embedder_tizen.h?

@xiaowei-guan
Copy link
Contributor

@xiaowei-guan When i tested impeller, there was no problem with video_player running even without using ExternalTextureWithType. Are there any cases where ExternalTextureWithType must be used?

If you really need ExternalTextureWithType ... I am concerned about putting platform specific code in embedder.h because it will affect future migration. Can you separate the EmbedderExternalTextureGLImpellerSurface(/PixelBuffer) in and embedder_external_texture_gl.h. and differentiate them at the gn level? How about adding embedder_tizen.h?

Hello, @JSUYA

When i tested impeller, there was no problem with video_player running even without using ExternalTextureWithType.
Are there any cases where ExternalTextureWithType must be used?

Embedder create different texture based on the ExternalTextureWithType for impeller, we can refer to this
https://github.com/xiaowei-guan/engine/blob/flutter-3.21-candidate.10/shell/platform/embedder/embedder_external_texture_resolver.cc#L30-L37
because Impeller encapsulates the OpenGL interface in impeller::TextureGLES class, so embedder need call different API
according to ExternalTextureWithType .

If you really need ExternalTextureWithType ...
I am concerned about putting platform specific code in embedder.h because it will affect future migration.

yes, we can move all these code to embedder_tizen.h first. Later we can redesign the interface to fit Tizen and other platform.

Can you separate the EmbedderExternalTextureGLImpellerSurface(/PixelBuffer) in and embedder_external_texture_gl.h. and differentiate them at the gn level?

I think we can separate the EmbedderExternalTextureGLImpellerSurface(/PixelBuffer), but can't differentiate them at the gn level.

@xiaowei-guan
Copy link
Contributor

flutter/flutter#143809

@jonahwilliams
Copy link

We don't have either Vulkan or GLES fully wired up in the embedder API (contributions welcome!) but if possible, I would recommend using Vulkan where supported. Almost all of our engineering effort is going into Metal and Vulkan support, whereas GLES is intended to be the broadly supported compatibility backend that isn't necessarily the most performant.

@xiaowei-guan
Copy link
Contributor

xiaowei-guan commented Oct 29, 2024

[Impeller] add basic Impeller+Vulkan support to embedder API.

@xiaowei-guan
Copy link
Contributor

[Impeller] implement external texture gl for embedder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance-related topics
Projects
None yet
Development

No branches or pull requests

5 participants