-----------------------------------------------------------------------------
| 80 | void GpuProgram::setType( GpuProgramType t ) { mType = t; } |
| 81 | //----------------------------------------------------------------------------- |
| 82 | void GpuProgram::setRootLayout( GpuProgramType t, const RootLayout &rootLayout ) |
| 83 | { |
| 84 | setType( t ); |
| 85 | |
| 86 | const bool bIsCompute = mType == GPT_COMPUTE_PROGRAM; |
| 87 | if( bIsCompute != rootLayout.mCompute ) |
| 88 | { |
| 89 | OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, |
| 90 | "RootLayout::mCompute disagrees with GpuProgramType", |
| 91 | "GpuProgram::setRootLayout" ); |
| 92 | } |
| 93 | |
| 94 | #if OGRE_DEBUG_MODE >= OGRE_DEBUG_LOW |
| 95 | try |
| 96 | { |
| 97 | // In OGRE_DEBUG_NONE we assume programmatically generated |
| 98 | // root layouts are well formed to speed up compilation |
| 99 | rootLayout.validate( mName ); |
| 100 | } |
| 101 | catch( Exception & ) |
| 102 | { |
| 103 | String dumpStr; |
| 104 | dumpStr = "Error in " + mName + " with its Root Layout:\n"; |
| 105 | rootLayout.dump( dumpStr ); |
| 106 | LogManager::getSingleton().logMessage( dumpStr, LML_CRITICAL ); |
| 107 | throw; |
| 108 | } |
| 109 | #endif |
| 110 | } |
| 111 | //----------------------------------------------------------------------------- |
| 112 | void GpuProgram::unsetRootLayout() {} |
| 113 | //----------------------------------------------------------------------------- |
no test coverage detected