Conversation
It appears that newer macs have deprecated the ability to render metal windows as rgba, which was the default behavior on older macs even when bgra was requested This is a confusing statement and is not backed up by anything I can find online, but this patch on m1 fixes the display such that the r and b channels are flipped. Candidate for backporting to v3.
Codecov Report
@@ Coverage Diff @@
## master #200 +/- ##
==========================================
- Coverage 92.39% 92.20% -0.19%
==========================================
Files 141 141
Lines 6456 6456
==========================================
- Hits 5965 5953 -12
- Misses 430 440 +10
- Partials 61 63 +2
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
|
Have intel mac. Between master and new branch no change in coloration per expectations. Do not have arm cannot confirm behavior there. |
Implausiblyfun
approved these changes
Apr 9, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On my three OSX (one Intel, two ARM) machines, I've consistently observed that the Intel machine, no matter what we do within the OS driver, expects the pixel data drawn to windows to be RGBA. On ARM it expects BGRA.
I have been unable to find references to others experiencing this. I have also been unable to find anything within metal, glfw, or cocoa that would programmatically expose that the OS is doing this to us. So:
This PR changes
mtldriverto useimage.RGBAif on Intel, and a locally defined copy ofimage.RGBAwith R and B flipped,BGRAwhen on ARM.Re: help wanted:
Do you have a mac? Regardless of whether it is ARM or Intel, please try this branch out to confirm the above suspicion.
Run this command from the repository's root:
cd examples/top-down-shooter-tutorial/6-performance && go run performance.goAnd you should see colors like this:
