Metal on macOS vs iOS

I am trying to port the simple https://developer.apple.com/library/content/samplecode/MetalDeferredLighting/Introduction/Intro.html iOS sample app to macOS. Metal compiler says Fragment shader parameter with attribute 'color' is supported only on iOS (requires -std=ios-metal1.[0|1|2]). How to overcome this error? Where can I find a document that points out the Metal API differences between macOS and iOS?

Replies

This sample uses read from the color buffer to perform programmable blending. Programmable blending is only supported on iOS GPUs due to theirs unque tile based architectures. Without significant modifications, you can't get this running on macOS.


Programmable blending allows you to perform G-Buffer rendering and the lighting in a single render pass, which is a particulalry important for iOS GPUs as each render pass consumes the limited amout of bandwidth avaliable to these GPUs. A standard deferred renderer, that you'd see on macOS, would break G-Buffer creation and lignting rendering into 2 passes (and using additional render passes is not particularly costly on any of the macOS GPUs).