Metal 系列二:GPU Devices--(查询特性)Querying Features

//设备功能集定义特定的平台,硬件和软件配置
enum MTLFeatureSet
The device feature sets that define specific platform, hardware, and software configurations.

//返回一个布尔值,指示设备是否支持特定功能集。
func supportsFeatureSet(MTLFeatureSet) -> Bool
Returns a Boolean value that indicates whether a device supports a particular feature set.

Required.


Metal功能集定义了每个设备的功能可用性,实现限制和像素格式功能:
Table 1

GPU families and their corresponding GPU hardware

GPU family

GPU hardware

iOS GPU family 1:  Apple A7 devices

(iOS GPU family 2、 tvOS GPU family )1  :Apple A8 devices

(iOS GPU family 3、 tvOS GPU family 2 ) Apple A9 devices  Apple A10 devices

iOS GPU family 4  Apple A11 devices

macOS GPU family 1 :

{
iMac Pro models

iMac models from 2012 or later

MacBook models from 2015 or later

MacBook Pro models from 2012 or later

MacBook Air models from 2012 or later

Mac mini models from 2012 or later

Mac Pro models from late 2013
}

macOS GPU family 2 :
{
iMac models from 2015 or later

MacBook Pro models from 2016 or later

MacBook models from 2016 or later

iMac Pro models from 2017 or later
}

For more information on Mac support for Metal, see Mac computers that support Metal.

enum MTLFeatureSet

Feature Sets
case iOS_GPUFamily1_v1
The GPU family 1, version 1 feature set for iOS.

case iOS_GPUFamily1_v2
The GPU family 1, version 2 feature set for iOS.

case iOS_GPUFamily1_v3
The GPU family 1, version 3 feature set for iOS.

case iOS_GPUFamily1_v4
The GPU family 1, version 4 feature set for iOS.

case iOS_GPUFamily1_v5
The GPU family 1, version 5 feature set for iOS.

case iOS_GPUFamily2_v1
The GPU family 2, version 1 feature set for iOS.

case iOS_GPUFamily2_v2
The GPU family 2, version 2 feature set for iOS.

case iOS_GPUFamily2_v3
The GPU family 2, version 3 feature set for iOS.

case iOS_GPUFamily2_v4
The GPU family 2, version 4 feature set for iOS.

case iOS_GPUFamily2_v5
The GPU family 2, version 5 feature set for iOS.

case iOS_GPUFamily3_v1
The GPU family 3, version 1 feature set for iOS.

case iOS_GPUFamily3_v2
The GPU family 3, version 2 feature set for iOS.

case iOS_GPUFamily3_v3
The GPU family 3, version 3 feature set for iOS.

case iOS_GPUFamily3_v4
The GPU family 3, version 4 feature set for iOS.

case iOS_GPUFamily4_v1
The GPU family 4, version 1 feature set for iOS.

case iOS_GPUFamily4_v2
The GPU family 4, version 2 feature set for iOS.

case iOS_GPUFamily5_v1
case tvOS_GPUFamily1_v1
The GPU family 1, version 1 feature set for tvOS.

case tvOS_GPUFamily1_v2
The GPU family 1, version 2 feature set for tvOS.

case tvOS_GPUFamily1_v3
The GPU family 1, version 3 feature set for tvOS.

case tvOS_GPUFamily1_v4
The GPU family 1, version 4 feature set for tvOS.

case tvOS_GPUFamily2_v1
The GPU family 2, version 1 feature set for tvOS.

case tvOS_GPUFamily2_v2
The GPU family 2, version 2 feature set for tvOS.

case macOS_GPUFamily1_v1
The GPU family 1, version 1 feature set for macOS.

case macOS_GPUFamily1_v2
The GPU family 1, version 2 feature set for macOS.

case macOS_GPUFamily1_v3
The GPU family 1, version 3 feature set for macOS.

case macOS_GPUFamily1_v4
The GPU family 1, version 4 feature set for macOS.

case macOS_GPUFamily2_v1
The GPU family 2, version 1 feature set for macOS.

case macOS_ReadWriteTextureTier2
The read-write texture, tier 2 feature set for macOS.


查询功能集是否支持

//返回一个布尔值,指示设备是否支持特定功能集。
func supportsFeatureSet(MTLFeatureSet) -> Bool
Returns a Boolean value that indicates whether a device supports a particular feature set.

Required.


你可能感兴趣的:(Metal,Metal小专栏)