Skip to content

[Impeller] Shader render upside down using impeller engine with OpenGLES backend #169429

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

Open
laishere opened this issue May 25, 2025 · 2 comments
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. found in release: 3.32 Found to occur in 3.32 found in release: 3.33 Found to occur in 3.33 has reproducible steps The issue has been confirmed reproducible and is ready to work on team-engine Owned by Engine team

Comments

@laishere
Copy link

laishere commented May 25, 2025

Steps to reproduce

  1. Clone repo: https://github.com/laishere/impeller_upside_down
  2. Run the app on android (I tested the result on android-arm64 emulator API 30)

Expected results

The texture should be rendered correctly.

Actual results

The texture is rendered upside down on y axis.

Code sample

Check the demo repo.

Screenshots or Video

Screenshots / Video demonstration

Logs

Logs
E/flutter (24330): [ERROR:flutter/impeller/toolkit/egl/egl.cc(56)] EGL Error: Success (12288) in ../../../flutter/impeller/toolkit/egl/display.cc:161
I/flutter (24330): [IMPORTANT:flutter/shell/platform/android/android_context_gl_impeller.cc(94)] Using the Impeller rendering backend (OpenGLES).

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.32.0, on macOS 15.5 24F74 darwin-arm64, locale
    zh-Hans-CN) [1,772ms]
    • Flutter version 3.32.0 on channel stable at /Users/laishere/sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision be698c48a6 (6 days ago), 2025-05-19 12:59:14 -0700
    • Engine revision 1881800949
    • Dart version 3.8.0
    • DevTools version 2.45.1

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
    [3.1s]
    • Android SDK at /Users/laishere/sdk/Android
    • Platform android-35, build-tools 35.0.1
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on
      this machine.
      To manually set the JDK path, use: `flutter config
      --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 16.1) [1,796ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    ✗ CocoaPods not installed.
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      For installation instructions, see
      https://guides.cocoapods.org/using/getting-started.html#installation

[✓] Chrome - develop for the web [8ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2) [7ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)

[✓] VS Code (version 1.100.2) [6ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.110.0

[✓] Connected device (4 available) [6.0s]
    • sdk gphone arm64 (mobile) • emulator-5554             • android-arm64  •
      Android 11 (API 30) (emulator)
    • la iPhone (mobile)        • 00008140-000935E00CF1801C • ios            •
      iOS 18.5 22F76
    • macOS (desktop)           • macos                     • darwin-arm64   •
      macOS 15.5 24F74 darwin-arm64
    • Chrome (web)              • chrome                    • web-javascript •
      Google Chrome 136.0.7103.114

[✓] Network resources [1,173ms]
    • All expected network resources are available.
@laishere
Copy link
Author

laishere commented May 25, 2025

Shader code copied from https://docs.flutter.dev/ui/design/graphics/fragment-shaders#samplers

https://github.com/laishere/impeller_upside_down/blob/main/shaders/test.frag

#include <flutter/runtime_effect.glsl>

uniform vec2 uSize;
uniform sampler2D uTexture;

out vec4 fragColor;

void main() {
  vec2 uv = FlutterFragCoord().xy / uSize;
  fragColor = texture(uTexture, uv);
}

A related and resolved issue: #163315
But they are different, this issue is about the shader rendering, that issue is about reading image texture out from impeller.

After switching to the skia engine, the result is normal:

diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index a4825f4..ba59f6f 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -30,6 +30,9 @@
         <meta-data
             android:name="flutterEmbedding"
             android:value="2" />
+        <meta-data
+            android:name="io.flutter.embedding.android.EnableImpeller"
+            android:value="false" />
     </application>
Screenshots

Image

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 26, 2025
@darshankawar
Copy link
Member

Thanks for the report. I was able to replicate this using latest stable and master versions. Upon tapping render button, the element is shown upside down.

stable : 3.32.0
master : 3.33.0-1.0.pre.186

@darshankawar darshankawar added engine flutter/engine repository. See also e: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on e: impeller Impeller rendering backend issues and features requests team-engine Owned by Engine team found in release: 3.32 Found to occur in 3.32 found in release: 3.33 Found to occur in 3.33 c: rendering UI glitches reported at the engine/skia or impeller rendering level and removed engine flutter/engine repository. See also e: labels. team-engine Owned by Engine team in triage Presently being triaged by the triage team labels May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. found in release: 3.32 Found to occur in 3.32 found in release: 3.33 Found to occur in 3.33 has reproducible steps The issue has been confirmed reproducible and is ready to work on team-engine Owned by Engine team
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy