PowerVR: Getting Great Graphics Performance with the PowerVR Insider SDK PowerVR Developer Technology
Company Overview 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 Solution Centric IP 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 UK Headquarters R&D Sales 2 2012 Imagination Technologies Imagination Technologies Ltd.
3 2012 Imagination Technologies The PowerVR Insider SDK Overview
What is the PowerVR Insider SDK? Enabling Development Asset Optimization - Geometry; Textures Coding - Source code, shader editors, emulation environment Deployment - Abstraction layer; example projects Optimization - Performance analysis; API tracing PVRGeoPOD & Collada2POD PVRTexTool & PVRTexLib PVRTrace PVRShaman & PVRUniSCoEditor PVRTune & PVRScope PVRVFrame 4 2012 Imagination Technologies
What is the PowerVR Insider SDK? Source Code 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 5 2012 Imagination Technologies
What is the PowerVR Insider SDK? File Formats & Implementations 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 6 2012 Imagination Technologies
7 2012 Imagination Technologies Utilities Asset Optimization
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 8 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 9 2012 Imagination Technologies
PVRTC & PVRTC2 Texture Compression 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 Original 32bpp PVRTC 4bpp DXT/S3TC 4bpp PVRTC 2bpp 10 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 11 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 12 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 13 2012 Imagination Technologies
14 2012 Imagination Technologies Performance PVRTrace
PVRTrace Overview 15 2012 Imagination Technologies
PVRTrace Features 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 16 2012 Imagination Technologies
PVRTrace Configuration Host Information - PVRTrace needs to pass calls through to the underlying system PVRTrace.cfg Path to Driver libraries 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!!! [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 What to record Where to put output 17 2012 Imagination Technologies
Analysis Interface Frame Summary & Function Counts Frame Scrubber Function Calls Render States, Textures, Shaders 18 2012 Imagination Technologies Data Viewer Frame Selector
19 2012 Imagination Technologies Performance PVRTune & PVRScope
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 20 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 21 2012 Imagination Technologies
PVRTune Analysis Interface Hardware Counter Groups TA/3D load visualisation Hardware Performance Counters Graph views Connection Status 22 2012 Imagination Technologies
TA/3D Colours Transfer Tasks (Always appear grey) Block colour indicates frame Inside colours indicate render target 3D TA Outside colours indicate PID 23 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 Specific counters can be dragged from here to graph view Select current counter group Columns can be user selected Dynamically updating values Axis per counter Description of current counter Select colour and y-axis for graphing 24 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 25 2012 Imagination Technologies
Vertex Bound Application Case Study The amount of vertex processing is limiting application frame rate USSE load: vertex and TA load may be high 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, bumpmapping techniques Gaps between 3D tasks No gaps between TA tasks 26 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 USSE load: pixel and USSE clock cycles per pixel may be high 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 27 2012 Imagination Technologies
V-Sync Limited Application Easy to spot TA & 3D serialised 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 Frame rate hovering around a fixed number. SGX sleeping unpredictably 28 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 29 2012 Imagination Technologies
PVRScope Library In your own applications: - Access SGX hardware counters - Pass custom counters to PVRTune - Receive data from PVRTune 30 2012 Imagination Technologies
PowerVR Insider SDK Summary 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 And more: Documentation, example renderer, navigation data tools 31 2012 Imagination Technologies
PowerVR Insider Program Knowledge Base Blogs/ Social Media Website SDK Email/Tel Support Eco System Virtual Demo Room FAQs Developer Days Forums Training 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 - devtech@imgtec.com - Documentation - FAQs - Training (web based and onsite) 32 2012 Imagination Technologies PowerVR: Masterclass in Graphics Technology and Optimization - Tomorrow 2:30-3:30 - Room 2014, West Hall, 2 nd Floor See you there