Download - PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

Transcript
Page 1: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

PowerVR Developer Technology

PowerVR: Getting Great Graphics Performance

with the PowerVR Insider SDK

Page 2: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

2 © 2012 Imagination Technologies

Company Overview

UK Headquarters

R&D

Sales

Solution Centric IP

• Leading silicon, software & cloud IP supplier

• Graphics, video, comms, processor, cloud

• Licensing and royalty business model

• Licensed to many top 20 semis & OEMs

• Servicing high volume, high growth markets

• Shipped by most major consumer brands

• Smartphones, media players, tablets/netbooks, TVs/STBs, gaming

devices, radios, connected devices, dashboards/navigation

• Strategic product division: PURE • Digital radio, internet connected audio (today)

• IP business pathfinder, market maker

• Established technology powerhouse • Founded 1985; London FTSE 250 (IMG.L) • Employees: 1,000+ • UK HQ; operations world-wide • Global customer base

© Imagination Technologies Ltd. 2

Page 3: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

3 © 2012 Imagination Technologies

The PowerVR Insider SDK Overview

Page 4: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

4 © 2012 Imagination Technologies

• Asset Optimization

- Geometry; Textures

• Coding

- Source code, shader editors, emulation environment

• Deployment

- Abstraction layer; example projects

• Optimization

- Performance analysis; API tracing

What is the PowerVR Insider SDK? Enabling Development

PVRVFrame

PVRShaman & PVRUniSCoEditor

PVRGeoPOD & Collada2POD

PVRTexTool & PVRTexLib

PVRTune & PVRScope

PVRTrace

Page 5: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

5 © 2012 Imagination Technologies

• Training Courses & Demos

- Step by step guide

- basics to advanced techniques

- Same project structure

• PVRShell abstraction layer

• PVRTools helper library

• General graphics knowledge

• PowerVR specific optimizations

Source Code

What is the PowerVR Insider SDK?

Page 6: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

6 © 2012 Imagination Technologies

• Implementation and examples provided in source code

• Highly optimized, lightweight deployment formats

• Well-documented

• POD – Model Format

- Meshes, animations

- References textures, effects

• PVR – Texture Container Format

- Newly updated in SDK 2.10

- Cube maps, normal maps, volume textures, meta-data

- OpenGL, OpenGL ES, DirectX formats

• PFX – Effects format

- Vertex & fragment shaders

- References textures, uniforms, attributes

- Render to texture support; post-processing

File Formats & Implementations

What is the PowerVR Insider SDK?

Page 7: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

7 © 2012 Imagination Technologies

Utilities Asset Optimization

Page 8: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

8 © 2012 Imagination Technologies

PVRGeoPOD & Collada2POD

• PVRGeoPOD - POD exporter plug-in for 3D Studio

Max, Maya and Blender

• Collada2POD - Provides conversion from the Khronos

Collada interchange format to POD

- GUI and command line versions

- Windows, Linux and Mac OS

Page 9: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

9 © 2012 Imagination Technologies

PVRTexTool & PVRTexLib

• Processes and compresses textures - All OpenGL ES (1.x, 2.0), DirectX (9,

10)

- Normal map generation, colour bleeding, border addition, high quality scaling algorithms and sky box optimization

- Support for PVRTC, PVRTC2

• Command line and GUI

• Plug-in for Adobe Photoshop

• PVRTexLib - library for direct integration into

toolchains

Page 10: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

10 © 2012 Imagination Technologies

• What is PVRTC?

- High quality, high ratio texture compression format, designed for PowerVR hardware

- PVRTC and PVRTC2 both support:

- 4 bits per pixel RGBA; 8x saving

- 2 bits per pixel RGBA; 16x saving

• PVRTC2

- better image quality, pre-multiplied alpha, NPOT sizes, sub-texturing

Texture Compression

PVRTC & PVRTC2

PVRTC 2bpp DXT/S3TC 4bpp

PVRTC 4bpp Original 32bpp

Page 11: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

11 © 2012 Imagination Technologies

PVRShaman

• Integrated visual shader development environment - See visual results of changes

- Instant feedback on shader cost

• Prototype entire scenes & characters - POD models or import

Collada files

- Material editing

• Integrated PVRUniSCoEditor & compiler

• DirectX, OpenGL and OpenGL ES (1.1 & 2.0) support

Page 12: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

12 © 2012 Imagination Technologies

PVRUniSCo & PVRUniSCoEditor

• PVRUniSCoEditor Shader Editor - Integrated shader performance

information

- Error reporting

• PVRUniSCo - Offline command-line compiler

- Profile your shaders

• Updated compilers - SGX 53x

- SGX 540

- SGX 543

Page 13: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

13 © 2012 Imagination Technologies

PVRVFrame

• PowerVR OpenGL ES emulator - OpenGL ES (1.1 & 2.0) emulation on

Windows, Linux and Mac OS

• PVRVFrame features - Develop and debug without PowerVR

hardware

- Supports all MBX and SGX extensions

- Choose a profile for a specific core

Page 14: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

14 © 2012 Imagination Technologies

Performance PVRTrace

Page 15: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

15 © 2012 Imagination Technologies

PVRTrace Overview

Page 16: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

16 © 2012 Imagination Technologies

• Trace any application

- No need for special builds

• Trace on multiple device platforms

- Android

- Linux

- PVRVFrame Emulation

• Analyse with desktop GUI

- Windows, Linux, Mac OS

Features

PVRTrace

Page 17: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

17 © 2012 Imagination Technologies

• Host Information

- PVRTrace needs to pass calls through to the underlying system

• Recording Information

- What to record

- Where to put output

- Texture and buffer data is recorded if “RecordData” is 1

- TraceFile must be set to a writeable location

• Please read the doc!!!

Configuration

PVRTrace

PVRTrace.cfg

[host]

EglLibraryPath = %SYSTEMDIR%\libEGL.dll

Es1LibraryPath = %SYSTEMDIR%\libGLES_CM.dll

Es2LibraryPath = %SYSTEMDIR%\libGLESv2.dll

[record]

TraceFile = trace-%pid.pvrt

RecordData = 1

StartFrame = 0

EndFrame = 1

Path to Driver libraries

Where to put output

What to record

Page 18: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

18 © 2012 Imagination Technologies

Analysis Interface

Frame Summary & Function Counts Function Calls

Data Viewer Render States, Textures, Shaders

Frame Scrubber

Frame Selector

Page 19: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

19 © 2012 Imagination Technologies

Performance PVRTune & PVRScope

Page 20: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

20 © 2012 Imagination Technologies

PVRTune Overview

• Client and Server applications

- PVRPerfServer on device

- PVRTune on development machine

• Typical Use Case

1. Run PVRPerfServer application on device

- PVRScopeServices must be enabled on the device

2. Run application to be analysed

3. Connect with PVRTune client from development machine

Page 21: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

21 © 2012 Imagination Technologies

PVRPerfServer

• Server application that gathers data to be analysed by PVRTune

- Runs from command line or application menu

- Waits for client connection then sends data across standard network connection

- Can also record data to file for later analysis

• Enabled by default in many, already shipping devices

- Negligible graphics performance overhead

- Low CPU usage

• PVRTune and PVRPerfServer version numbers should match

Page 22: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

22 © 2012 Imagination Technologies

PVRTune Analysis Interface

Hardware

Performance Counters

Hardware Counter Groups

TA/3D load

visualisation

Graph views

Connection Status

Page 23: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

23 © 2012 Imagination Technologies

TA/3D Colours

Inside colours indicate render target

TA

3D Outside colours indicate PID

Block colour indicates frame Transfer Tasks

(Always appear grey)

Page 24: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

24 © 2012 Imagination Technologies

Counters

• Software

• Hardware

• Real-time data collection

- Counters retrieved as the application is rendering

• Counters grouped by association

- Click group number to activate

- Inactive counters greyed out

Select current counter group

Specific counters can be dragged from here to graph view

Description of current counter

Select colour and y-axis for graphing

Axis per counter

Dynamically

updating values

Columns can be user selected

Page 25: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

25 © 2012 Imagination Technologies

CPU Bound Application Case Study

• SGX is waiting for the CPU

- Likely to be indicated by gaps between TA and 3D activity blocks

• Example causes

- “Stalling” operation required by CPU

- CPU must process and submit draw calls

- CPU may simply not be keeping up

• Example developer actions

- CPU-profiling and optimizations

- Better batching of draw calls

- Examine API calls for “stalling” operations and reduce these

CPU may be at or near 100%

Gaps between TA and 3D tasks

Page 26: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

26 © 2012 Imagination Technologies

Vertex Bound Application Case Study

• The amount of vertex processing is limiting application frame rate

• Example counters to examine: - ‘USSE clock cycles per vertex’

- ‘USSE load: vertex’

- ‘on-screen vertices per frame’

- ‘TA load’

- ‘ISP load’

• Example developer actions - Optimize vertex shaders

- Reduce number of vertices passed to SGX by using more CPU culling, level of detail algorithms or low-poly, bump-mapping techniques

Gaps between 3D tasks

No gaps between TA tasks

“USSE load: vertex” and “TA load” may be high

Page 27: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

27 © 2012 Imagination Technologies

Pixel/Fragment Bound Application Case Study

• Fragment processing is limiting frame rate

• Example counters to examine: - “USSE clock cycles per pixel”

- “USSE load: pixel”

- “texture unit(s) load”

• Example developer actions - Optimize pixel shaders

- Examine how much blending or alpha testing is in the scene

- Examine textures

- Texture formats (PVRTC vs. uncompressed)

- MIP-map use

- Filtering modes

No gaps between 3D tasks Large gaps

between TA tasks

“USSE load: pixel” and “USSE clock cycles per pixel” may be high

Page 28: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

28 © 2012 Imagination Technologies

V-Sync Limited Application

• Easy to spot

• TA and 3D blocks will appear serialised.

• SGX sleeps intermittently

• Frame rate will appear to sit at a cap.

• V-Sync makes profiling hard - Interferes with

bottleneck identification

- Disable V-Sync if you can

SGX sleeping unpredictably

TA & 3D serialised

Frame rate hovering around a fixed number.

Page 29: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

29 © 2012 Imagination Technologies

Bandwidth Limited Application

• Most difficult bottleneck to spot

- Fragment bound but low USSE Load: Pixel

- Vertex bound but low USSE Load: Vertex

- High TSP Load

• In SoCs bandwidth is shared among the whole system.

• Example developer actions

- Use texture compression

- Avoid unnecessary texture reads – read once and reuse

- Especially dependent texture reads

- Optimize meshes

- Consider using non-float data types

• Always assume bandwidth is limited

Page 30: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

30 © 2012 Imagination Technologies

• In your own applications:

- Access SGX hardware counters

- Pass custom counters to PVRTune

- Receive data from PVRTune

PVRScope Library

Page 31: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

31 © 2012 Imagination Technologies

• Source Code

- Example Projects

- Training Courses

- Demos

- Abstraction Layer

- PVRShell

- Helper Library

- PVRTools

• Asset Optimisation

- Geometry

- PVRGeoPOD & Collada2POD

- Textures

- PVRTexTool & PVRTexLib

• Prototyping

- Shaders

- PVRShaman

- PVRUniSCo & PVRUniSCoEditor

- Emulation

- PVRVFrame

• Performance

- API tracing

- PVRTrace

- Real time, hardware counters

- PVRTune

- PVRScope

PowerVR Insider SDK Summary

• And more:

• Documentation, example renderer, navigation data tools…

Page 32: PowerVR: Getting Great Graphics Performance with the ...imgtec.eetrend.com/sites/imgtec.eetrend.com/files/... · - Optimize pixel shaders - Examine how much blending or alpha testing

32 © 2012 Imagination Technologies

PowerVR Insider Program

Eco System

Email/Tel Support

FAQs

Forums

Training

Developer Days Virtual

Demo Room

SDK

Blogs/ Social Media

Knowledge Base

Website

• http://www.powervrinsider.com

• Free to join

• Benefits of being a PowerVR Insider

- PowerVR Insider SDK downloads

- Open developer forums

- Direct email contact with engineers from PowerVR Developer Technology

- [email protected]

- Documentation

- FAQs

- Training (web based and onsite)

• PowerVR: Masterclass in Graphics Technology and Optimization

- Tomorrow 2:30-3:30

- Room 2014, West Hall, 2nd Floor

• See you there