-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add breaking change notice for OpenGL ES render-to-texture orientation #13419
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
bdero
wants to merge
1
commit into
flutter:main
Choose a base branch
from
bdero:bdero/breaking-change-gles-render-target-orientation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+73
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...ocs/src/content/release/breaking-changes/opengles-render-to-texture-top-down.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --- | ||
| title: OpenGL ES render-to-texture content is stored top-down | ||
| description: >- | ||
| Impeller's OpenGL ES backend now stores render-to-texture content | ||
| top-down, matching Metal and Vulkan, which can affect Flutter GPU | ||
| apps that compensated for the previous bottom-up orientation. | ||
| --- | ||
|
|
||
| {% render "docs/breaking-changes.md" %} | ||
|
|
||
| ## Summary | ||
|
|
||
| Impeller's OpenGL ES backend now stores render-to-texture content | ||
| top-down, the same as the Metal and Vulkan backends. | ||
| A Flutter GPU app that sampled a render-target texture on OpenGL ES and | ||
| added a vertical flip to compensate for the old bottom-up orientation | ||
| now renders that content upside down. | ||
|
|
||
| ## Background | ||
|
|
||
| The OpenGL ES backend previously stored render-to-texture content | ||
| bottom-up, unlike the Metal and Vulkan backends. | ||
| The renderer carried that orientation difference through every texture | ||
| sample as a per-sampler Y-coordinate scale. | ||
| Impeller now absorbs the difference once, at the vertex stage, so | ||
| render-target textures are stored top-down on every backend. | ||
|
|
||
| This change is invisible to the framework and to Flutter's 2D rendering. | ||
| The only surface where application code could observe the old | ||
| orientation is Flutter GPU, the experimental `flutter_gpu` package, | ||
| where an app drives render passes and samples render-target textures | ||
| directly. | ||
|
|
||
| ## Migration guide | ||
|
|
||
| If a Flutter GPU shader flipped the Y coordinate when sampling a | ||
| render-target texture solely to make OpenGL ES match the other backends, | ||
| remove that flip. | ||
| Render-target textures are now top-down on every backend. | ||
|
|
||
| Code before migration: | ||
|
|
||
| ```glsl | ||
| // The flip only compensated for OpenGL ES's bottom-up render targets. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's include the whole preprocessor conditional compilation so people have a better idea of what they'll be looking for. |
||
| uv.y = 1.0 - uv.y; | ||
| frag_color = texture(u_texture, uv); | ||
| ``` | ||
|
|
||
| Code after migration: | ||
|
|
||
| ```glsl | ||
| frag_color = texture(u_texture, uv); | ||
| ``` | ||
|
|
||
| ## Timeline | ||
|
|
||
| Landed in version: not yet released<br> | ||
| In stable release: Not yet | ||
|
|
||
| ## References | ||
|
|
||
| GitHub issue: | ||
|
|
||
| * [Issue 186554][] | ||
|
|
||
| Relevant PR: | ||
|
|
||
| * [PR 186556][] | ||
|
|
||
| [Issue 186554]: {{site.repo.flutter}}/issues/186554 | ||
| [PR 186556]: {{site.repo.flutter}}/pull/186556 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated to reflect that it affects Flutter users using the FragmentShader API, not just Flutter GPU users.