Skip to content

Opengles texture upside-down in ImageFilter.compose golden tests #177611

Closed

Description

@gaaclarke

#177510 introduced a new golden test that draws textures but they are upside down on opengles

affected tests:

  • ComposePaintRuntimeOuter

This may be the same issue as #177317

Adding in the suggest y coordinate swap for opengles fixes ComposePaintRuntimeOuter but breaks ComposePaintRuntimeInner

observed

the textures are upside down on opengles, but right-side-up on vulkan/metal

expected

all backends to render the same thing

Activity

  1. added
    e: impellerImpeller rendering backend issues and features requests
    on Oct 27, 2025
  2. jason-simmons commented on Oct 27, 2025

    @jason-simmons
    Member

    Does this work as intended if the shader adjusts the y-axis direction for OpenGL as described in https://github.com/flutter/flutter/blob/master/engine/src/flutter/lib/ui/painting.dart#L4265?

  3. gaaclarke commented on Oct 27, 2025

    @gaaclarke
    MemberAuthor

    Does this work as intended if the shader adjusts the y-axis direction for OpenGL as described in https://github.com/flutter/flutter/blob/master/engine/src/flutter/lib/ui/painting.dart#L4265?

    No, it doesn't fix it unfortunately. I messed up in the description. I'll update it.

    Without any change ComposePaintRuntimeInner renders right side up, but ComposePaintRuntimeOuter renders upside down.

    Adding the flip like in the linked document fixes ComposePaintRuntimeOuter but flops ComposePaintRuntimeInner.

  4. gaaclarke commented on Oct 27, 2025

    @gaaclarke
    MemberAuthor

    The shader with the documented y flip:

    #include <flutter/runtime_effect.glsl>
    
    uniform vec2 u_size;
    uniform sampler2D u_texture;
    
    out vec4 frag_color;
    
    void main() {
      vec2 uv = FlutterFragCoord().xy / u_size;
    #ifdef IMPELLER_TARGET_OPENGLES
     uv.y = 1.0 - uv.y;
    #endif
      frag_color = texture(u_texture, uv +
        vec2(0.0, 0.1 * sin(FlutterFragCoord().x / u_size.x * 3.14 * 5.0)));
    }
  5. gaaclarke commented on Oct 27, 2025

    @gaaclarke
    MemberAuthor

    The workaround for this is to just use 2 different shaders. One with the y coordinate swap in it, one without it.

  6. self-assigned this
    on Oct 29, 2025
  7. github-actions commented on Nov 13, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

e: impellerImpeller rendering backend issues and features requeststeam-engineOwned by Engine team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions