1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: gr_BindSymbol.h 4 5 Copyright (C)2010 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 26824 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_GR_BIND_SYMBOL_H_ 17 #define NN_GR_BIND_SYMBOL_H_ 18 19 #include <nn/gr/CTR/gr_Prefix.h> 20 #include <nn/gr/CTR/gr_Utility.h> 21 22 namespace nn 23 { 24 namespace gr 25 { 26 namespace CTR 27 { 28 29 /* Please see man pages for details 30 31 */ 32 class BindSymbol 33 { 34 public : 35 /* Please see man pages for details 36 37 */ 38 enum SymbolType 39 { 40 // 41 SYMBOL_TYPE_INVALID, 42 // 43 SYMBOL_TYPE_INPUT, 44 // 45 SYMBOL_TYPE_FLOAT, 46 // 47 SYMBOL_TYPE_INTEGER, 48 // 49 SYMBOL_TYPE_BOOL 50 }; 51 52 /* Please see man pages for details 53 54 */ 55 enum ShaderType 56 { 57 // 58 SHADER_TYPE_VERTEX, 59 // 60 SHADER_TYPE_GEOMETRY 61 }; 62 63 /* Please see man pages for details 64 65 66 */ 67 const ShaderType shaderType; 68 69 /* Please see man pages for details 70 71 72 */ 73 const SymbolType symbolType; 74 75 /* Please see man pages for details 76 77 78 */ 79 u8 start; 80 81 /* Please see man pages for details 82 83 84 */ 85 u8 end; 86 87 /* Please see man pages for details 88 89 90 */ 91 const char* name; 92 93 protected : 94 /* Please see man pages for details 95 96 97 98 99 */ BindSymbol(const ShaderType shader_type,const SymbolType symbol_type)100 explicit BindSymbol( const ShaderType shader_type, const SymbolType symbol_type ) 101 : shaderType( shader_type ), 102 symbolType( symbol_type ), 103 start( 0xff ), 104 end( 0xff ), 105 name( NULL ) 106 { 107 } 108 }; 109 110 /* Please see man pages for details 111 112 */ 113 class BindSymbolVSInput : public BindSymbol 114 { 115 public : 116 /* Please see man pages for details 117 118 */ BindSymbolVSInput()119 explicit BindSymbolVSInput() : 120 BindSymbol( SHADER_TYPE_VERTEX, SYMBOL_TYPE_INPUT ) 121 { 122 } 123 }; 124 125 /* Please see man pages for details 126 127 */ 128 class BindSymbolVSFloat : public BindSymbol 129 { 130 public : 131 /* Please see man pages for details 132 133 */ BindSymbolVSFloat()134 explicit BindSymbolVSFloat() : 135 BindSymbol( SHADER_TYPE_VERTEX, SYMBOL_TYPE_FLOAT ) 136 { 137 } 138 139 /* Please see man pages for details 140 141 142 143 144 145 146 */ MakeUniformCommand(bit32 * command,const nn::math::MTX34 & mtx34)147 bit32* MakeUniformCommand( bit32* command, const nn::math::MTX34& mtx34 ) const 148 { 149 return MakeUniformCommandVS( command, start, mtx34 ); 150 } 151 152 /* Please see man pages for details 153 154 155 156 157 158 159 */ MakeUniformCommand(bit32 * command,const nn::math::MTX44 & mtx44)160 bit32* MakeUniformCommand( bit32* command, const nn::math::MTX44& mtx44 ) const 161 { 162 return MakeUniformCommandVS( command, start, mtx44 ); 163 } 164 165 /* Please see man pages for details 166 167 168 169 170 171 172 */ MakeUniformCommand(bit32 * command,const nn::math::VEC4 & vec4)173 bit32* MakeUniformCommand( bit32* command, const nn::math::VEC4& vec4 ) const 174 { 175 return MakeUniformCommandVS( command, start, vec4 ); 176 } 177 178 /* Please see man pages for details 179 180 181 182 183 184 185 186 187 */ MakeUniformCommand(bit32 * command,const nn::math::VEC4 vec4[],const int num)188 bit32* MakeUniformCommand( bit32* command, const nn::math::VEC4 vec4[], const int num ) const 189 { 190 return MakeUniformCommandVS( command, start, vec4, num ); 191 } 192 }; 193 194 /* Please see man pages for details 195 196 */ 197 class BindSymbolVSInteger : public BindSymbol 198 { 199 public : BindSymbolVSInteger()200 explicit BindSymbolVSInteger() : 201 BindSymbol( SHADER_TYPE_VERTEX, SYMBOL_TYPE_INTEGER ) 202 { 203 } 204 205 /* Please see man pages for details 206 207 208 209 210 211 212 213 214 */ MakeUniformCommand(bit32 * command,u8 x,u8 y,u8 z)215 bit32* MakeUniformCommand( bit32* command, u8 x, u8 y, u8 z ) const 216 { 217 return MakeUniformCommandVS( command, start, x, y, z ); 218 } 219 }; 220 221 /* Please see man pages for details 222 223 */ 224 class BindSymbolVSBool : public BindSymbol 225 { 226 public : 227 /* Please see man pages for details 228 229 */ BindSymbolVSBool(void)230 explicit BindSymbolVSBool( void ) : 231 BindSymbol( SHADER_TYPE_VERTEX, SYMBOL_TYPE_BOOL ) 232 { 233 } 234 }; 235 236 /* Please see man pages for details 237 238 */ 239 class BindSymbolGSFloat : public BindSymbol 240 { 241 public : 242 /* Please see man pages for details 243 244 */ BindSymbolGSFloat(void)245 explicit BindSymbolGSFloat( void ) : 246 BindSymbol( SHADER_TYPE_GEOMETRY, SYMBOL_TYPE_FLOAT ) 247 { 248 } 249 250 /* Please see man pages for details 251 252 253 254 255 256 257 */ MakeUniformCommand(bit32 * command,const nn::math::MTX34 & mtx34)258 bit32* MakeUniformCommand( bit32* command, const nn::math::MTX34& mtx34 ) const 259 { 260 return MakeUniformCommandGS( command, start, mtx34 ); 261 } 262 263 /* Please see man pages for details 264 265 266 267 268 269 270 */ MakeUniformCommand(bit32 * command,const nn::math::MTX44 & mtx44)271 bit32* MakeUniformCommand( bit32* command, const nn::math::MTX44& mtx44 ) const 272 { 273 return MakeUniformCommandGS( command, start, mtx44 ); 274 } 275 276 /* Please see man pages for details 277 278 279 280 281 282 283 */ MakeUniformCommand(bit32 * command,const nn::math::VEC4 & vec4)284 bit32* MakeUniformCommand( bit32* command, const nn::math::VEC4& vec4 ) const 285 { 286 return MakeUniformCommandGS( command, start, vec4 ); 287 } 288 289 /* Please see man pages for details 290 291 292 293 294 295 296 297 */ MakeUniformCommand(bit32 * command,const nn::math::VEC4 vec4[],const int num)298 bit32* MakeUniformCommand( bit32* command, const nn::math::VEC4 vec4[], const int num ) const 299 { 300 return MakeUniformCommandGS( command, start, vec4, num ); 301 } 302 303 /* Please see man pages for details 304 305 306 307 308 309 310 311 312 */ MakeUniformCommand(bit32 * command,u8 x,u8 y,u8 z)313 bit32* MakeUniformCommand( bit32* command, u8 x, u8 y, u8 z ) const 314 { 315 return MakeUniformCommandGS( command, start, x, y, z ); 316 } 317 }; 318 319 /* Please see man pages for details 320 321 */ 322 class BindSymbolGSBool : public BindSymbol 323 { 324 public : 325 /* Please see man pages for details 326 327 */ BindSymbolGSBool()328 explicit BindSymbolGSBool() : 329 BindSymbol( SHADER_TYPE_GEOMETRY, SYMBOL_TYPE_BOOL ) 330 { 331 } 332 }; 333 334 } // namespace CTR 335 } // namespace gr 336 } // namespace nn 337 338 #endif // NN_GR_BIND_SYMBOL_H_ 339