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>AddDummyDataForCommandBuffer</title> 8 </head> 9 <body> 10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/gr/Overview.html">gr</a>::<a href="../../../nn/gr/CTR/Overview.html">CTR</a>::AddDummyDataForCommandBuffer</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../../nn_types/bit32.html">bit32</a> * AddDummyDataForCommandBuffer( 15 <a href="../../../nn_types/bit32.html">bit32</a> * command, 16 const size_t addSize 17); 18</pre> 19 </div> 20<h2>Parameters</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>command</th> 33<td>Address of the write destination for the next command.</td> 34 </tr> 35 <tr> 36<td>in</td> 37<th>addSize</th> 38<td>Command buffer size, including the command that you plan to add later.</td> 39 </tr> </table> 40 </div> 41<h2>Return Values</h2> 42<div class="section">Returns the address that follows the end of the stored rendering command. </div> 43<h2>Description</h2> 44 <div class="section"> 45<p>When you add a command of the specified size, the buffer size is adjusted to a multiple of 16.</p><p> 46Normally, the nngx API automatically adjusts the command buffer size. However, when you create a command buffer to execute as a subroutine, the buffer size must be adjusted manually because the nngx API cannot be used. 47 </p><p> 48At the end of the command buffer to execute as a subroutine, a kick command is added to return to the execution destination. By calling this function before you add that command, you guarantee that the size limitation of the command buffer is not broken, and that the buffer is a multiple of 16. 49<pre> 50 u32* command; // Stores the address for the next write destination of the command buffer. 51 u32* head = command; 52 53 ... // Omitted. (Write the command to execute as a subroutine.) 54 55 // With this function, the final buffer size is adjusted to a multiple of 16. 56 // Remember that the kick command to add later is 8 bytes. 57 command = nn::gr::AddDummyDataForCommandBuffer( command, (command - head) * sizeof(u32) + 8 ); 58 // Add the kick command. 59 command = nn::gr::MakeChannelKickCommand( command, nn::gr::CTR::CMD_BUF_CH1 ); 60 61 ... // Omitted. 62</pre></p></div> 63<h2>See Also</h2> 64 <div class="section"> 65<p class="reference"><a href="../../../nn/gr/CTR/MakeChannelKickCommand.html"><CODE>nn::gr::CTR::MakeChannelKickCommand</CODE></a><br /> </p> 66 </div> 67<h2>Revision History</h2> 68 <div class="section"> 69 <dl class="history"> 70 <dt>2012/06/26</dt> 71<dd>Initial version.<br /> 72 </dd> 73 </dl> 74 </div> 75 <hr><p>CONFIDENTIAL</p></body> 76</html> 77