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

Convert 16bit colors to 32bit colors on MetalANGLE/Simulator #7014

Merged
merged 2 commits into from
Nov 15, 2022

Conversation

Berstanio
Copy link
Contributor

Currently the iOS simulator wont work with MetalANGLE in all cases because of kakashidinho/metalangle#68.
This is a first fix for this by converting 16bit colors manually to 32bit colors when running on simulator.
The fix can be confirmed by running the "BitmapFontAtlasRegionTest" test.

The only thing I'm atm unsure is, whether it is wrong to expect a ByteBuffer. But as far as I know, a direct buffer needs to be passed, and all direct Buffer extend from ByteBuffer.

Copy link
Member

@Tom-Ski Tom-Ski left a comment

Choose a reason for hiding this comment

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

Does this problem occur on different macs in the same way? For example M1 vs non M1?

This would also be required to do in the GL30 interfaces too no?

@Berstanio
Copy link
Contributor Author

Does this problem occur on different macs in the same way? For example M1 vs non M1?

I think so, but I can only test on a M1.

This would also be required to do in the GL30 interfaces too no?

You mean e.g. glTexImage3D? Yeah, probably, I oversaw that.

@Tom-Ski
Copy link
Member

Tom-Ski commented Oct 21, 2022

I think so, but I can only test on a M1.

Me too atm, would be good if someone can test to see if this has adverse effects on non M1

You mean e.g. glTexImage3D? Yeah, probably, I oversaw that.

Yeah

@Berstanio
Copy link
Contributor Author

Does this problem occur on different macs in the same way? For example M1 vs non M1?

https://developer.apple.com/documentation/metal/developing_metal_apps_that_run_in_simulator?language=objc
Seems so according to the docs:

"Don't use the following pixel formats: MTLPixelFormatR8Unorm_sRGB, MTLPixelFormatB5G6R5Unorm, MTLPixelFormatA1BGR5Unorm, MTLPixelFormatABGR4Unorm, MTLPixelFormatBGR5A1Unorm, or any XR10 or YUV formats."

- Cache "shouldConvert" check
@obigu
Copy link
Contributor

obigu commented Oct 25, 2022

Tested running BitmapFontAtlasRegionTest on EXCRUCIATINGLY SLOW Intel Mac and it crashes without the PR. With the PR test runs ok (even if it's quite an ugly test).

@Tom-Ski
Copy link
Member

Tom-Ski commented Nov 15, 2022

Ok lets have this in then for now and see how it goes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants