I see that a combination of Apple GPU HW and iOS/MacOS version determines a feature set. I can query which feature set my MTLDevice supports using below swift snippet.
device.supportsFeatureSet(MTLFeatureSet.osx_GPUFamily1_v1)
I still need to refer the table in the below link to get the individual feature limitations.
Is there a way to know this programmatically? For example, know how many colorAttachments are supported per renderPass?
No, there is no API to query the hardware and software limits of a given device.