Proper MTKView MTLPixelFormat for P3 Mac screens

For running my app on devices with P3 screens, to take advantage of the P3 colors, which MTLPixelFormat is the proper one to use for my MTKView? My app is for iOS, but it’s nice to be able to debug on the simulator or as a Catalyst app.

Right now, I’ve been using MTLPixelFormatBGR10_XR_sRGB and MTLPixelFormatBGRA10_XR_sRGB per the recommendation in WWDC 2016 session 605 for iOS support of P3 color. This appears to work fine on iOS devices, but on my Apple silicon Mac, when running as a Catalyst app, the colors sometimes look lighter than they should, but it doesn’t always happen. When I run in the simulator on this Mac, my app crashes. When I was using an Intel Mac (with an sRGB screen), I was having my app render in sRGB-only with MTLPixelFormat.bgra8Unorm. MTLPixelFormat.bgra8Unorm also works fine on my Apple silicon Mac, but of course, I’m not getting the P3 color space. 

For Apple Silicon Macs, as the GPU hardware is more like an iOS device than like an Intel Mac, should the same pixel formats work on an Apple silicon Mac as on iOS devices? Or are the pixel formats that work with Apple Silicon Macs the same as those on Intel Macs?

Replies

Hi macuser1984,

We would like to investigate this problem in more detail. Would you be able to file a Feedback Assistant ticket with a reproducing project or program? Please remember to post back the ticket number here and I can help route it to the appropriate team.

  • Submitted feedback FB9766482. The issues I'm seeing with the colors appearing too light may be due to other issues in my app with the colors getting set out of range, but the simulator crash occurs no matter what. More info is in the feedback submission and its attached Xcode project. Thanks for taking a look at this issue!

  • Thank you macuser1984! I've notified the corresponding team so they can investigate.

Add a Comment