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
Fix #9876: MacBook Touch Bar crash / render issues w/ 32bpp graphics #10060
Conversation
eac9b0a
to
1e97ef1
Compare
Match alpha behaviour of ComposeColourRGBA See: OpenTTD/OpenTTD#10060
Match alpha behaviour of ComposeColourRGBA See: OpenTTD#10060
1e97ef1
to
4a7e336
Compare
Match alpha behaviour of ComposeColourRGBA See: OpenTTD#10060
4a7e336
to
ee762c7
Compare
I had another look at the AlphaBlendTwoPixels commit and was able to make the instruction sequences slightly shorter: JGRennison/OpenTTD-patches@8d8765e |
This is great! I've tested these changes and there appears to be no changes to the rendered Touch Bar 👍. I've included that commit in this PR. |
Commit messages need to be fixed. For the |
Match alpha behaviour of ComposeColourRGBA
5b36ca6
to
34438c2
Compare
I have fixed the commit messages. I haven't changed the indentation as that would require formatting the whole file as you've pointed out. |
34438c2
to
f69cf81
Compare
Motivation / Problem
Rendering of the MacBook Touch Bar is incorrect on SSE-based blitters when using 32bpp base graphics and software rendering. The following problems related to Touch Bar rendering have been found:
Blitter_32bppSSE_Base::Encode
)Description
The crash using
32bpp-sse4
is caused by trying to use the animation buffer while not rendering to the screen. Similar toBlitter_40bppAnim::Draw
we need to forward to a non-animatingDraw()
.Blitter_32bppSSE4_Anim
encodes sprites usingBlitter_32bppSSE_Base::Encode
but didn't inherit from a non-animating blitter, so it now inherits fromBlitter_32bppSSE4
to allow callingBlitter_32bppSSE4::Draw
when a non-animated sprite is requested.To fix the incorrect rendering @JGRennison had a look at the alpha channel rendering in the SSE blitters. My original patch (incorrectly) covered over the problems by disabling translucency altogether. The SSE blitters didn't set the alpha values to anything in particular. AlphaBlendTwoPixels are now adjusted so that the alpha output is as expected (i.e. it matches ComposeColourRGBA).
32bpp-simple (reference):
32bpp-sse2 (washed out):
32bpp-ssse3 (black):
32bpp-ssse3 (with fix):
@glx22, @JGRennison and @frosch123 contributed to this PR by debugging and/or blitter / C++ support.
Limitations
?
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.
* The bug fix is important enough to be backported? (label: 'backport requested')This PR affects the NewGRF API? (label 'needs review: NewGRF')PR must be added to API tracker