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

[Impeller] Set color attachment pixel format to RGBA on OpenGLES backend #37843

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

ColdPaleLight
Copy link
Member

@ColdPaleLight ColdPaleLight commented Nov 22, 2022

Now on the OpenGLES backend, the pixel format is set to BGRA, but actually ends up internally as GL_RGBA. This does not affect normal rendering logic.

However, when the developers need to copy the Texture to the CPU Buffer through the Blit operation, the developers need to know the pixel format of the Texture, and the pixel format obtained via TextureDescriptor.format is BGRA, but in fact the correct pixel format is RGBA.

This PR will set the color attachment pixel format of the OpenGLES backend to RGBA. I believe this PR works fine for both OpenGLES and Metal, but not sure if it's true for the Vulkan backend as well.

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 Hixie said 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.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

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

LGTM

@ColdPaleLight ColdPaleLight added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 22, 2022
@auto-submit auto-submit bot merged commit 8e458a2 into flutter:main Nov 22, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 23, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 23, 2022
…115891)

* 8e458a2b6 [Impeller] Set color attachment pixel format to RGBA on OpenGLES backend (flutter/engine#37843)

* f75287af0 [Windows] Refactor `PlatformHandler`'s tests (flutter/engine#37820)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…lutter#115891)

* 8e458a2b6 [Impeller] Set color attachment pixel format to RGBA on OpenGLES backend (flutter/engine#37843)

* f75287af0 [Windows] Refactor `PlatformHandler`'s tests (flutter/engine#37820)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#115891)

* 8e458a2b6 [Impeller] Set color attachment pixel format to RGBA on OpenGLES backend (flutter/engine#37843)

* f75287af0 [Windows] Refactor `PlatformHandler`'s tests (flutter/engine#37820)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller needs tests
Projects
No open projects
Archived in project
3 participants