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