nngxGetProfilingResult Function

Syntax

NNGX_APICALL void NNGX_APIENTRY nngxGetProfilingResult(
     GLenum item,
     GLuint * result
);

Parameters

Name Description
in item Profiling functionality
in result Profiling Results

Return Values

No values are returned.

Description

Gets the profiling results.

Returns in result the profiling results of the profiling functionality specified by item . Values that can be specified in item and profiling results that can be obtained in result are shown in the table below.

NN_GX_PROFILING_BUSYObtains the profiling results stored in busy counters. Obtains the busy count for each module since profiling started. A 16-bit busy count is obtained for each module. result specifies a buffer for storing four GLuint type values. Data is stored in the following order.
  • [31:16] of the first value: Shader processor 0
  • [15:0] of the first value: Command buffer and vertex array load module
  • [31:16] of the second value: Rasterization module
  • [15:0] of the second value: Triangle setup
  • [31:16] of the third value: Fragment lighting
  • [15:0] of the third value: Texture unit
  • [31:16] of the fourth value: Per fragment operation module
  • [15:0] of the fourth value: Texture combiner
NN_GX_PROFILING_VERTEX_SHADER0 Obtains profiling results for Shader processor 0. Refer to the difference value between any two points as there is a constant count of this value. result specifies a buffer for five GLuint type values. Each counter is 32 bits. Data is stored in the following order.
  • The first value: Jump count in the program counter
  • The second value: Clock count for stalls due to command dependencies.
  • The third value: Clock count for stalls during address register update (mova command execution).
  • The fourth value: Clock count for stalls when updating the status register (cmp command execution).
  • The fifth value: Clock count for stalls due to program pre-fetch hit errors.
NN_GX_PROFILING_VERTEX_SHADER1Obtains profiling results for Shader processor 1. For details, see NN_GX_PROFILING_VERTEX_SHADER0, which is similar.
NN_GX_PROFILING_VERTEX_SHADER2Obtains profiling results for Shader processor 2. For details, see NN_GX_PROFILING_VERTEX_SHADER0, which is similar.
NN_GX_PROFILING_VERTEX_SHADER3Obtains profiling results for Shader processor 3. For details, see NN_GX_PROFILING_VERTEX_SHADER0, which is similar.
NN_GX_PROFILING_VERTEX_CACHE Obtains the number of vertices input into the post vertex cache. result specifies a buffer for one GLuint type value. The obtained value is the result of the last rendering by glDrawElements (rendering made by writing 1 into PICA register 0x22F). Because the clock is cleared to 0 first for each rendering task, profiling results can be always be obtained for the most recently run rendering task. Even if the rendering task uses the same vertex data, obtained results may vary slightly depending on conditions, such as the timing at which vertex indices were loaded and how busy the last module of the post vertex cache is.
NN_GX_PROFILING_POLYGON Obtains the value of the counter storing the I/O polygon count. Refer to the difference value between any two points as there is a constant count of this value. result specifies a buffer for three GLuint type values. Each counter is 32 bits. Data is stored in the following order.
  • The first value: I/O vertex count sent for triangle setup.
  • The second value: The I/O polygon count sent for triangle setup.
  • The third value: The output polygon count sent for triangle setup.
NN_GX_PROFILING_FRAGMENT Obtains the value of the counter storing the input fragment count. Refer to the difference value between any two points as there is a constant count of this value. result specifies a buffer for one GLuint type value. The counter value obtained is a 32-bit value that stores the number of fragments input to the per fragment operation module.
NN_GX_PROFILING_MEMORY_ACCESSGets the number of times the hardware modules have accessed memory. All counter values are 32-bit values, and multiplying these by 16 produces the actual number of bytes read and written.
  • The first value: data read on VRAM Channel A via PICA.
  • The second value: data written on VRAM Channel A via PICA.
  • The third value: data read on VRAM Channel B via PICA.
  • The fourth value: data written on VRAM Channel B via PICA.
  • The fifth value: data read from the command buffer, vertex array, and index array by the module that loads the command buffer and vertex array.
  • The sixth value: data read from texture memory by the texture unit.
  • The seventh value: data read from the depth buffer and stencil buffer by the per fragment operation module.
  • The eight value: data written to the depth buffer and stencil buffer by the per fragment operation manual.
  • The ninth value: data read from the color buffer by the per fragment operation module.
  • The tenth value: data written to the color buffer by the per fragment operation module.
  • The eleventh value: data read from the display buffer by the upper screen LCD controller.
  • The twelfth value: data read from the display buffer by the lower screen LCD controller.
  • The thirteenth value: data read by the post transfer module.
  • The fourteenth value: data read by the post transfer module.
  • The fifteenth value: Data written to buffer by Channel 0 of the memory fill module.
  • The sixteenth value: Data written to buffer by Channel 1 of the memory fill module.
  • The seventeenth value: data read from VRAM by glReadPixels and similar functions.
  • The eighteenth value: data written to VRAM by DMA transfer.

Each counter rolls over to zero upon overflow. The busy counter starts counting from 0 when profiling starts. Although the vertex cache input vertex count counter counts from zero for each render, the other counters are reset to zero at hardware reset and then they count continuously. Counters that run continuously can be used to get profiling results for the interval you want to measure by referring to the difference in values between two points in time. The number of data items returned in result (in other words, the size of buffer specified for result) depends on item. The buffer size (measured in terms of the number of GLuint type values to be stored, rather than in bytes) required for result is defined by a macro. This is defined using names of the form NN_GX_PROFILING_RESULT_BUFSIZE_*** for NN_GX_PROFILING_*** items. For example, if NN_GX_PROFILING_BUSY is specified in item, the buffer specified in result must be able to store the number of GLuint type values defined by NN_GX_PROFILING_RESULT_BUFSIZE_BUSY.

Do not call this function while the GPU is executing (executing a command list). Although errors will not occur if called during GPU execution, the GPU may perform illegal operations.

This function generates the following errors.

GL_ERROR_80A4_DMPAn illegal value was specified in item.

Revision History

2011/09/02
Revised the description of the memory access counter.
2011/07/28
Initial version.

CONFIDENTIAL