Metal Feature Set Tables
2015-11-04 14:38
721 查看
This chapter describes the features, limits, and capabilities of the Metal feature sets.
Each Metal feature set is tied to a specific OS and GPU (or Mac model), as listed in Table 9-1. Query the
with a valid
to find out if a specific feature set is supported by a
Table 9-1 Metal feature sets by OS and GPU
Table 9-2 lists the availability of major Metal features. For specific API availability information, see
the Metal Framework Reference.
Table 9-2 Feature availability
Table 9-3 lists the hardware and/or software limits throughout the Metal framework.
Note: For any listed entry in Table 9-3, a ‘—’ indicates that
the feature corresponding to the limit is not available in that specific feature set.
Table 9-3 Limits
The tables in this section list and categorize pixel format support and capabilities in each GPU family.
Sample indicates whether a texture with that pixel format is filterable during sampling and can generate mipmaps.
Write indicates whether a compute shader can write to a texture that uses that pixel format.
Render indicates whether a texture with that pixel format is color-renderable. A color-renderable texture can be used as a color render target in a
MSAA indicates whether a texture of type
uses that pixel format can be allocated.
Resolve indicates whether a texture of type
uses that pixel format can perform a multisample resolve. An MSAA-resolve texture can be used for the
of a render target with the
action.
Blend indicates whether a texture with that pixel format is blendable. A blendable texture can be used in a blend operation if the value of
Note: For any listed entry in Table 9-4 through Table
9-16, a ‘—’ indicates that the pixel format is not available in that specific feature set.
Table 9-4 Ordinary 8-bit pixel format capabilities
Table 9-5 Ordinary 16-bit pixel format capabilities
Table 9-6 Packed 16-bit pixel format capabilities
Table 9-7 Ordinary 32-bit pixel format capabilities
Table 9-8 Packed 32-bit pixel format capabilities
Table 9-9 Ordinary 64-bit pixel format capabilities
Table 9-10 Ordinary 128-bit pixel format capabilities
Table 9-11 Compressed BC pixel format capabilities
Table 9-12 Compressed PVRTC pixel format capabilities
Table 9-13 Compressed ETC pixel format capabilities
Table 9-14 Compressed ASTC pixel format capabilities
Table 9-15 YUV pixel format capabilities
Table 9-16 Depth and stencil pixel format capabilities
Due to the tile-based rendering architecture of iOS GPUs, the contents of render target textures are temporarily cached in tile memory during a render pass. As listed in Table
9-3, this tile memory has a limited size; therefore, the summed size of all the render target pixel formats for a particular render pass must fit within this limit. (16 bytes per pixel in iOS GPU Family 1; 32 bytes per pixel in iOS GPU Family 2
and 3).
Some color-renderable pixel formats are expanded when temporarily stored in tile memory, and consume more space than inferred from their implicit size. In some cases, this size difference is further affected
by whether or not the render target uses MSAA.Table 9-17 describes how much tile memory space each pixel format consumes, in bytes per pixel.
Note: These size differences are not applicable to OS X GPUs; they can accept up to any 8 textures as render targets, regardless of pixel format.
Table 9-17 Color-renderable pixel format sizes
This information is particularly important for multiple render target (MRT) techniques and g-buffer configurations. For example—a deferred shading algorithm might have these four render targets with different
pixel formats:
Diffuse color (
Surface normal (
Linear depth (
Ambient occlusion (
For this MRT configuration, the typical texture memory size total is 16 (8+4+2+2) and should fit within all the iOS feature set limits. However, the non-MSAA render target storage size total is actually 20 (8+4+4+4).
This means that this MRT configuration is only valid for iOS GPU Family 2 and 3; it is not valid for iOS GPU Family 1.
Refer to the values listed in Table
9-3 and Table
9-17 in order to choose appropriate pixel formats for your own MRT configurations.
NextPrevious
This chapter describes the features, limits, and capabilities of the Metal feature sets.
Each Metal feature set is tied to a specific OS and GPU (or Mac model), as listed in Table 9-1. Query the
with a valid
to find out if a specific feature set is supported by a
Table 9-1 Metal feature sets by OS and GPU
Table 9-2 lists the availability of major Metal features. For specific API availability information, see
the Metal Framework Reference.
Table 9-2 Feature availability
Table 9-3 lists the hardware and/or software limits throughout the Metal framework.
Note: For any listed entry in Table 9-3, a ‘—’ indicates that
the feature corresponding to the limit is not available in that specific feature set.
Table 9-3 Limits
The tables in this section list and categorize pixel format support and capabilities in each GPU family.
Sample indicates whether a texture with that pixel format is filterable during sampling and can generate mipmaps.
Write indicates whether a compute shader can write to a texture that uses that pixel format.
Render indicates whether a texture with that pixel format is color-renderable. A color-renderable texture can be used as a color render target in a
MSAA indicates whether a texture of type
uses that pixel format can be allocated.
Resolve indicates whether a texture of type
uses that pixel format can perform a multisample resolve. An MSAA-resolve texture can be used for the
of a render target with the
action.
Blend indicates whether a texture with that pixel format is blendable. A blendable texture can be used in a blend operation if the value of
Note: For any listed entry in Table 9-4 through Table
9-16, a ‘—’ indicates that the pixel format is not available in that specific feature set.
Table 9-4 Ordinary 8-bit pixel format capabilities
Table 9-5 Ordinary 16-bit pixel format capabilities
Table 9-6 Packed 16-bit pixel format capabilities
Table 9-7 Ordinary 32-bit pixel format capabilities
Table 9-8 Packed 32-bit pixel format capabilities
Table 9-9 Ordinary 64-bit pixel format capabilities
Table 9-10 Ordinary 128-bit pixel format capabilities
Table 9-11 Compressed BC pixel format capabilities
Table 9-12 Compressed PVRTC pixel format capabilities
Table 9-13 Compressed ETC pixel format capabilities
Table 9-14 Compressed ASTC pixel format capabilities
Table 9-15 YUV pixel format capabilities
Table 9-16 Depth and stencil pixel format capabilities
Due to the tile-based rendering architecture of iOS GPUs, the contents of render target textures are temporarily cached in tile memory during a render pass. As listed in Table
9-3, this tile memory has a limited size; therefore, the summed size of all the render target pixel formats for a particular render pass must fit within this limit. (16 bytes per pixel in iOS GPU Family 1; 32 bytes per pixel in iOS GPU Family 2
and 3).
Some color-renderable pixel formats are expanded when temporarily stored in tile memory, and consume more space than inferred from their implicit size. In some cases, this size difference is further affected
by whether or not the render target uses MSAA.Table 9-17 describes how much tile memory space each pixel format consumes, in bytes per pixel.
Note: These size differences are not applicable to OS X GPUs; they can accept up to any 8 textures as render targets, regardless of pixel format.
Table 9-17 Color-renderable pixel format sizes
This information is particularly important for multiple render target (MRT) techniques and g-buffer configurations. For example—a deferred shading algorithm might have these four render targets with different
pixel formats:
Diffuse color (
Surface normal (
Linear depth (
Ambient occlusion (
For this MRT configuration, the typical texture memory size total is 16 (8+4+2+2) and should fit within all the iOS feature set limits. However, the non-MSAA render target storage size total is actually 20 (8+4+4+4).
This means that this MRT configuration is only valid for iOS GPU Family 2 and 3; it is not valid for iOS GPU Family 1.
Refer to the values listed in Table
9-3 and Table
9-17 in order to choose appropriate pixel formats for your own MRT configurations.
NextPrevious
Each Metal feature set is tied to a specific OS and GPU (or Mac model), as listed in Table 9-1. Query the
supportsFeatureSet:method
with a valid
MTLFeatureSetvalue
to find out if a specific feature set is supported by a
MTLDeviceobject.
Apple A7 GPU | Apple A8 GPU | Apple A9 GPU | MacBook (early 2015) MacBook Air (mid 2012 or newer) MacBook Pro (mid 2012 or newer) Mac Mini (late 2012 or newer) iMac (late 2012 or newer) Mac Pro (late 2013 and newer) | |
---|---|---|---|---|
iOS 8 | iOS GPU Family 1 v1 | iOS GPU Family 2 v1 | — | — |
iOS 9 | iOS GPU Family 1 v2 | iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | — |
OS X 10.11 | — | — | — | OS X GPU Family 1 v1 |
Feature Availability
Table 9-2 lists the availability of major Metal features. For specific API availability information, seethe Metal Framework Reference.
Feature | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
MetalKit | ||||
Programmable blending | ||||
PVRTC pixel formats | ||||
ETC pixel formats | ||||
BC pixel formats | ||||
Cube map texture arrays | ||||
Texture barriers | ||||
Layered rendering | ||||
Sampler comparison functions | ||||
Counting occlusion query | ||||
Base vertex/instance drawing | ||||
Indirect drawing | ||||
Indirect processing | ||||
MSAA depth resolve | ||||
ASTC pixel formats | ||||
Metal Performance Shaders |
Limits
Table 9-3 lists the hardware and/or software limits throughout the Metal framework.Note: For any listed entry in Table 9-3, a ‘—’ indicates that
the feature corresponding to the limit is not available in that specific feature set.
Limit | iOS GPU Family 1 v1 | iOS GPU Family 1 v2 | iOS GPU Family 2 v1 | iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|---|---|
Maximum number of vertex attributes per vertex descriptor | 31 | |||||
Maximum number of entries in the buffer argument table, per render or compute command encoder | 31 | |||||
Maximum number of entries in the sampler state argument table, per render or compute command encoder | 16 | |||||
Maximum length of a data block for a function, per render or compute command encoder | 4096 B | |||||
Maximum number of 32-bit components that can be passed from a vertex function to a fragment function | 60 | |||||
Maximum number of texture layers per 1D or 2D texture array | 2048 | |||||
Maximum number of texture layers per 3D texture | 2048 | |||||
Maximum size of a point primitive | 511.0 | |||||
Maximum visibility query offset for setVisibilityResultMode:offset: | 65528 B | |||||
Maximum 3D texture width, height, and depth | 2048 px | |||||
Maximum buffer length | 256 MB | |||||
Maximum number of entries in the texture argument table, per render or compute command encoder | 31 | 128 | ||||
Maximum threads per threadgroup, per call to dispatchThreadgroups:threadsPerThreadgroup: | 512 | 1024 | ||||
Maximum total threadgroup memory allocation, per call tosetThreadgroupMemoryLength:atIndex: | 16 KB | 32 KB | ||||
Minimum buffer offset alignment for a shader or compute function parameter | 4 B | 256 B | ||||
Maximum number of cube maps in a cube map texture array | — | 341 | ||||
Maximum memory allocation for a shader or compute function variable in the constant address space | No limit | 64 KB | ||||
Buffer alignment for creating a new texture from a buffer | 64 B | 16 B | — | |||
Buffer alignment for copying from an existing texture to a buffer | 64 B | 16 B | 256 B | |||
Maximum number of color render targets per render pass descriptor | 4 | 8 | ||||
Maximum total render target size, per pixel, when using multiple color render targets | 16 B | 32 B | No limit | |||
Maximum 1D texture width | 4096 px | 8192 px | 4096 px | 8192 px | 16384 px | |
Maximum 2D texture width and height | 4096 px | 8192 px | 4096 px | 8192 px | 16384 px | |
Maximum cube map texture width and height | 4096 px | 8192 px | 4096 px | 8192 px | 16384 px |
Pixel Format Capabilities
The tables in this section list and categorize pixel format support and capabilities in each GPU family.Sample indicates whether a texture with that pixel format is filterable during sampling and can generate mipmaps.
Write indicates whether a compute shader can write to a texture that uses that pixel format.
Render indicates whether a texture with that pixel format is color-renderable. A color-renderable texture can be used as a color render target in a
MTLRenderPassAttachmentDescriptorobject.
MSAA indicates whether a texture of type
MTLTextureType2DMultisamplethat
uses that pixel format can be allocated.
Resolve indicates whether a texture of type
MTLTextureType2DMultisamplethat
uses that pixel format can perform a multisample resolve. An MSAA-resolve texture can be used for the
resolveTextureproperty
of a render target with the
MTLStoreActionMultisampleResolvestore
action.
Blend indicates whether a texture with that pixel format is blendable. A blendable texture can be used in a blend operation if the value of
blendingEnabledis
YES.
Note: For any listed entry in Table 9-4 through Table
9-16, a ‘—’ indicates that the pixel format is not available in that specific feature set.
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
A8Unorm | Sample | |||
R8Unorm | Sample Write Render MSAA Resolve Blend | |||
R8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | — | |
R8Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
R8Uint | Write Render MSAA | |||
R8Sint | Write Render MSAA |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
R16Unorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
R16Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
R16Uint | Write Render MSAA | |||
R16Sint | Write Render MSAA | |||
R16Float | Sample Write Render MSAA Resolve Blend | |||
RG8Unorm | Sample Write Render MSAA Resolve Blend | |||
RG8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | — | |
RG8Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG8Uint | Write Render MSAA | |||
RG8Sint | Write Render MSAA |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
B5G6R5Unorm | Sample Render MSAA Resolve Blend | — | ||
A1BGR5Unorm | Sample Render MSAA Resolve Blend | — | ||
ABGR4Unorm | Sample Render MSAA Resolve Blend | — | ||
BGR5A1Unorm | Sample Render MSAA Resolve Blend | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
R32Uint | Write Render MSAA | |||
R32Sint | Write Render MSAA | |||
R32Float | Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG16Unorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG16Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG16Uint | Write Render MSAA | |||
RG16Sint | Write Render MSAA | |||
RG16Float | Sample Write Render MSAA Resolve Blend | |||
RGBA8Unorm | Sample Write Render MSAA Resolve Blend | |||
RGBA8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | Sample Render MSAA Resolve Blend | |
RGBA8Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA8Uint | Write Render MSAA | |||
RGBA8Sint | Write Render MSAA | |||
BGRA8Unorm | Sample Write Render MSAA Resolve Blend | |||
BGRA8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | Sample Render MSAA Resolve Blend |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
RGB10A2Unorm | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | ||
RGB10A2Uint | Render MSAA | Write Render MSAA | ||
RG11B10Float | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | ||
RGB9E5Float | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | Sample |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
RG32Uint | Write Render MSAA | |||
RG32Sint | Write Render MSAA | |||
RG32Float | Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA16Unorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA16Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA16Uint | Write Render MSAA | |||
RGBA16Sint | Write Render MSAA | |||
RGBA16Float | Sample Write Render MSAA Resolve Blend |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
RGBA32Uint | Write Render MSAA | |||
RGBA32Sint | Write Render MSAA | |||
RGBA32Float | Write Render MSAA | Sample Write Render MSAA Resolve Blend |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
BC1_RGBA BC1_RGBA_sRGB BC2_RGBA BC2_RGBA_sRGB BC3_RGBA BC3_RGBA_sRGB BC4_RUnorm BC4_RSnorm BC5_RGUnorm BC5_RGSnorm BC6H_RGBFloat BC6H_RGBUfloat BC7_RGBAUnorm BC7_RGBAUnorm_sRGB | — | Sample |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
PVRTC_RGB_2BPP PVRTC_RGB_2BPP_sRGB PVRTC_RGB_4BPP PVRTC_RGB_4BPP_sRGB PVRTC_RGBA_2BPP PVRTC_RGBA_2BPP_sRGB PVRTC_RGBA_4BPP PVRTC_RGBA_4BPP_sRGB | Sample | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
EAC_R11Unorm EAC_R11Snorm EAC_RG11Unorm EAC_RG11Snorm EAC_RGBA8 EAC_RGBA8_sRGB ETC2_RGB8 ETC2_RGB8_sRGB ETC2_RGB8A1 ETC2_RGB8A1_sRGB | Sample | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
ASTC_4x4_sRGB ASTC_5x4_sRGB ASTC_5x5_sRGB ASTC_6x5_sRGB ASTC_6x6_sRGB ASTC_8x5_sRGB ASTC_8x6_sRGB ASTC_8x8_sRGB ASTC_10x5_sRGB ASTC_10x6_sRGB ASTC_10x8_sRGB ASTC_10x10_sRGB ASTC_12x10_sRGB ASTC_12x12_sRGB ASTC_4x4_LDR ASTC_5x4_LDR ASTC_5x5_LDR ASTC_6x5_LDR ASTC_6x6_LDR ASTC_8x5_LDR ASTC_8x6_LDR ASTC_8x8_LDR ASTC_10x5_LDR ASTC_10x6_LDR ASTC_10x8_LDR ASTC_10x10_LDR ASTC_12x10_LDR ASTC_12x12_LDR | — | Sample | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
GBGR422 BGRG422 | Sample |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
Depth32Float | MSAA | MSAA Resolve | Sample MSAA Resolve | |
Stencil8 | MSAA | |||
Depth24Unorm_Stencil8 | — | Sample MSAA Resolve | ||
Depth32Float_Stencil8 | MSAA | MSAA Resolve | Sample MSAA Resolve |
Color-Renderable Pixel Format Sizes
Due to the tile-based rendering architecture of iOS GPUs, the contents of render target textures are temporarily cached in tile memory during a render pass. As listed in Table9-3, this tile memory has a limited size; therefore, the summed size of all the render target pixel formats for a particular render pass must fit within this limit. (16 bytes per pixel in iOS GPU Family 1; 32 bytes per pixel in iOS GPU Family 2
and 3).
Some color-renderable pixel formats are expanded when temporarily stored in tile memory, and consume more space than inferred from their implicit size. In some cases, this size difference is further affected
by whether or not the render target uses MSAA.Table 9-17 describes how much tile memory space each pixel format consumes, in bytes per pixel.
Note: These size differences are not applicable to OS X GPUs; they can accept up to any 8 textures as render targets, regardless of pixel format.
Typical texture memory size | Render target storage size (non-MSAA) | Render target storage size (MSAA) | |||
---|---|---|---|---|---|
Pixel Format | All Feature Sets | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 iOS GPU Family 3 v1 | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 iOS GPU Family 3 v1 |
R8Unorm R8Unorm_sRGB R8Snorm R8Uint R8Sint | 1 | 4 | 4 | ||
R16Unorm R16Snorm R16Uint R16Sint R16Float | 2 | 4 | 4 | ||
RG8Unorm RG8Unorm_sRGB RG8Snorm RG8Uint RG8Sint | 2 | 4 | 4 | ||
B5G6R5Unorm A1BGR5Unorm ABGR4Unorm BGR5A1Unorm | 2 | 4 | 8 | 4 | 8 |
R32Uint R32Sint R32Float | 4 | 4 | 4 | ||
RG16Unorm RG16Snorm RG16Uint RG16Sint RG16Float | 4 | 4 | 4 | ||
RGBA8Unorm | 4 | 4 | 4 | 8 | |
RGBA8Unorm_sRGB RGBA8Snorm | 4 | 4 | 8 | ||
RGBA8Uint RGBA8Sint | 4 | 4 | 4 | ||
BGRA8Unorm | 4 | 4 | 4 | 8 | |
BGRA8Unorm_sRGB | 4 | 4 | 8 | ||
RGB10A2Unorm | 4 | 8 | 8 | ||
RGB10A2Uint | 4 | 4 | 4 | ||
RG11B10Float RGB9E5Float | 4 | 8 | 8 | ||
RG32Uint RG32Sint RG32Float | 8 | 8 | 8 | ||
RGBA16Unorm RGBA16Snorm RGBA16Uint RGBA16Sint RGBA16Float | 8 | 8 | 8 | ||
RGBA32Uint RGBA32Sint RGBA32Float | 16 | 16 | 16 |
pixel formats:
Diffuse color (
RGBA16Unorm)
Surface normal (
RGBA8Unorm)
Linear depth (
R16Float)
Ambient occlusion (
R16Float)
For this MRT configuration, the typical texture memory size total is 16 (8+4+2+2) and should fit within all the iOS feature set limits. However, the non-MSAA render target storage size total is actually 20 (8+4+4+4).
This means that this MRT configuration is only valid for iOS GPU Family 2 and 3; it is not valid for iOS GPU Family 1.
Refer to the values listed in Table
9-3 and Table
9-17 in order to choose appropriate pixel formats for your own MRT configurations.
NextPrevious
This chapter describes the features, limits, and capabilities of the Metal feature sets.
Each Metal feature set is tied to a specific OS and GPU (or Mac model), as listed in Table 9-1. Query the
supportsFeatureSet:method
with a valid
MTLFeatureSetvalue
to find out if a specific feature set is supported by a
MTLDeviceobject.
Apple A7 GPU | Apple A8 GPU | Apple A9 GPU | MacBook (early 2015) MacBook Air (mid 2012 or newer) MacBook Pro (mid 2012 or newer) Mac Mini (late 2012 or newer) iMac (late 2012 or newer) Mac Pro (late 2013 and newer) | |
---|---|---|---|---|
iOS 8 | iOS GPU Family 1 v1 | iOS GPU Family 2 v1 | — | — |
iOS 9 | iOS GPU Family 1 v2 | iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | — |
OS X 10.11 | — | — | — | OS X GPU Family 1 v1 |
Feature Availability
Table 9-2 lists the availability of major Metal features. For specific API availability information, seethe Metal Framework Reference.
Feature | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
MetalKit | ||||
Programmable blending | ||||
PVRTC pixel formats | ||||
ETC pixel formats | ||||
BC pixel formats | ||||
Cube map texture arrays | ||||
Texture barriers | ||||
Layered rendering | ||||
Sampler comparison functions | ||||
Counting occlusion query | ||||
Base vertex/instance drawing | ||||
Indirect drawing | ||||
Indirect processing | ||||
MSAA depth resolve | ||||
ASTC pixel formats | ||||
Metal Performance Shaders |
Limits
Table 9-3 lists the hardware and/or software limits throughout the Metal framework.Note: For any listed entry in Table 9-3, a ‘—’ indicates that
the feature corresponding to the limit is not available in that specific feature set.
Limit | iOS GPU Family 1 v1 | iOS GPU Family 1 v2 | iOS GPU Family 2 v1 | iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|---|---|
Maximum number of vertex attributes per vertex descriptor | 31 | |||||
Maximum number of entries in the buffer argument table, per render or compute command encoder | 31 | |||||
Maximum number of entries in the sampler state argument table, per render or compute command encoder | 16 | |||||
Maximum length of a data block for a function, per render or compute command encoder | 4096 B | |||||
Maximum number of 32-bit components that can be passed from a vertex function to a fragment function | 60 | |||||
Maximum number of texture layers per 1D or 2D texture array | 2048 | |||||
Maximum number of texture layers per 3D texture | 2048 | |||||
Maximum size of a point primitive | 511.0 | |||||
Maximum visibility query offset for setVisibilityResultMode:offset: | 65528 B | |||||
Maximum 3D texture width, height, and depth | 2048 px | |||||
Maximum buffer length | 256 MB | |||||
Maximum number of entries in the texture argument table, per render or compute command encoder | 31 | 128 | ||||
Maximum threads per threadgroup, per call to dispatchThreadgroups:threadsPerThreadgroup: | 512 | 1024 | ||||
Maximum total threadgroup memory allocation, per call tosetThreadgroupMemoryLength:atIndex: | 16 KB | 32 KB | ||||
Minimum buffer offset alignment for a shader or compute function parameter | 4 B | 256 B | ||||
Maximum number of cube maps in a cube map texture array | — | 341 | ||||
Maximum memory allocation for a shader or compute function variable in the constant address space | No limit | 64 KB | ||||
Buffer alignment for creating a new texture from a buffer | 64 B | 16 B | — | |||
Buffer alignment for copying from an existing texture to a buffer | 64 B | 16 B | 256 B | |||
Maximum number of color render targets per render pass descriptor | 4 | 8 | ||||
Maximum total render target size, per pixel, when using multiple color render targets | 16 B | 32 B | No limit | |||
Maximum 1D texture width | 4096 px | 8192 px | 4096 px | 8192 px | 16384 px | |
Maximum 2D texture width and height | 4096 px | 8192 px | 4096 px | 8192 px | 16384 px | |
Maximum cube map texture width and height | 4096 px | 8192 px | 4096 px | 8192 px | 16384 px |
Pixel Format Capabilities
The tables in this section list and categorize pixel format support and capabilities in each GPU family.Sample indicates whether a texture with that pixel format is filterable during sampling and can generate mipmaps.
Write indicates whether a compute shader can write to a texture that uses that pixel format.
Render indicates whether a texture with that pixel format is color-renderable. A color-renderable texture can be used as a color render target in a
MTLRenderPassAttachmentDescriptorobject.
MSAA indicates whether a texture of type
MTLTextureType2DMultisamplethat
uses that pixel format can be allocated.
Resolve indicates whether a texture of type
MTLTextureType2DMultisamplethat
uses that pixel format can perform a multisample resolve. An MSAA-resolve texture can be used for the
resolveTextureproperty
of a render target with the
MTLStoreActionMultisampleResolvestore
action.
Blend indicates whether a texture with that pixel format is blendable. A blendable texture can be used in a blend operation if the value of
blendingEnabledis
YES.
Note: For any listed entry in Table 9-4 through Table
9-16, a ‘—’ indicates that the pixel format is not available in that specific feature set.
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
A8Unorm | Sample | |||
R8Unorm | Sample Write Render MSAA Resolve Blend | |||
R8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | — | |
R8Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
R8Uint | Write Render MSAA | |||
R8Sint | Write Render MSAA |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
R16Unorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
R16Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
R16Uint | Write Render MSAA | |||
R16Sint | Write Render MSAA | |||
R16Float | Sample Write Render MSAA Resolve Blend | |||
RG8Unorm | Sample Write Render MSAA Resolve Blend | |||
RG8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | — | |
RG8Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG8Uint | Write Render MSAA | |||
RG8Sint | Write Render MSAA |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
B5G6R5Unorm | Sample Render MSAA Resolve Blend | — | ||
A1BGR5Unorm | Sample Render MSAA Resolve Blend | — | ||
ABGR4Unorm | Sample Render MSAA Resolve Blend | — | ||
BGR5A1Unorm | Sample Render MSAA Resolve Blend | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
R32Uint | Write Render MSAA | |||
R32Sint | Write Render MSAA | |||
R32Float | Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG16Unorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG16Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RG16Uint | Write Render MSAA | |||
RG16Sint | Write Render MSAA | |||
RG16Float | Sample Write Render MSAA Resolve Blend | |||
RGBA8Unorm | Sample Write Render MSAA Resolve Blend | |||
RGBA8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | Sample Render MSAA Resolve Blend | |
RGBA8Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA8Uint | Write Render MSAA | |||
RGBA8Sint | Write Render MSAA | |||
BGRA8Unorm | Sample Write Render MSAA Resolve Blend | |||
BGRA8Unorm_sRGB | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | Sample Render MSAA Resolve Blend |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
RGB10A2Unorm | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | ||
RGB10A2Uint | Render MSAA | Write Render MSAA | ||
RG11B10Float | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | ||
RGB9E5Float | Sample Render MSAA Resolve Blend | Sample Write Render MSAA Resolve Blend | Sample |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
RG32Uint | Write Render MSAA | |||
RG32Sint | Write Render MSAA | |||
RG32Float | Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA16Unorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA16Snorm | Sample Write Render MSAA Blend | Sample Write Render MSAA Resolve Blend | ||
RGBA16Uint | Write Render MSAA | |||
RGBA16Sint | Write Render MSAA | |||
RGBA16Float | Sample Write Render MSAA Resolve Blend |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
RGBA32Uint | Write Render MSAA | |||
RGBA32Sint | Write Render MSAA | |||
RGBA32Float | Write Render MSAA | Sample Write Render MSAA Resolve Blend |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
BC1_RGBA BC1_RGBA_sRGB BC2_RGBA BC2_RGBA_sRGB BC3_RGBA BC3_RGBA_sRGB BC4_RUnorm BC4_RSnorm BC5_RGUnorm BC5_RGSnorm BC6H_RGBFloat BC6H_RGBUfloat BC7_RGBAUnorm BC7_RGBAUnorm_sRGB | — | Sample |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
PVRTC_RGB_2BPP PVRTC_RGB_2BPP_sRGB PVRTC_RGB_4BPP PVRTC_RGB_4BPP_sRGB PVRTC_RGBA_2BPP PVRTC_RGBA_2BPP_sRGB PVRTC_RGBA_4BPP PVRTC_RGBA_4BPP_sRGB | Sample | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
EAC_R11Unorm EAC_R11Snorm EAC_RG11Unorm EAC_RG11Snorm EAC_RGBA8 EAC_RGBA8_sRGB ETC2_RGB8 ETC2_RGB8_sRGB ETC2_RGB8A1 ETC2_RGB8A1_sRGB | Sample | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
ASTC_4x4_sRGB ASTC_5x4_sRGB ASTC_5x5_sRGB ASTC_6x5_sRGB ASTC_6x6_sRGB ASTC_8x5_sRGB ASTC_8x6_sRGB ASTC_8x8_sRGB ASTC_10x5_sRGB ASTC_10x6_sRGB ASTC_10x8_sRGB ASTC_10x10_sRGB ASTC_12x10_sRGB ASTC_12x12_sRGB ASTC_4x4_LDR ASTC_5x4_LDR ASTC_5x5_LDR ASTC_6x5_LDR ASTC_6x6_LDR ASTC_8x5_LDR ASTC_8x6_LDR ASTC_8x8_LDR ASTC_10x5_LDR ASTC_10x6_LDR ASTC_10x8_LDR ASTC_10x10_LDR ASTC_12x10_LDR ASTC_12x12_LDR | — | Sample | — |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
GBGR422 BGRG422 | Sample |
Pixel Format | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 | iOS GPU Family 3 v1 | OS X GPU Family 1 v1 |
---|---|---|---|---|
Depth32Float | MSAA | MSAA Resolve | Sample MSAA Resolve | |
Stencil8 | MSAA | |||
Depth24Unorm_Stencil8 | — | Sample MSAA Resolve | ||
Depth32Float_Stencil8 | MSAA | MSAA Resolve | Sample MSAA Resolve |
Color-Renderable Pixel Format Sizes
Due to the tile-based rendering architecture of iOS GPUs, the contents of render target textures are temporarily cached in tile memory during a render pass. As listed in Table9-3, this tile memory has a limited size; therefore, the summed size of all the render target pixel formats for a particular render pass must fit within this limit. (16 bytes per pixel in iOS GPU Family 1; 32 bytes per pixel in iOS GPU Family 2
and 3).
Some color-renderable pixel formats are expanded when temporarily stored in tile memory, and consume more space than inferred from their implicit size. In some cases, this size difference is further affected
by whether or not the render target uses MSAA.Table 9-17 describes how much tile memory space each pixel format consumes, in bytes per pixel.
Note: These size differences are not applicable to OS X GPUs; they can accept up to any 8 textures as render targets, regardless of pixel format.
Typical texture memory size | Render target storage size (non-MSAA) | Render target storage size (MSAA) | |||
---|---|---|---|---|---|
Pixel Format | All Feature Sets | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 iOS GPU Family 3 v1 | iOS GPU Family 1 v1 iOS GPU Family 1 v2 | iOS GPU Family 2 v1 iOS GPU Family 2 v2 iOS GPU Family 3 v1 |
R8Unorm R8Unorm_sRGB R8Snorm R8Uint R8Sint | 1 | 4 | 4 | ||
R16Unorm R16Snorm R16Uint R16Sint R16Float | 2 | 4 | 4 | ||
RG8Unorm RG8Unorm_sRGB RG8Snorm RG8Uint RG8Sint | 2 | 4 | 4 | ||
B5G6R5Unorm A1BGR5Unorm ABGR4Unorm BGR5A1Unorm | 2 | 4 | 8 | 4 | 8 |
R32Uint R32Sint R32Float | 4 | 4 | 4 | ||
RG16Unorm RG16Snorm RG16Uint RG16Sint RG16Float | 4 | 4 | 4 | ||
RGBA8Unorm | 4 | 4 | 4 | 8 | |
RGBA8Unorm_sRGB RGBA8Snorm | 4 | 4 | 8 | ||
RGBA8Uint RGBA8Sint | 4 | 4 | 4 | ||
BGRA8Unorm | 4 | 4 | 4 | 8 | |
BGRA8Unorm_sRGB | 4 | 4 | 8 | ||
RGB10A2Unorm | 4 | 8 | 8 | ||
RGB10A2Uint | 4 | 4 | 4 | ||
RG11B10Float RGB9E5Float | 4 | 8 | 8 | ||
RG32Uint RG32Sint RG32Float | 8 | 8 | 8 | ||
RGBA16Unorm RGBA16Snorm RGBA16Uint RGBA16Sint RGBA16Float | 8 | 8 | 8 | ||
RGBA32Uint RGBA32Sint RGBA32Float | 16 | 16 | 16 |
pixel formats:
Diffuse color (
RGBA16Unorm)
Surface normal (
RGBA8Unorm)
Linear depth (
R16Float)
Ambient occlusion (
R16Float)
For this MRT configuration, the typical texture memory size total is 16 (8+4+2+2) and should fit within all the iOS feature set limits. However, the non-MSAA render target storage size total is actually 20 (8+4+4+4).
This means that this MRT configuration is only valid for iOS GPU Family 2 and 3; it is not valid for iOS GPU Family 1.
Refer to the values listed in Table
9-3 and Table
9-17 in order to choose appropriate pixel formats for your own MRT configurations.
NextPrevious
相关文章推荐
- 【原创教程】JavaScript详解之语法和对象
- .net webform 如何在UserControl里链接css和js
- 在jsp页面传递参数时,后台接收出错,中文乱码,可以使用两次转码后再传给后台
- 样式链接正确却无反应
- Node.js常用命令
- jsp内置对象,及常用方法
- jquery选取除了div之后 含有类名为a的 标签
- bootstrap兼容IE8问题
- 前端复习-02-ajax原生以及jq和跨域方面的应用。
- nice()
- JavaScript:让浏览器全屏显示
- 一个国外大牛写的Extjs4消息提示框
- margin系列问题
- jquery鼠标聚焦
- 记录部件中GetFieldControlByFieldName(字段值样式设置)用法
- jQuery多条件筛选如何实现
- 记录部件中GetFieldControlByFieldName(字段值样式设置)用法
- 关于 javascript原型和继承的讲解
- Jquery选择选择动态添加HTML标签的事件
- Gson将list<对象>转换为Json