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>Resources</title> 8 </head> 9 <body> 10 <h1>Resources</h1> 11 <div class="section"> 12 <p> 13 The vertex shader has the following resources.<br> 14 </p> 15 </div> 16 <h2><a name="programRAM">Program RAM</a></h2> 17 <div class="section"> 18 <p> 19 Program RAM is the region where the assembler instruction code is stored.<br> It can hold 512 instructions. If 513 or more instructions are coded in the assembler file, an error will occur at assembly time or at link time.<br> 20 </p> 21 </div> 22 23 <h2><a name="register">Registers</a></h2> 24 <div class="section"> 25 <p> 26 The following types of registers are used for operations and flow control.<br> <br> 27 <table class="members"> 28 <thead> 29 <tr> 30 <th>Name</th> 31 <td>Identifier</td> 32 <td>No. of components</td> 33 <td>Number</td> 34 <td>R/W</td> 35 <td>Index</td> 36 <td>Bit width</td> 37 </tr> 38 </thead> 39 <tr> 40 <th>Input registers</th> 41 <td>v#</td> 42 <td>4</td> 43 <td>16</td> 44 <td>R</td> 45 <td>-</td> 46 <td>24</td> 47 </tr> 48 <tr> 49 <th>Temporary registers</th> 50 <td>r#</td> 51 <td>4</td> 52 <td>16</td> 53 <td>RW</td> 54 <td>-</td> 55 <td>24</td> 56 </tr> 57 <tr> 58 <th>Floating-point constant registers</th> 59 <td>c#</td> 60 <td>4</td> 61 <td>96</td> 62 <td>R</td> 63 <td>a0/aL</td> 64 <td>24</td> 65 </tr> 66 <tr> 67 <th>Address register</th> 68 <td>a0</td> 69 <td>2</td> 70 <td>1</td> 71 <td>RW</td> 72 <td>-</td> 73 <td>8</td> 74 </tr> 75 <tr> 76 <th>Boolean registers</th> 77 <td>b#</td> 78 <td>1</td> 79 <td>16 (see below)</td> 80 <td>R</td> 81 <td>-</td> 82 <td>1</td> 83 </tr> 84 <tr> 85 <th>Integer registers</th> 86 <td>i#</td> 87 <td>1</td> 88 <td>4</td> 89 <td>R</td> 90 <td>-</td> 91 <td>24</td> 92 </tr> 93 <tr> 94 <th>Loop counter register</th> 95 <td>aL</td> 96 <td>1</td> 97 <td>1</td> 98 <td>R</td> 99 <td>-</td> 100 <td>8</td> 101 </tr> 102 <tr> 103 <th>Output registers</th> 104 <td>o#</td> 105 <td>4</td> 106 <td>16</td> 107 <td>W</td> 108 <td>-</td> 109 <td>24</td> 110 </tr> 111 <tr> 112 <th>Status registers</th> 113 <td>-</td> 114 <td>1</td> 115 <td>2</td> 116 <td>RW</td> 117 <td>-</td> 118 <td>1</td> 119 </tr> 120 </table> 121 </p> 122 <p class="notice"> 123 The No.15 Boolean register (b15) is reserved for the geometry shader.<br> 124 </p> 125 <p> 126 <dl> 127 <dt><b>Identifier</b></dt> 128 <dd>Identifier when coding assembler instructions. The register number is entered for #. You can specify a value between 0 and (total number - 1).</dd> 129 <br><br> 130 <dt><b>Name</b></dt> 131 <dd>Register name.</dd> 132 <br><br> 133 <dt><b>Number</b></dt> 134 <dd>The number of registers.</dd> 135 <br><br> 136 <dt><b>No. of components</b></dt> 137 <dd>The number of pieces of data in one register. If there are 4 components, then each register has the four components x, y, z and w.</dd> 138 <br><br> 139 <dt><b>R/W</b></dt> 140 <dd>Indicates whether the register can be read from and written to. "R" indicates that you can only specify an input operand. "W" indicates that you can only specify an output operand. "RW" indicates that you can specify an input operand or an output operand.</dd> 141 <br><br> 142 <dt><b>Index</b></dt> 143 <dd>You can use the contents of the registers being displayed to specify a register number.<br> See <a href="../grammar/Overview.html#input_offset">Offsetting the Input Operand Register Index</a>.</dd> 144 <br><br> 145 <dt><b>Bit width</b></dt> 146 <dd>The width of each register in bits.</dd> 147 <br><br> 148 </dl> 149 </p> 150 151 <h3><a name="register_quality">The Precision of Floating-Point Registers</a></h3> 152 <div class="section"> 153 <p> 154 Input registers, temporary registers, and floating-point constant registers are registers of the floating-point type. <br> <br> Here, floating point numbers are 24-bit values consisting of 1 sign bit, 7 exponent bits, and 16 mantissa bits.<br> The sign part takes 0 for positive and 1 for negative.<br> The exponent part is expressed as a base 2 value biased by 63.<br> The mantissa (fractional) part stores [mantissa -1].<br> <br> The actual value is:<br> <br> (-1) ^ (sign) × 2 ^ (exponent - 63) × (1 + mantissa)<br> <br>.<br> <br> <img src="FloatingPointRegister.png" alt="The precision of floating-point registers"> 155 </p> 156 </div> 157 158 <h3><a name="reg_input">Input registers</a></h3> 159 <div class="section"> 160 <p> 161 These are floating-point registers.<br> Store vertex attribute data. (The <CODE>attribute</CODE> values used in OpenGL ES 2.0 applications.)<br> 162 </p> 163 </div> 164 165 <h3><a name="reg_temp">Temporary Registers</a></h3> 166 <div class="section"> 167 <p> 168 These are floating-point registers.<br> These are reusable registers for temporarily holding the results of calculations. The contents of the register are maintained until overwritten. <br> 169 </p> 170 </div> 171 172 <h3><a name="reg_constfloat">Floating-Point Constant Registers</a></h3> 173 <div class="section"> 174 <p> 175 These are floating-point registers.<br> They store constants used in operations. They store the <CODE>uniform</CODE> values used in OpenGL ES 2.0 applications.<br> 176 </p> 177 </div> 178 179 <h3><a name="reg_address">The Address Register</a></h3> 180 <div class="section"> 181 <p> 182 The address register is for integers from -95 to 95. You can assign just the integer part of the value of a floating-point register.<br> Behavior is undefined if you assign a value that is outside the range of [-95, 95].<br> You can use the register value to specify a register number.<br> See <a href="../grammar/Overview.html#input_offset">Offsetting the Input Operand Register Index</a>.<br> 183 </p> 184 </div> 185 186 <h3><a name="reg_boolean">Boolean Registers</a></h3> 187 <div class="section"> 188 <p> 189 These are registers of the Boolean type. These are used for branching and jumping.<br> They store the <CODE>uniform</CODE> values used in OpenGL ES 2.0 applications.<br> The No.15 Boolean register (b15) is reserved for the geometry shader.<br> 190 </p> 191 </div> 192 193 <h3><a name="reg_integer">Integer Registers</a></h3> 194 <div class="section"> 195 <p> 196 These are registers of the integer type. Integer registers are used for controlling <CODE>loop</CODE> instructions.<br> They store the number of loops, the initial value of the loop counter register and the increment value of the loop counter register. They are 24 bits wide. Bits 0-7 specify the number of loops, bits 8-15 specify the initial value of the loop counter register, and bits 16-23 specify the increment value of the loop counter register.<br> When the process enters a <CODE>loop</CODE> instruction, the loop counter register is initialized to this register's initial value, and the assembler instructions from the <CODE>loop</CODE> instruction to the <CODE>endloop</CODE> instruction are executed repeatedly for [the number of loops specified by this register + 1]. (If the number of loops as specified by this register is 0, then the instructions are executed only once.)<br> For each loop, the loop counter register increases by the number specified for the increment value of this register.<br> This register stores the <CODE>uniform</CODE> values used in OpenGL ES 2.0 applications.<br> 197 </p> 198 </div> 199 200 <h3><a name="reg_loopcounter">The Loop Counter Register</a></h3> 201 <div class="section"> 202 <p> 203 Stores the counter values for loop instructions. Can store values in the range of -128 to 127.<br> As with address registers, you can specify a register number.<br> See <a href="../grammar/Overview.html#input_offset">Offsetting the Input Operand Register Index</a>.<br> 204 </p> 205 </div> 206 207 <h3><a name="reg_output">Output Registers</a></h3> 208 <div class="section"> 209 <p> 210 Outputs the data after processing by the vertex shader for later stages in the graphics pipeline.<br> 211 </p> 212 </div> 213 214 <h3><a name="reg_status">Status Registers</a></h3> 215 <div class="section"> 216 <p> 217 These registers are used for conditional branching on values set by comparison instructions.<br> 218 </p> 219 </div> 220 </div> 221 222 <h2>Revision History</h2> 223 <div class="section"> 224 <dl class="history"> 225 <dt>2011/12/20</dt> 226 <dd>Initial version.<br /> 227 </dd> 228 </dl> 229 </div> 230 231 232 <hr><p>CONFIDENTIAL</p></body> 233</html> 234