Arm® Mali™ GPU Best Practices Developer Guide

Version 2.0


Table of Contents

Preface
About this book
Product revision status
Intended audience
Using this book
Additional reading
Feedback
Feedback on this product
Feedback on content
1 Overview
1.1 Before you begin
1.2 The graphics rendering pipeline
2 Optimizing application logic
2.1 Draw call batching best practices
2.2 Draw call culling best practices
2.3 Optimizing the draw call render order
2.4 Avoid using depth prepasses
2.5 OpenGL ES GPU pipelining
2.6 Vulkan GPU pipelining
2.7 Vulkan pipeline synchronization
2.8 Pipelined resource updates
3 CPU Overheads
3.1 Compiling shaders in OpenGL ES
3.2 Pipeline creation in Vulkan
3.3 Allocating memory in Vulkan
3.4 OpenGL ES CPU memory mapping
3.5 Vulkan CPU memory-mapping
3.6 Command pools for Vulkan
3.7 Optimizing command buffers for Vulkan
3.8 Secondary command buffers
3.9 Optimizing descriptor sets and layouts for Vulkan
4 Vertex shading
4.1 Index draw calls
4.2 Index buffer encoding
4.3 Attribute precision
4.4 Attribute layout
4.5 Varying precision
4.6 Triangle density
4.7 Instanced vertex buffers
5 Tessellation, geometry shading, and tiling
5.1 Tessellation
5.2 Geometry shading
5.3 Tiling and effective triangulation
6 Fragment shading
6.1 Efficient render passes with OpenGL ES
6.2 Efficient render passes with Vulkan
6.3 Multisampling for OpenGL ES
6.4 Multisampling for Vulkan
6.5 Multipass rendering
6.6 HDR rendering
6.7 Stencil updates
6.8 Blending
6.9 Transaction elimination
7 Buffers and textures
7.1 Buffer update for OpenGL ES
7.2 Robust buffer access
7.3 Texture sampling performance
7.4 Anisotropic sampling performance
7.5 Texture and sampler descriptors
7.6 sRGB textures
7.7 AFBC textures
8 Compute
8.1 Workgroup sizes
8.2 Shared memory
8.3 Image processing
9 Shader code
9.1 Minimize precision
9.2 Vectorized arithmetic code
9.3 Vectorize memory access
9.4 Manual source code optimization
9.5 Instruction caches
9.6 Uniforms
9.7 Uniform sub-expressions
9.8 Uniform control-flow
9.9 Branches
9.10 Discards
9.11 Atomics
10 System integration
10.1 Using EGL buffer preservation in OpenGL ES
10.2 The Android blob cache size in OpenGL ES
10.3 Optimizing the swapchain surface count for Vulkan
10.4 Optimizing the swapchain surface rotation for Vulkan
10.5 Optimizing swapchain semaphores for Vulkan
10.6 Window buffer alignment
A Revisions
A.1 Revisions

Release Information

Document History
Issue Date Confidentiality Change
0100-00 27 October 2017 Non-Confidential First release of version 1.0
0100-00 30 June 2019 Non-Confidential First release of version 1.1
0200-00 30 October 2019 Non-Confidential First release of version 2.0

Non-Confidential Proprietary Notice

This document is protected by copyright and other related rights and the practice or implementation of the information contained in this document may be protected by one or more patents or pending patent applications. No part of this document may be reproduced in any form by any means without the express prior written permission of Arm. No license, express or implied, by estoppel or otherwise to any intellectual property rights is granted by this document unless specifically stated.

Your access to the information in this document is conditional upon your acceptance that you will not use or permit others to use the information for the purposes of determining whether implementations infringe any third party patents.

THIS DOCUMENT IS PROVIDED “AS IS”. ARM PROVIDES NO REPRESENTATIONS AND NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE DOCUMENT. For the avoidance of doubt, Arm makes no representation with respect to, and has undertaken no analysis to identify or understand the scope and content of, third party patents, copyrights, trade secrets, or other rights.

This document may include technical inaccuracies or typographical errors.

TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL ARM BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF ARM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

This document consists solely of commercial items. You shall be responsible for ensuring that any use, duplication or disclosure of this document complies fully with any relevant export laws and regulations to assure that this document or any portion thereof is not exported, directly or indirectly, in violation of such export laws. Use of the word “partner” in reference to Arm’s customers is not intended to create or refer to any partnership relationship with any other company. Arm may make changes to this document at any time and without notice.

If any of the provisions contained in these terms conflict with any of the provisions of any click through or signed written agreement covering this document with Arm, then the click through or signed written agreement prevails over and supersedes the conflicting provisions of these terms. This document may be translated into other languages for convenience, and you agree that if there is any conflict between the English version of this document and any translation, the terms of the English version of the Agreement shall prevail.

The Arm corporate logo and words marked with ® or ™ are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. All rights reserved. Other brands and names mentioned in this document may be the trademarks of their respective owners. Please follow Arm’s trademark usage guidelines at http://www.arm.com/company/policies/trademarks.

Copyright © 2017, 2019 Arm Limited (or its affiliates). All rights reserved.

Arm Limited. Company 02557590 registered in England.

110 Fulbourn Road, Cambridge, England CB1 9NJ.

LES-PRE-20349

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by Arm and the party that Arm delivered this document to.

Unrestricted Access is an Arm internal classification.

Product Status

The information in this document is Final, that is for a developed product.

Web Address

Non-ConfidentialPDF file icon PDF version101897_0200_00_en
Copyright © 2017, 2019 Arm Limited or its affiliates. All rights reserved.