Using small data types
GPUs can calculate with smaller data types more quickly than larger types (particularly on mobile platforms), so the first tweak we can attempt is replacing our float data types (32-bit, floating-point) with smaller versions such as half (16-bit, floating-point) or even fixed (12-bit, fixed point). The size of the data types listed previously will vary depending on what floating-point formats the target platform prefers. The sizes listed are the most common.
Optimization stems from the relative size between formats since there are fewer bits to process.
Color values are good candidates for precision reduction, as we can often get away with fewer precise color values without a noticeable loss in coloration. However, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access