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>nngxAddMemoryFillCommand</title>
8  </head>
9  <body>
10<h1><CODE>nngxAddMemoryFillCommand</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14NNGX_APICALL void NNGX_APIENTRY nngxAddMemoryFillCommand(
15     GLvoid * startaddr0,
16     GLsizei size0,
17     GLuint data0,
18     GLsizei width0,
19     GLvoid * startaddr1,
20     GLsizei size1,
21     GLuint data1,
22     GLsizei width1
23);
24</pre>
25    </div>
26<h2>Arguments</h2>
27    <div class="section">
28      <table class="arguments">
29        <thead>
30          <tr>
31            <td width="15" />
32<th>Name</th>
33<td>Description</td>
34          </tr>
35        </thead>
36        <tr>
37<td>in</td>
38<th>startaddr0</th>
39<td>Start address of the memory region to fill (channel 0).</td>
40        </tr>
41        <tr>
42<td>in</td>
43<th>size0</th>
44<td>Size in bytes to fill (channel 0)</td>
45        </tr>
46        <tr>
47<td>in</td>
48<th>data0</th>
49<td>Fill data to use (channel 0)</td>
50        </tr>
51        <tr>
52<td>in</td>
53<th>width0</th>
54<td>Bit width of the fill pattern (16, 24, or 32) (channel 0)</td>
55        </tr>
56        <tr>
57<td>in</td>
58<th>startaddr1</th>
59<td>Start address of the memory region to fill (channel 1).</td>
60        </tr>
61        <tr>
62<td>in</td>
63<th>size1</th>
64<td>Size in bytes to fill (channel 1)</td>
65        </tr>
66        <tr>
67<td>in</td>
68<th>data1</th>
69<td>Fill data to use (channel 1)</td>
70        </tr>
71        <tr>
72<td>in</td>
73<th>width1</th>
74<td>Bit width of the fill pattern (16, 24, or 32) (channel 1)</td>
75        </tr> </table>
76    </div>
77<h2>Return Values</h2>
78<div class="section">There is no return value. </div>
79<h2>Description</h2>
80    <div class="section">
81<p>Adds a command to fill the memory.</p><P>
82Use this function to clear the color and depth (stencil) buffers by filling memory with a specified data pattern. The <SPAN class="argument">glClear</SPAN> function provides equivalent functionality, but this function has more general uses.
83            </P><P>
84You can fill two regions using separate parameters for each. Channel 0 is configured by <SPAN class="argument">startaddr0</SPAN>, <SPAN class="argument">size0</SPAN>, <SPAN class="argument">data0</SPAN>, and <SPAN class="argument">width0</SPAN>. Channel 1 is configured by <SPAN class="argument">startaddr1</SPAN>, <SPAN class="argument">size1</SPAN>, <SPAN class="argument">data1</SPAN>, and <SPAN class="argument">width1</SPAN>.
85</P><P>Memory is filled starting at addresses <SPAN class="argument">startaddr0</SPAN> and <SPAN class="argument">startaddr1</SPAN>. The <SPAN class="argument">startaddr0</SPAN> and <SPAN class="argument">startaddr1</SPAN> addresses must be 16-byte aligned. If an address is 0, its corresponding channel is not used. This function can only fill memory to VRAM. It cannot fill to main memory (FCRAM).
86</P><P><SPAN class="argument">size0</SPAN> and <SPAN class="argument">size1</SPAN> bytes of memory are filled. Both <span class="argument">size0</span> and <span class="argument">size1</span> must be multiples of 16.
87</P><P>The <SPAN class="argument">data0</SPAN> and <SPAN class="argument">data1</SPAN> arguments specify the fill data. The data specified in each argument is repeated until the specified size is filled.
88</P><P>The number of bits in each fill pattern is specified by <SPAN class="argument">width0</SPAN> and <SPAN class="argument">width1</SPAN>. You can specify <CODE>16</CODE>, <CODE>24</CODE>, or <CODE>32</CODE>. If you specify <CODE>16</CODE>, memory is filled 16 bits at a time using bits [15:0] of <SPAN class="argument">data0</SPAN> and <SPAN class="argument">data1</SPAN>. If you specify <CODE>24</CODE>, memory is filled 24 bits at a time using bits [23:0] of <SPAN class="argument">data0</SPAN> and <SPAN class="argument">data1</SPAN>. If you specify <CODE>32</CODE>, memory is filled 32 bits at a time using bits [31:0] of <SPAN class="argument">data0</SPAN> and <SPAN class="argument">data1</SPAN>.
89</P><P>The following table shows sample argument values for each color buffer format.
90<TABLE><THEAD><TR><TD>Format</TD><TD><SPAN class="argument">data0</SPAN> or <SPAN class="argument">data1</SPAN></TD><TD><SPAN class="argument">width0</SPAN> or <SPAN class="argument">width1</SPAN></TD></TR></THEAD><TR><TD>GL_RGBA8_OES</TD><TD>R[31:24], G[23:16], B[15:8], A[7:0]</TD><TD>32</TD></TR><TR><TD>GL_RGBA4</TD><TD>R[15:12], G[11:8], B[7:4], A[3:0]</TD><TD>16</TD></TR><TR><TD>GL_RGB5_A1</TD><TD>R[15:11], G[10:6], B[5:1], A[0:0]</TD><TD>16</TD></TR><TR><TD>GL_RGB565</TD><TD>R[15:11], G[10:5], B[4:0]</TD><TD>16</TD></TR><TR><TD><CODE>GL_DEPTH24_STENCIL8_EXT</CODE></TD><TD>stencil[31:24], depth[23:0]</TD><TD>32</TD></TR><TR><TD><CODE>GL_DEPTH_COMPONENT24_OES</CODE></TD><TD>depth[23:0]</TD><TD>24</TD></TR><TR><TD><CODE>GL_DEPTH_COMPONENT16</CODE></TD><TD>depth[15:0]</TD><TD>16</TD></TR></TABLE></P><P>
91The following errors occur with this function.
92<TABLE><TR><TH>GL_ERROR_8078_DMP</TH><TD>0 is bound to the current command list or the command request queue is full.</TD></TR><TR><TH>GL_ERROR_8079_DMP</TH><TD>The <SPAN class="argument">startaddr0</SPAN> or <SPAN class="argument">startaddr1</SPAN> value is not 16-byte aligned.</TD></TR><TR><TH>GL_ERROR_807A_DMP</TH><TD>The <SPAN class="argument">size0</SPAN> or <SPAN class="argument">size1</SPAN> value is not a multiple of 16.</TD></TR><TR><TH>GL_ERROR_807B_DMP</TH><TD>The <SPAN class="argument">width0</SPAN> or <SPAN class="argument">width1</SPAN> value is invalid.</TD></TR></TABLE>
93The <SPAN class="argument">size0</SPAN>, <SPAN class="argument">data0</SPAN>, and <SPAN class="argument">width0</SPAN> arguments are not checked for errors when <SPAN class="argument">startaddr0</SPAN> is set to <CODE>0</CODE>. The <SPAN class="argument">size1</SPAN>, <SPAN class="argument">data1</SPAN>, and <SPAN class="argument">width1</SPAN> arguments are not checked for errors when <SPAN class="argument">startaddr1</SPAN> is set to <CODE>0</CODE>.
94            </P><P>
95Channel 0 and channel 1 are executed simultaneously. If they have overlapping regions, it is undefined which result will ultimately be applied.
96            </P></div>
97<h2>Revision History</h2>
98    <div class="section">
99      <dl class="history">
100        <dt>2010/11/01</dt>
101<dd>Revised mistaken text.<br />
102        </dd>
103        <dt>2010/10/07</dt>
104<dd>Added information on address restrictions.<br />
105        </dd>
106        <dt>2010/09/15</dt>
107<dd>Initial version.<br />
108        </dd>
109      </dl>
110    </div>
111  <hr><p>CONFIDENTIAL</p></body>
112</html>