-------------------------------------------------------------------------
| 496 | } |
| 497 | //------------------------------------------------------------------------- |
| 498 | void RootLayout::validateArrayBindings( const RootLayout &groundTruth, const String &filename ) const |
| 499 | { |
| 500 | for( size_t i = DescBindingTypes::ParamBuffer + 1u; i < DescBindingTypes::NumDescBindingTypes; |
| 501 | ++i ) |
| 502 | { |
| 503 | FastArray<uint32>::const_iterator itor = groundTruth.mArrayRanges[i].begin(); |
| 504 | FastArray<uint32>::const_iterator endt = groundTruth.mArrayRanges[i].end(); |
| 505 | |
| 506 | while( itor != endt ) |
| 507 | { |
| 508 | FastArray<uint32>::const_iterator itFind = |
| 509 | std::lower_bound( mArrayRanges[i].begin(), mArrayRanges[i].end(), *itor ); |
| 510 | |
| 511 | if( itFind == mArrayRanges[i].end() || *itFind != *itor ) |
| 512 | { |
| 513 | String dumpStr; |
| 514 | dumpStr = "Error in " + filename + |
| 515 | " the Root Layout does not contain arrays declared in the shader.\n" |
| 516 | "Fix the Root layout, or set " |
| 517 | "GpuProgram::setRootLayout(bReflectArrayRootLayouts=true) or " |
| 518 | "set uses_array_bindings = true\n\n" |
| 519 | "Original Root Layout:\n"; |
| 520 | dump( dumpStr ); |
| 521 | |
| 522 | dumpStr += |
| 523 | "\n\nAuto-generated Root Layout from shader data:\n" |
| 524 | "## ROOT LAYOUT BEGIN\n"; |
| 525 | groundTruth.dump( dumpStr ); |
| 526 | dumpStr += "\n## ROOT LAYOUT END"; |
| 527 | |
| 528 | LogManager::getSingleton().logMessage( dumpStr, LML_CRITICAL ); |
| 529 | |
| 530 | OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, |
| 531 | "Error at file " + filename + ":\n" + |
| 532 | "The Root Layout does not contain arrays declared in the " |
| 533 | "shader.\n" |
| 534 | "See log for more info.", |
| 535 | "RootLayout::validateArrayBindings" ); |
| 536 | } |
| 537 | |
| 538 | ++itor; |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | //------------------------------------------------------------------------- |
| 543 | void RootLayout::parseRootLayout( const char *rootLayout, const bool bCompute, |
| 544 | const String &filename ) |
no test coverage detected