1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7<title>nngxGetProfilingResult</title>
8  </head>
9  <body>
10<h1><CODE>nngxGetProfilingResult</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14NNGX_APICALL void NNGX_APIENTRY nngxGetProfilingResult(
15     GLenum item,
16     GLuint * result
17);
18</pre>
19    </div>
20<h2>Arguments</h2>
21    <div class="section">
22      <table class="arguments">
23        <thead>
24          <tr>
25            <td width="15" />
26<th>Name</th>
27<td>Description</td>
28          </tr>
29        </thead>
30        <tr>
31<td>in</td>
32<th><CODE>item</CODE></th>
33<td>Profiling functionality</td>
34        </tr>
35        <tr>
36<td>in</td>
37<th><CODE>result</CODE></th>
38<td>Profiling Results</td>
39        </tr> </table>
40    </div>
41<h2>Return Values</h2>
42<div class="section">No values are returned. </div>
43<h2>Description</h2>
44    <div class="section">
45<p>Gets the profiling results.</p><p>
46Returns in <CODE>result</CODE> the profiling results of the profiling functionality specified by <CODE>item</CODE> . Values that can be specified in <CODE>item</CODE> and profiling results that can be obtained in <CODE>result</CODE> are shown in the table below.
47<TABLE><TR><TH><CODE>NN_GX_PROFILING_BUSY</CODE></TH><TD>Obtains 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. <CODE>result</CODE> specifies a buffer for storing four <CODE>GLuint</CODE> type values. Data is stored in the following order.
48<UL><LI>[31:16] of the first value: Shader processor 0</LI><LI>[15:0] of the first value: Command buffer and vertex array load module</LI><LI>[31:16] of the second value: Rasterization module</LI><LI>[15:0] of the second value: Triangle setup</LI><LI>[31:16] of the third value: Fragment lighting</LI><LI>[15:0] of the third value: Texture unit</LI><LI>[31:16] of the fourth value: Per fragment operation module</LI><LI>[15:0] of the fourth value: Texture combiner</LI></UL></TD></TR><TR><TH><CODE>NN_GX_PROFILING_VERTEX_SHADER0</CODE></TH><TD>
49Obtains profiling results for Shader processor <CODE>0</CODE>. Refer to the difference value between any two points as there is a constant count of this value. <CODE>result</CODE> specifies a buffer for five <CODE>GLuint</CODE> type values. Each counter is 32 bits. Data is stored in the following order.
50<UL><LI>The first value: Jump count in the program counter</LI><LI>The second value: Clock count for stalls due to command dependencies. </LI><LI>The third value: Clock count for stalls during address register update (<CODE>mova</CODE> command execution). </LI><LI>The fourth value: Clock count for stalls when updating the status register (<CODE>cmp</CODE> command execution).</LI><LI>The fifth value: Clock count for stalls due to program pre-fetch hit errors. </LI></UL></TD></TR><TR><TH>NN_GX_PROFILING_VERTEX_SHADER1</TH><TD>Obtains profiling results for Shader processor <CODE>1</CODE>. For details, see <CODE>NN_GX_PROFILING_VERTEX_SHADER0</CODE>, which is similar. </TD></TR><TR><TH><CODE>NN_GX_PROFILING_VERTEX_SHADER2</CODE></TH><TD>Obtains profiling results for Shader processor <CODE>2</CODE>. For details, see <CODE>NN_GX_PROFILING_VERTEX_SHADER0</CODE>, which is similar. </TD></TR><TR><TH><CODE>NN_GX_PROFILING_VERTEX_SHADER3</CODE></TH><TD>Obtains profiling results for Shader processor <CODE>3</CODE>. For details, see <CODE>NN_GX_PROFILING_VERTEX_SHADER0</CODE>, which is similar. </TD></TR><TR><TH><CODE>NN_GX_PROFILING_VERTEX_CACHE</CODE></TH><TD>
51Obtains the number of vertices input into the post vertex cache. <CODE>result</CODE> specifies a buffer for one <CODE>GLuint</CODE> type value. The obtained value is the result of the last rendering by <CODE>glDrawElements</CODE> (rendering made by writing <CODE>1</CODE> into PICA register <CODE>0x22F</CODE>). Because the clock is cleared to <CODE>0</CODE> 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.
52</TD></TR><TR><TH><CODE>NN_GX_PROFILING_POLYGON</CODE></TH><TD>
53Obtains 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. <CODE>result</CODE> specifies a buffer for three <CODE>GLuint</CODE> type values. Each counter is 32 bits. Data is stored in the following order.
54<UL><LI>The first value: I/O vertex count sent for triangle setup.</LI><LI>The second value: The I/O polygon count sent for triangle setup.</LI><LI>The third value: The output polygon count sent for triangle setup.</LI></UL></TD></TR><TR><TH><CODE>NN_GX_PROFILING_FRAGMENT</CODE></TH><TD>
55Obtains 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. <CODE>result</CODE> specifies a buffer for one <CODE>GLuint</CODE> type value. The counter value obtained is a 32-bit value that stores the number of fragments input to the per fragment operation module.
56</TD></TR><TR><TH><CODE>NN_GX_PROFILING_MEMORY_ACCESS</CODE></TH><TD>Gets 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.
57<UL><LI>The first value: data read on VRAM Channel A via PICA.</LI><LI>The second value: data written on VRAM Channel A via PICA.</LI><LI>The third value: data read on VRAM Channel B via PICA.</LI><LI>The fourth value: data written on VRAM Channel B via PICA.</LI><LI>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.</LI><LI>The sixth value: data read from texture memory by the texture unit.</LI><LI>The seventh value: data read from the depth buffer and stencil buffer by the per fragment operation module. </LI><LI>The eight value: data written to the depth buffer and stencil buffer by the per fragment operation manual. </LI><LI>The ninth value: data read from the color buffer by the per fragment operation module.</LI><LI>The tenth value: data written to the color buffer by the per fragment operation module.</LI><LI>The eleventh value: data read from the display buffer by the upper screen LCD controller.</LI><LI>The twelfth value: data read from the display buffer by the lower screen LCD controller.</LI><LI>The thirteenth value: data read by the post transfer module.</LI><LI>The fourteenth value: data read by the post transfer module.</LI><LI>The fifteenth value: Data written to buffer by Channel 0 of the memory fill module.</LI><LI>The sixteenth value: Data written to buffer by Channel 1 of the memory fill module.</LI><LI>The seventeenth value: data read from VRAM by <CODE>glReadPixels</CODE> and similar functions.</LI><LI>The eighteenth value: data written to VRAM by DMA transfer.</LI></UL></TD></TR></TABLE><p>
58Each 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 <CODE>result</CODE> (in other words, the size of buffer specified for <CODE>result</CODE>) depends on <CODE>item</CODE>. The buffer size (measured in terms of the number of <CODE>GLuint</CODE> type values to be stored, rather than in bytes) required for <CODE>result</CODE> is defined by a macro. This is defined using names of the form <CODE>NN_GX_PROFILING_RESULT_BUFSIZE_***</CODE> for <CODE>NN_GX_PROFILING_***</CODE> items. For example, if <CODE>NN_GX_PROFILING_BUSY</CODE> is specified in <CODE>item</CODE>, the buffer specified in <CODE>result</CODE> must be able to store the number of <CODE>GLuint</CODE> type values defined by <CODE>NN_GX_PROFILING_RESULT_BUFSIZE_BUSY</CODE>.
59                </p><p>
60Do 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.
61                </p><p>
62This function generates the following errors.
63<TABLE><TR><TH><CODE>GL_ERROR_80A4_DMP</CODE></TH><TD>An illegal value was specified in <CODE>item</CODE>.</TD></TR></TABLE></p></p></div>
64<h2>Revision History</h2>
65    <div class="section">
66      <dl class="history">
67        <dt>2011/09/02</dt>
68<dd>Revised the description of the memory access counter.<br />
69        </dd>
70        <dt>2011/07/28</dt>
71<dd>Initial version.<br />
72        </dd>
73      </dl>
74    </div>
75  <hr><p>CONFIDENTIAL</p></body>
76</html>
77