Mali GPU Best Practices

Recommendations for efficient API usage

Authors: Pete Harris and Hans-Kristian Arntzen

HTML version will be available soon.

Download PDF

 

This article is a designed as a quick-reference, so assumes that the reader is familiar with using the underlying APIs; other articles will explore specific topics in more detail and take more time to explain key concepts to developers still learning the ins and outs of the APIs.

Warning

These recommendations aim to provide the best practices for Mali GPUs, however real-world applications can be complicated and there are always exceptions to this generalized advice. We highly recommend making measurements of any applied optimizations to check they are performing as intended on your target device(s).

Article structure

Graphics processing can be represented as a pipeline of processing stages that includes the application, the graphics driver, and the various hardware stages inside the GPU itself. Most stages follow a strict architectural pipeline, with outputs from one stage becoming the inputs into the next. Compute shaders are the one exception to this strict pipeline, as they simply write results back to resources stored in system memory, and therefore their outputs can be consumed by any stage in the pipeline which can consume those resources.

We have structured this article with topic ordering following this pipeline. Each topic provides recommendations which should be applied to processing running in that that pipeline stage. There are some generic topics such as shader program authoring advice which can apply to multiple pipeline stages; we've split these out into dedicated sections at the end of the document.

For each best practice topic we provide an explanation of the recommendation, and actionable do and don't technical points which should be considered during development. Where possible we also document the likely impact of not following the advice, and possible debugging techniques which could be applied.

Info

We provide relatively terse advice in this document for sake of brevity; for example, "Don't use discard in fragment shaders". There are inevitably cases where you will need to use a feature which we do not recommend using, some algorithms simply require it. Don't feel constrained by our advice to never use a feature, but in these cases at least start your algorithm design with the awareness that there might be an underlying performance implication for that algorithm that you should keep an eye on.

Download PDF