2
0

CmCgProgram.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. /*
  2. -----------------------------------------------------------------------------
  3. This source file is part of OGRE
  4. (Object-oriented Graphics Rendering Engine)
  5. For the latest info, see http://www.ogre3d.org/
  6. Copyright (c) 2000-2011 Torus Knot Software Ltd
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is
  12. furnished to do so, subject to the following conditions:
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. THE SOFTWARE.
  22. -----------------------------------------------------------------------------
  23. */
  24. #include "CmCgProgram.h"
  25. #include "CmGpuProgramManager.h"
  26. #include "CmHighLevelGpuProgramManager.h"
  27. #include "CmDebug.h"
  28. #include "CmException.h"
  29. #include "CmCgProgramRTTI.h"
  30. namespace CamelotEngine {
  31. void checkForCgError(const String& ogreMethod, const String& errorTextPrefix, CGcontext context)
  32. {
  33. CGerror error = cgGetError();
  34. if (error != CG_NO_ERROR)
  35. {
  36. String msg = errorTextPrefix + cgGetErrorString(error);
  37. if (error == CG_COMPILER_ERROR)
  38. {
  39. // Get listing with full compile errors
  40. msg = msg + "\n" + cgGetLastListing(context);
  41. }
  42. CM_EXCEPT(InternalErrorException, msg);
  43. }
  44. }
  45. //-----------------------------------------------------------------------
  46. void CgProgram::selectProfile(void)
  47. {
  48. mSelectedProfile.clear();
  49. mSelectedCgProfile = CG_PROFILE_UNKNOWN;
  50. mSelectedProfile = GpuProgramManager::instance().gpuProgProfileToRSSpecificProfile(mProfile);
  51. GpuProgramManager& gpuMgr = GpuProgramManager::instance();
  52. if (gpuMgr.isSyntaxSupported(mSelectedProfile))
  53. {
  54. mSelectedCgProfile = cgGetProfile(mSelectedProfile.c_str());
  55. // Check for errors
  56. checkForCgError("CgProgram::selectProfile",
  57. "Unable to find CG profile enum for program.", mCgContext);
  58. }
  59. else
  60. mSelectedProfile.clear();
  61. }
  62. //-----------------------------------------------------------------------
  63. void CgProgram::buildArgs(void)
  64. {
  65. vector<String>::type args;
  66. if (!mCompileArgs.empty())
  67. args = StringUtil::split(mCompileArgs);
  68. vector<String>::type::const_iterator i;
  69. if (mSelectedCgProfile == CG_PROFILE_VS_1_1)
  70. {
  71. // Need the 'dcls' argument whenever we use this profile
  72. // otherwise compilation of the assembler will fail
  73. bool dclsFound = false;
  74. for (i = args.begin(); i != args.end(); ++i)
  75. {
  76. if (*i == "dcls")
  77. {
  78. dclsFound = true;
  79. break;
  80. }
  81. }
  82. if (!dclsFound)
  83. {
  84. args.push_back("-profileopts");
  85. args.push_back("dcls");
  86. }
  87. }
  88. // Now split args into that god-awful char** that Cg insists on
  89. freeCgArgs();
  90. mCgArguments = (char**)malloc(sizeof(char*) * (args.size() + 1));
  91. int index = 0;
  92. for (i = args.begin(); i != args.end(); ++i, ++index)
  93. {
  94. mCgArguments[index] = (char*)malloc(sizeof(char) * (i->length() + 1));
  95. strcpy(mCgArguments[index], i->c_str());
  96. }
  97. // Null terminate list
  98. mCgArguments[index] = 0;
  99. }
  100. //-----------------------------------------------------------------------
  101. void CgProgram::freeCgArgs(void)
  102. {
  103. if (mCgArguments)
  104. {
  105. size_t index = 0;
  106. char* current = mCgArguments[index];
  107. while (current)
  108. {
  109. free(current);
  110. mCgArguments[index] = 0;
  111. current = mCgArguments[++index];
  112. }
  113. free(mCgArguments);
  114. mCgArguments = 0;
  115. }
  116. }
  117. //-----------------------------------------------------------------------
  118. void CgProgram::loadFromSource(void)
  119. {
  120. // Create Cg Program
  121. selectProfile();
  122. if (mSelectedCgProfile == CG_PROFILE_UNKNOWN)
  123. {
  124. gDebug().log("Attempted to load Cg program but no supported "
  125. "profile was found.", "RenderSystem");
  126. return;
  127. }
  128. buildArgs();
  129. // TODO PORT - This doesn't load includes
  130. // deal with includes
  131. String sourceToUse = mSource;
  132. //String sourceToUse = resolveCgIncludes(mSource, this, mFilename);
  133. mCgProgram = cgCreateProgram(mCgContext, CG_SOURCE, sourceToUse.c_str(),
  134. mSelectedCgProfile, mEntryPoint.c_str(), const_cast<const char**>(mCgArguments));
  135. // Test
  136. //LogManager::getSingleton().logMessage(cgGetProgramString(mCgProgram, CG_COMPILED_PROGRAM));
  137. // Check for errors
  138. checkForCgError("CgProgram::loadFromSource",
  139. "Unable to compile Cg program", mCgContext);
  140. // ignore any previous error
  141. if (mSelectedCgProfile != CG_PROFILE_UNKNOWN && !mCompileError)
  142. {
  143. if (mSelectedCgProfile == CG_PROFILE_VS_4_0 || mSelectedCgProfile == CG_PROFILE_PS_4_0)
  144. {
  145. String hlslSourceFromCg = cgGetProgramString(mCgProgram, CG_COMPILED_PROGRAM);
  146. // Create a high-level program, give it the same name as us
  147. HighLevelGpuProgramPtr vp =
  148. HighLevelGpuProgramManager::instance().create(
  149. hlslSourceFromCg, "main", "hlsl", mType, mProfile);
  150. vp->initialize();
  151. mAssemblerProgram = vp;
  152. }
  153. else
  154. {
  155. String shaderAssemblerCode = cgGetProgramString(mCgProgram, CG_COMPILED_PROGRAM);
  156. // Create a low-level program, give it the same name as us
  157. mAssemblerProgram =
  158. GpuProgramManager::instance().createProgram(
  159. shaderAssemblerCode, "", mSelectedProfile,
  160. mType,
  161. GPP_NONE);
  162. }
  163. // Shader params need to be forwarded to low level implementation
  164. mAssemblerProgram->setAdjacencyInfoRequired(isAdjacencyInfoRequired());
  165. }
  166. }
  167. //-----------------------------------------------------------------------
  168. void CgProgram::unload_internal(void)
  169. {
  170. // Unload Cg Program
  171. // Lowlevel program will get unloaded elsewhere
  172. if (mCgProgram)
  173. {
  174. cgDestroyProgram(mCgProgram);
  175. checkForCgError("CgProgram::unloadImpl",
  176. "Error while unloading Cg program",
  177. mCgContext);
  178. mCgProgram = 0;
  179. }
  180. HighLevelGpuProgram::unload_internal();
  181. }
  182. //-----------------------------------------------------------------------
  183. void CgProgram::buildConstantDefinitions() const
  184. {
  185. // Derive parameter names from Cg
  186. createParameterMappingStructures(true);
  187. if (!mCgProgram)
  188. return;
  189. recurseParams(cgGetFirstParameter(mCgProgram, CG_PROGRAM));
  190. recurseParams(cgGetFirstParameter(mCgProgram, CG_GLOBAL));
  191. }
  192. //---------------------------------------------------------------------
  193. void CgProgram::recurseParams(CGparameter parameter, UINT32 contextArraySize) const
  194. {
  195. while (parameter != 0)
  196. {
  197. // Look for parameters
  198. // Don't bother enumerating unused parameters, especially since they will
  199. // be optimised out and therefore not in the indexed versions
  200. CGtype paramType = cgGetParameterType(parameter);
  201. if (cgGetParameterVariability(parameter) == CG_UNIFORM &&
  202. paramType != CG_SAMPLERRECT &&
  203. cgGetParameterDirection(parameter) != CG_OUT &&
  204. cgIsParameterReferenced(parameter))
  205. {
  206. int arraySize;
  207. switch(paramType)
  208. {
  209. case CG_STRUCT:
  210. recurseParams(cgGetFirstStructParameter(parameter));
  211. break;
  212. case CG_ARRAY:
  213. // Support only 1-dimensional arrays
  214. arraySize = cgGetArraySize(parameter, 0);
  215. recurseParams(cgGetArrayParameter(parameter, 0), (size_t)arraySize);
  216. break;
  217. default:
  218. // Normal path (leaf)
  219. String paramName = cgGetParameterName(parameter);
  220. UINT32 logicalIndex = (UINT32)cgGetParameterResourceIndex(parameter);
  221. // Get the parameter resource, to calculate the physical index
  222. CGresource res = cgGetParameterResource(parameter);
  223. bool isRegisterCombiner = false;
  224. UINT32 regCombinerPhysicalIndex = 0;
  225. switch (res)
  226. {
  227. case CG_COMBINER_STAGE_CONST0:
  228. // register combiner, const 0
  229. // the index relates to the texture stage; store this as (stage * 2) + 0
  230. regCombinerPhysicalIndex = logicalIndex * 2;
  231. isRegisterCombiner = true;
  232. break;
  233. case CG_COMBINER_STAGE_CONST1:
  234. // register combiner, const 1
  235. // the index relates to the texture stage; store this as (stage * 2) + 1
  236. regCombinerPhysicalIndex = (logicalIndex * 2) + 1;
  237. isRegisterCombiner = true;
  238. break;
  239. default:
  240. // normal constant
  241. break;
  242. }
  243. // Trim the '[0]' suffix if it exists, we will add our own indexing later
  244. if (StringUtil::endsWith(paramName, "[0]", false))
  245. {
  246. paramName.erase(paramName.size() - 3);
  247. }
  248. GpuConstantDefinition def;
  249. def.arraySize = contextArraySize;
  250. mapTypeAndElementSize(paramType, isRegisterCombiner, def);
  251. if (def.constType == GCT_UNKNOWN)
  252. {
  253. gDebug().log("Problem parsing the following Cg Uniform: '" + paramName + "'", "RenderSystem");
  254. // next uniform
  255. parameter = cgGetNextParameter(parameter);
  256. continue;
  257. }
  258. if (isRegisterCombiner)
  259. {
  260. def.physicalIndex = regCombinerPhysicalIndex;
  261. }
  262. else
  263. {
  264. // base position on existing buffer contents
  265. if(def.isSampler())
  266. {
  267. def.physicalIndex = mSamplerLogicalToPhysical->bufferSize;
  268. }
  269. else
  270. {
  271. if (def.isFloat())
  272. {
  273. def.physicalIndex = mFloatLogicalToPhysical->bufferSize;
  274. }
  275. else
  276. {
  277. def.physicalIndex = mIntLogicalToPhysical->bufferSize;
  278. }
  279. }
  280. }
  281. def.logicalIndex = logicalIndex;
  282. mConstantDefs->map.insert(GpuConstantDefinitionMap::value_type(paramName, def));
  283. // Record logical / physical mapping
  284. if(def.isSampler())
  285. {
  286. CM_LOCK_MUTEX(mSamplerLogicalToPhysical->mutex)
  287. mSamplerLogicalToPhysical->map.insert(
  288. GpuLogicalIndexUseMap::value_type(logicalIndex,
  289. GpuLogicalIndexUse(def.physicalIndex, def.arraySize, GPV_GLOBAL)));
  290. mSamplerLogicalToPhysical->bufferSize += def.arraySize;
  291. mConstantDefs->samplerCount = mSamplerLogicalToPhysical->bufferSize;
  292. }
  293. else
  294. {
  295. if (def.isFloat())
  296. {
  297. CM_LOCK_MUTEX(mFloatLogicalToPhysical->mutex)
  298. mFloatLogicalToPhysical->map.insert(
  299. GpuLogicalIndexUseMap::value_type(logicalIndex,
  300. GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize, GPV_GLOBAL)));
  301. mFloatLogicalToPhysical->bufferSize += def.arraySize * def.elementSize;
  302. mConstantDefs->floatBufferSize = mFloatLogicalToPhysical->bufferSize;
  303. }
  304. else
  305. {
  306. CM_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
  307. mIntLogicalToPhysical->map.insert(
  308. GpuLogicalIndexUseMap::value_type(logicalIndex,
  309. GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize, GPV_GLOBAL)));
  310. mIntLogicalToPhysical->bufferSize += def.arraySize * def.elementSize;
  311. mConstantDefs->intBufferSize = mIntLogicalToPhysical->bufferSize;
  312. }
  313. }
  314. // Deal with array indexing
  315. mConstantDefs->generateConstantDefinitionArrayEntries(paramName, def);
  316. break;
  317. }
  318. }
  319. // Get next
  320. parameter = cgGetNextParameter(parameter);
  321. }
  322. }
  323. //-----------------------------------------------------------------------
  324. void CgProgram::mapTypeAndElementSize(CGtype cgType, bool isRegisterCombiner,
  325. GpuConstantDefinition& def) const
  326. {
  327. if (isRegisterCombiner)
  328. {
  329. // register combiners are the only single-float entries in our buffer
  330. def.constType = GCT_FLOAT1;
  331. def.elementSize = 1;
  332. }
  333. else
  334. {
  335. switch(cgType)
  336. {
  337. case CG_SAMPLER1D:
  338. def.constType = GCT_SAMPLER1D;
  339. break;
  340. case CG_SAMPLER2D:
  341. def.constType = GCT_SAMPLER2D;
  342. break;
  343. case CG_SAMPLER3D:
  344. def.constType = GCT_SAMPLER3D;
  345. break;
  346. case CG_SAMPLERCUBE:
  347. def.constType = GCT_SAMPLERCUBE;
  348. break;
  349. case CG_FLOAT:
  350. case CG_FLOAT1:
  351. case CG_HALF:
  352. case CG_HALF1:
  353. def.constType = GCT_FLOAT1;
  354. break;
  355. case CG_FLOAT2:
  356. case CG_HALF2:
  357. def.constType = GCT_FLOAT2;
  358. break;
  359. case CG_FLOAT3:
  360. case CG_HALF3:
  361. def.constType = GCT_FLOAT3;
  362. break;
  363. case CG_FLOAT4:
  364. case CG_HALF4:
  365. def.constType = GCT_FLOAT4;
  366. break;
  367. case CG_FLOAT2x2:
  368. case CG_HALF2x2:
  369. def.constType = GCT_MATRIX_2X2;
  370. break;
  371. case CG_FLOAT2x3:
  372. case CG_HALF2x3:
  373. def.constType = GCT_MATRIX_2X3;
  374. break;
  375. case CG_FLOAT2x4:
  376. case CG_HALF2x4:
  377. def.constType = GCT_MATRIX_2X4;
  378. break;
  379. case CG_FLOAT3x2:
  380. case CG_HALF3x2:
  381. def.constType = GCT_MATRIX_3X2;
  382. break;
  383. case CG_FLOAT3x3:
  384. case CG_HALF3x3:
  385. def.constType = GCT_MATRIX_3X3;
  386. break;
  387. case CG_FLOAT3x4:
  388. case CG_HALF3x4:
  389. def.constType = GCT_MATRIX_3X4;
  390. break;
  391. case CG_FLOAT4x2:
  392. case CG_HALF4x2:
  393. def.constType = GCT_MATRIX_4X2;
  394. break;
  395. case CG_FLOAT4x3:
  396. case CG_HALF4x3:
  397. def.constType = GCT_MATRIX_4X3;
  398. break;
  399. case CG_FLOAT4x4:
  400. case CG_HALF4x4:
  401. def.constType = GCT_MATRIX_4X4;
  402. break;
  403. case CG_INT:
  404. case CG_INT1:
  405. def.constType = GCT_INT1;
  406. break;
  407. case CG_INT2:
  408. def.constType = GCT_INT2;
  409. break;
  410. case CG_INT3:
  411. def.constType = GCT_INT3;
  412. break;
  413. case CG_INT4:
  414. def.constType = GCT_INT4;
  415. break;
  416. default:
  417. def.constType = GCT_UNKNOWN;
  418. break;
  419. }
  420. // Cg pads
  421. def.elementSize = GpuConstantDefinition::getElementSize(def.constType, true);
  422. }
  423. }
  424. //-----------------------------------------------------------------------
  425. CgProgram::CgProgram(CGcontext context, const String& source, const String& entryPoint, const String& language,
  426. GpuProgramType gptype, GpuProgramProfile profile, bool isAdjacencyInfoRequired)
  427. : HighLevelGpuProgram(source, entryPoint, language, gptype, profile, isAdjacencyInfoRequired),
  428. mCgContext(context), mCgProgram(0),
  429. mSelectedCgProfile(CG_PROFILE_UNKNOWN), mCgArguments(0)
  430. {
  431. }
  432. //-----------------------------------------------------------------------
  433. CgProgram::~CgProgram()
  434. {
  435. freeCgArgs();
  436. unload_internal();
  437. }
  438. //-----------------------------------------------------------------------
  439. bool CgProgram::isSupported(void) const
  440. {
  441. if (mCompileError || !isRequiredCapabilitiesSupported())
  442. return false;
  443. String selectedProfile = GpuProgramManager::instance().gpuProgProfileToRSSpecificProfile(mProfile);
  444. if (GpuProgramManager::instance().isSyntaxSupported(selectedProfile))
  445. return true;
  446. return false;
  447. }
  448. //-----------------------------------------------------------------------
  449. String CgProgram::resolveCgIncludes(const String& inSource, Resource* resourceBeingLoaded, const String& fileName)
  450. {
  451. String outSource;
  452. // TODO PORT - Includes are not handled ATM
  453. // output will be at least this big
  454. //outSource.reserve(inSource.length());
  455. //size_t startMarker = 0;
  456. //size_t i = inSource.find("#include");
  457. //while (i != String::npos)
  458. //{
  459. // size_t includePos = i;
  460. // size_t afterIncludePos = includePos + 8;
  461. // size_t newLineBefore = inSource.rfind("\n", includePos);
  462. // // check we're not in a comment
  463. // size_t lineCommentIt = inSource.rfind("//", includePos);
  464. // if (lineCommentIt != String::npos)
  465. // {
  466. // if (newLineBefore == String::npos || lineCommentIt > newLineBefore)
  467. // {
  468. // // commented
  469. // i = inSource.find("#include", afterIncludePos);
  470. // continue;
  471. // }
  472. // }
  473. // size_t blockCommentIt = inSource.rfind("/*", includePos);
  474. // if (blockCommentIt != String::npos)
  475. // {
  476. // size_t closeCommentIt = inSource.rfind("*/", includePos);
  477. // if (closeCommentIt == String::npos || closeCommentIt < blockCommentIt)
  478. // {
  479. // // commented
  480. // i = inSource.find("#include", afterIncludePos);
  481. // continue;
  482. // }
  483. // }
  484. // // find following newline (or EOF)
  485. // size_t newLineAfter = inSource.find("\n", afterIncludePos);
  486. // // find include file string container
  487. // String endDelimeter = "\"";
  488. // size_t startIt = inSource.find("\"", afterIncludePos);
  489. // if (startIt == String::npos || startIt > newLineAfter)
  490. // {
  491. // // try <>
  492. // startIt = inSource.find("<", afterIncludePos);
  493. // if (startIt == String::npos || startIt > newLineAfter)
  494. // {
  495. // CM_EXCEPT(InternalErrorException,
  496. // "Badly formed #include directive (expected \" or <) in file "
  497. // + fileName + ": " + inSource.substr(includePos, newLineAfter-includePos));
  498. // }
  499. // else
  500. // {
  501. // endDelimeter = ">";
  502. // }
  503. // }
  504. // size_t endIt = inSource.find(endDelimeter, startIt+1);
  505. // if (endIt == String::npos || endIt <= startIt)
  506. // {
  507. // CM_EXCEPT(InternalErrorException,
  508. // "Badly formed #include directive (expected " + endDelimeter + ") in file "
  509. // + fileName + ": " + inSource.substr(includePos, newLineAfter-includePos));
  510. // }
  511. // // extract filename
  512. // String filename(inSource.substr(startIt+1, endIt-startIt-1));
  513. // // open included file
  514. // DataStreamPtr resource = ResourceGroupManager::getSingleton().
  515. // openResource(filename, resourceBeingLoaded->getGroup(), true, resourceBeingLoaded);
  516. // // replace entire include directive line
  517. // // copy up to just before include
  518. // if (newLineBefore != String::npos && newLineBefore >= startMarker)
  519. // outSource.append(inSource.substr(startMarker, newLineBefore-startMarker+1));
  520. // size_t lineCount = 0;
  521. // size_t lineCountPos = 0;
  522. //
  523. // // Count the line number of #include statement
  524. // lineCountPos = outSource.find('\n');
  525. // while(lineCountPos != String::npos)
  526. // {
  527. // lineCountPos = outSource.find('\n', lineCountPos+1);
  528. // lineCount++;
  529. // }
  530. // // Add #line to the start of the included file to correct the line count
  531. // outSource.append("#line 1 \"" + filename + "\"\n");
  532. // outSource.append(resource->getAsString());
  533. // // Add #line to the end of the included file to correct the line count
  534. // outSource.append("\n#line " + toString(lineCount) +
  535. // "\"" + fileName + "\"\n");
  536. // startMarker = newLineAfter;
  537. // if (startMarker != String::npos)
  538. // i = inSource.find("#include", startMarker);
  539. // else
  540. // i = String::npos;
  541. //}
  542. //// copy any remaining characters
  543. //outSource.append(inSource.substr(startMarker));
  544. return outSource;
  545. }
  546. //-----------------------------------------------------------------------
  547. const String& CgProgram::getLanguage(void) const
  548. {
  549. static const String language = "cg";
  550. return language;
  551. }
  552. /************************************************************************/
  553. /* SERIALIZATION */
  554. /************************************************************************/
  555. RTTITypeBase* CgProgram::getRTTIStatic()
  556. {
  557. return CgProgramRTTI::instance();
  558. }
  559. RTTITypeBase* CgProgram::getRTTI() const
  560. {
  561. return CgProgram::getRTTIStatic();
  562. }
  563. }