PVRScopeStats

PVRScopeStats uses the driver library PVRScopeServices to access performance counters on PowerVR devices

PVRScopeStats is used to access the performance counters on PowerVR hardware via a driver library called PVRScopeServices.

This section contains several examples of using PVRScopeStats to perform various tasks, including the important two: reading and outputting counter data.

Initialising PVRScopeStats

To initialise PVRScopeStats:

  1. Include the PVRScope header file.
    #include "PVRScopeStats.h"
  2. Define the control structures.
    // Defines
    #define NO_GROUP_CHANGE 0xffffffff
    
    // Internal control data
    SPVRScopeImplData* PVRScopeStatsData;
    
    // Counter information
    SPVRScopeCounterDef* counterDefinitions;
    unsigned int numCounters;
    
    // Counter reading data
    unsigned int activeGroup;
    unsigned int selectedGroup;
    bool activeGroupChanged;
    SPVRScopeCounterReading counterReading;
  3. Initialise communication with PVRScopeServices.
    PVRScopeInitialise(PVRScopeStatsData)
  4. Set up the counter data structures.
    PVRScopeGetCounters(*PVRScopeStatsData,numCounters,counterDefinitions,counterReading)
    Note: PVRScopeFindStandardCounter is a function that makes setting up counter data structures more efficient. Rather than listing all the counters available, it presents an indexed list of common counters.

Shutting down PVRScopeStats

To shutdown PVRScopeStats call the shutdown functions as follows:

PVRScopeDeInitialise(*PVRScopeStatsData,*counterDefinitions,*counterReading);