您的位置:首页 > 移动开发 > IOS开发

OpenGL ES iOS Device Hardware GPU Information

2015-08-07 06:33 597 查看


Hardware GPU Information

Since the introduction of the original iPhone, Apple has continued to improve the GPU capabilities in new iOS devices. When you write a Metal or OpenGL ES app, you need to understand the specific limits of each device you app runs on. Currently, two distinct
GPU categories are in common use:

The Apple A7 and A8 GPUs

The PowerVR SGX 543 and 554 GPUs

Table 2-1 lists the devices that are compatible with Metal and OpenGL ES 3.0.

Table 2-1 Metal and OpenGL ES 3.0 compatible devices

Device name
GPU
iPad Air 2 Wi-Fi

iPad Air 2 Wi-Fi + Cellular
Apple A8 GPU
iPad mini 3 Wi-Fi

iPad mini 3 Wi-Fi + Cellular
Apple A7 GPU
iPhone 6 and iPhone 6 Plus
Apple A8 GPU
iPhone 5s
Apple A7 GPU
iPad Air Wi-Fi

iPad Air Wi-Fi + Cellular
Apple A7 GPU
iPad mini 2 Wi-Fi

iPad mini Wi-Fi + Cellular
Apple A7 GPU
Table 2-2 lists the devices that are compatible with OpenGL ES 2.0.

Table 2-2 OpenGL ES 2.0 compatible devices

Device name
GPU
iPad Air 2 Wi-Fi

iPad Air 2 Wi-Fi + Cellular
Apple A8 GPU
iPad mini 3 Wi-Fi

iPad mini 3 Wi-Fi + Cellular
Apple A7 GPU
iPhone 6 and iPhone 6 Plus
Apple A8 GPU
iPhone 5s
Apple A7 GPU
iPhone 4s, iPhone 5, iPhone 5c
SGX 543
iPhone 3GS, iPhone 3GS (China), and iPhone 4
SGX 535
iPad Air Wi-Fi and iPad Air Wi-Fi + Cellular
Apple A7 GPU
iPad Wi-Fi (4th generation) and iPad Wi-Fi + Cellular (4th generation)
SGX 554
iPad 2 Wi-Fi, iPad 2 Wi-Fi + 3G, iPad Wi-Fi (3rd generation), and iPad Wi-Fi + Cellular (3rd generation)
SGX 543
iPad mini 2 Wi-Fi and iPad mini 2 Wi-Fi + Cellular
Apple A7 GPU
iPad mini Wi-Fi and iPad mini Wi-Fi + Cellular
SGX 543
iPad Wi-Fi and iPad Wi-Fi + 3G
SGX 535
iPod Touch (5th generation)
SGX 543
iPod Touch (3rd and 4th generations)
SGX 535


Apple A7 and A8 GPU Hardware

Together, the Apple A7 and A8 GPUs create a new generation of graphics hardware that support both Metal and OpenGL ES 3.0. To get the most out of a 3D, graphics-dominated app running on the A7 and A8 GPUs, use
Metal. Metal provides extremely low-overhead access to the A7 and A8 GPUs, enabling incredibly high performance for your sophisticated graphics rendering and computational tasks. Metal eliminates many performance bottlenecks—such as costly state validation—that
are found in traditional graphics APIs. If you do not want to use Metal, use OpenGL ES 3.0 when building an app. Both Metal and OpenGL ES 3.0 incorporate many new features, such as multiple render targets and transform feedback, that have not been available
on mobile processors before. This means that advanced rendering techniques that have previously been available only on desktop machines, such as deferred rendering, can now be used in iOS apps. See Metal
Programming Guide for more information about what features are visible to Metal apps.
To take advantage of the power of the A7 and A8 GPUs, your app must support Metal or OpenGL ES 3.0. Using Metal or OpenGL ES 3.0 gives you access to the new features and also to a larger pool of rendering resources.
For example, on the A7 and A8 GPUs, an app that uses Metal or OpenGL ES 3.0 can access twice as many textures in a shader than an app that uses OpenGL ES 2.0.


Best Practices for OpenGL ES 3.0

These practices apply to OpenGL ES apps on Apple A7 and A8 GPU hardware:

Avoid operations that modify OpenGL ES objects already in use by the renderer because of previously submitted drawing commands. When you need to modify OpenGL ES resources, schedule those
modifications at the beginning or end of a frame. These commands include
glBufferSubData
,
glBufferData
,
glMapBuffer
,
glTexSubImage
,
glCopyTexImage
,
glCopyTexSubImage
,
glReadPixels
,
glBindFramebuffer
,
glFlush
,
and
glFinish
.

Follow the drawing guidelines found in Do
Not Sort Rendered Objects Unless Necessary in OpenGL
ES Programming Guide for iOS.

When possible, your renderbuffer’s height and width should be a multiple of 32 pixels.


OpenGL ES 3.0 on Apple A7 and A8 GPUs

Table 2-3 provides a high-level summary for OpenGL ES 3.0.

Table 2-3 OpenGL ES 3.0 attribute values implemented for the Apple A7 and A8 GPUs

OpenGL ES 3.0 attributes
Values for A7 and A8 GPUs
MAX_TEXTURE_SIZE, MAX_RENDERBUFFER_SIZE, MAX_CUBE_MAP_TEXTURE_SIZE
4096 x 4096
MAX_ARRAY_TEXTURE_LAYERS
2048
MAX_COLOR_ATTACHMENTS
4
MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS
50048
MAX_COMBINED_TEXTURE_IMAGE_UNITS
32
MAX_COMBINED_UNIFORM_BLOCKS
24
MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS
51200
MAX_DRAW_BUFFERS
4
MAX_FRAGMENT_INPUT_COMPONENTS
64
MAX_FRAGMENT_UNIFORM_BLOCKS
12
MAX_FRAGMENT_UNIFORM_COMPONENTS
896
MIN_PROGRAM_TEXEL_OFFSET
-8
MAX_PROGRAM_TEXEL_OFFSET
7
MAX_SAMPLES
8
MAX_TEXTURE_IMAGE_UNITS
16
MAX_TRANSFORM_FEEDBACK_INTERLE***ED_COMPONENTS
64
MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
4
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
4
MAX_VARYING_VECTORS
15
MAX_VERTEX_ATTRIBS
16
MAX_VERTEX_OUTPUT_COMPONENTS
64
MAX_VERTEX_TEXTURE_IMAGE_UNITS
16
MAX_VERTEX_UNIFORM_BLOCKS
12
MAX_VERTEX_UNIFORM_COMPONENTS
2048
MAX_UNIFORM_BLOCK_SIZE
16384


Considerations

The A7 and A8 GPUs process all floating-point calculations using a scalar processor, even when those values are declared in a vector. Proper use of write masks and careful definitions of your calculations can
improve the performance of your shaders. For more information, see Perform
Vector Calculations Lazily in OpenGL
ES Programming Guide for iOS.
Medium- and low-precision floating-point shader values are computed identically, as 16-bit floating point values. This is a change from the PowerVR SGX hardware, which used 10-bit fixed-point format for low-precision
values. If your shaders use low-precision floating point variables and you also support the PowerVR SGX hardware, you must test your shaders on both GPUs.
The Apple A7 and A8 GPUs do not penalize dependent-texture fetches.
Always use framebuffer discard operations when your framebuffer contents are no longer needed. The penalty for not doing so is higher than it was on earlier GPUs. For best results, use the
GLKView
class;
it automatically implements framebuffer discard operations.
When rendering to multiple targets, limit your app to four image targets (and no more than 128 bits of total data on A7 and 256 bits of total data on A8 written to the targets). A single
sRGB
target
counts as 64 bits.


Supported OpenGL ES 3.0 Extensions

OpenGL ES 3 includes functionality provided by extensions in Apple’s implementation of OpenGL ES 2.0. If you are updating an existing OpenGL ES 2.0 app to use OpenGL ES 3.0, please note that many of these extensions
are not provided in OpenGL ES 3.0. Therefore, your code must be updated to use the new core functionality instead.
The following extensions are supported for the A7 and A8 GPUs in OpenGL ES 3 apps:

APPLE_clip_distance

APPLE_color_buffer_packed_float

APPLE_copy_texture_levels

APPLE_rgb_422

APPLE_texture_format_BGRA8888

EXT_color_buffer_half_float

EXT_debug_label

EXT_debug_marker

EXT_pvrtc_sRGB

EXT_read_format_bgra

EXT_separate_shader_objects

EXT_shader_framebuffer_fetch

EXT_texture_filter_anisotropic

IMG_read_format

IMG_texture_compression_pvrtc

The A8 GPU supports the following additional extension: GL_KHR_texture_compression_astc_ldr.
The following extensions are supported, but OpenGL ES 3 provides core functionality that matches these extensions. If you are porting an OpenGL ES 2 app that uses these extensions, you should migrate your shaders
to the core OpenGL ES 3 functionality.

EXT_shader_texture_lod

EXT_shadow_samplers

OES_standard_derivatives


OpenGL ES 2.0 on Apple A7 and A8 GPUs

Table 2-4 provides a high-level summary for OpenGL ES 2.0.

Table 2-4 OpenGL ES 2.0 attribute values implemented for the Apple A7 and A8 GPUs

OpenGL ES 2.0 attributes
Values for A7 and A8 GPUs
MAX_TEXTURE_SIZE, MAX_RENDERBUFFER_SIZE, MAX_CUBE_MAP_TEXTURE_SIZE
4096 x 4096
MAX_TEXTURE_IMAGE_UNITS
8
MAX_COMBINED_TEXTURE_IMAGE_UNITS
8
MAX_VERTEX_TEXTURE_IMAGE_UNITS
8
MAX_VERTEX_ATTRIBS
16
MAX_VERTEX_UNIFORM_VECTORS
128
MAX_FRAGMENT_UNIFORM_VECTORS
64
MAX_VARYING_VECTORS
8


Considerations

The A7 and A8 GPUs process all floating-point calculations using a scalar processor, even when those values are declared in a vector. Proper use of write masks and careful definitions of your calculations can
improve the performance of your shaders. For more information, see Perform
Vector Calculations Lazily in OpenGL
ES Programming Guide for iOS.
Medium- and low-precision floating-point shader values are computed identically, as 16-bit floating point values. This is a change from the PowerVR SGX hardware, which used 10-bit fixed-point format for low-precision
values. If your shaders use low-precision floating point variables and you also support the PowerVR SGX hardware, you must test your shaders on both GPUs.
The Apple A7 and A8 GPUs do not penalize dependent-texture fetches.
Always use framebuffer discard operations when your framebuffer contents are no longer needed. The penalty for not discarding framebuffers is higher than it was on earlier GPUs. For best results, use the
GLKView
class;
it automatically implements framebuffer discard operations.


Supported OpenGL ES 2.0 Extensions

The following extensions are supported for the Apple A7 and A8 GPUs:

APPLE_clip_distance

APPLE_color_buffer_packed_float

APPLE_copy_texture_levels

APPLE_framebuffer_multisample

APPLE_rgb_422

APPLE_sync

APPLE_texture_format_BGRA8888

APPLE_texture_max_level

APPLE_texture_packed_float

EXT_blend_minmax

EXT_color_buffer_half_float

EXT_debug_label

EXT_debug_marker

EXT_discard_framebuffer

EXT_draw_instanced

EXT_instanced_arrays

EXT_map_buffer_range

EXT_occlusion_query_boolean

EXT_pvrtc_sRGB

EXT_read_format_bgra

EXT_separate_shader_objects

EXT_shader_texture_lod

EXT_shader_framebuffer_fetch

EXT_shadow_samplers

EXT_sRGB

EXT_texture_filter_anisotropic

EXT_texture_rg

EXT_texture_storage

IMG_read_format

IMG_texture_compression_pvrtc

OES_depth_texture

OES_depth24

OES_element_index_uint

OES_fbo_render_mipmap

OES_mapbuffer

OES_packed_depth_stencil

OES_rgb8_rgba8

OES_standard_derivatives

OES_texture_float

OES_texture_half_float

OES_texture_half_float_linear

OES_vertex_array_object


PowerVR SGX Hardware

Imagination Technologies has several useful references about PowerVR technologies:

PowerVR
SGX OpenGL ES2.0 Application Development Recommendations. Introduces the SGX Series of processors and describes how to optimize for them.

PowerVR
3D Application Development Recommendations. Introduces 3D graphics apps and provides some “golden rules” for developing such apps.

Imagination
Technologies home page.


Best Practices for OpenGL ES 2.0

These practices apply to OpenGL ES apps on SGX Series 5 hardware:

Avoid operations that modify OpenGL ES objects already in use by the renderer because of previously submitted drawing commands. When you need to modify OpenGL ES resources, schedule those
modifications at the beginning or end of a frame. These commands include
glBufferSubData
,
glBufferData
,
glMapBuffer
,
glTexSubImage
,
glCopyTexImage
,
glCopyTexSubImage
,
glReadPixels
,
glBindFramebuffer
,
glFlush
,
and
glFinish
.

To take advantage of the processor’s hidden surface removal, follow the drawing guidelines found in Do
Not Sort Rendered Objects Unless Necessary inOpenGL
ES Programming Guide for iOS.

Vertex buffer objects (VBOs) provide a significant performance improvement on the PowerVR SGX. See Use
Vertex Buffer Objects to Manage Copying Vertex Data in OpenGL
ES Programming Guide for iOS.

Use Core Animation rotations of renderbuffers to rotate content between landscape and portrait mode. For best performance, ensure that the renderbuffer’s height and width are each a multiple
of 32 pixels.


OpenGL ES 2.0 on PowerVR SGX Series 5 Hardware

Table 2-5 provides a high-level summary for OpenGL ES 2.0 platforms.

Table 2-5 OpenGL ES 2.0 attribute values implemented for SGX 543 and 554

OpenGL ES 2.0 attributes
Values for SGX 543 and 554
MAX_TEXTURE_SIZE, MAX_RENDERBUFFER_SIZE, MAX_CUBE_MAP_TEXTURE_SIZE
4096 x 4096
MAX_TEXTURE_IMAGE_UNITS
8
MAX_COMBINED_TEXTURE_IMAGE_UNITS
8
MAX_VERTEX_TEXTURE_IMAGE_UNITS
8
MAX_VERTEX_ATTRIBS
16
MAX_VERTEX_UNIFORM_VECTORS
128
MAX_FRAGMENT_UNIFORM_VECTORS
64
MAX_VARYING_VECTORS
8


Considerations

The PowerVR SGX processes high-precision floating-point calculations using a scalar processor, even when those values are declared in a vector. Proper use of write masks and careful definitions of your calculations
can improve the performance of your shaders. For more information, see Perform
Vector Calculations Lazily in OpenGL
ES Programming Guide for iOS.
Although medium- and low-precision floating-point values are both processed in parallel, low-precision variables have a few specific performance limitations:

Swizzling components of vectors declared with low precision is expensive and should be avoided.

Many built-in functions use medium-precision inputs and outputs. If your app provides low-precision floating-point values as parameters or assigns the results to a low-precision floating-point
variable, the shader may have to include additional instructions to convert the values. These additional instructions are also added when swizzling the vector results of a computation.

For best results, limit your use of low-precision variables to color values.


Supported OpenGL ES 2.0 Extensions

The following extensions are supported for all SGX Series 5 processors: 543 and 554:

APPLE_copy_texture_levels

APPLE_framebuffer_multisample

APPLE_rgb_422

APPLE_texture_format_BGRA8888

APPLE_texture_max_level

APPLE_sync

EXT_blend_minmax

EXT_debug_label

EXT_debug_marker

EXT_discard_framebuffer

EXT_draw_instanced

EXT_instanced_arrays

EXT_map_buffer_range

EXT_separate_shader_objects

EXT_shader_framebuffer_fetch

EXT_read_format_bgra

EXT_shader_texture_lod

EXT_texture_filter_anisotropic

EXT_texture_storage

IMG_read_format

IMG_texture_compression_pvrtc

OES_depth24

OES_depth_texture

OES_element_index_uint

OES_fbo_render_mipmap

OES_mapbuffer

OES_packed_depth_stencil

OES_rgb8_rgba8

OES_standard_derivatives

OES_texture_half_float

OES_texture_float

OES_texture_half_float

OES_vertex_array_object

The following extensions are supported for the SGX 543 and 554 processors only:

EXT_color_buffer_half_float

EXT_occlusion_query_boolean

EXT_pvrtc_sRGB

EXT_shadow_samplers

EXT_sRGB

EXT_texture_rg

OES_texture_half_float_linear
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: