-------------------------------------------------------------------------
| 453 | } |
| 454 | //------------------------------------------------------------------------- |
| 455 | void RootLayout::addArrayBinding( DescBindingTypes::DescBindingTypes bindingType, |
| 456 | ArrayDesc arrayDesc ) |
| 457 | { |
| 458 | OGRE_ASSERT_LOW( bindingType != DescBindingTypes::ParamBuffer ); |
| 459 | OGRE_ASSERT_LOW( arrayDesc.arraySize > 0u ); |
| 460 | |
| 461 | if( !mArrayRanges[bindingType].empty() ) |
| 462 | { |
| 463 | const ArrayDesc lastElem = ArrayDesc::fromKey( mArrayRanges[bindingType].back() ); |
| 464 | if( arrayDesc.bindingIdx <= lastElem.bindingIdx ) |
| 465 | { |
| 466 | OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Elements must be added in order", |
| 467 | "RootLayout::addArrayBinding" ); |
| 468 | } |
| 469 | |
| 470 | if( lastElem.bindingIdx + lastElem.arraySize > arrayDesc.bindingIdx ) |
| 471 | { |
| 472 | OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Elements must not overlap", |
| 473 | "RootLayout::addArrayBinding" ); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | mArrayRanges[bindingType].push_back( arrayDesc.toKey() ); |
| 478 | } |
| 479 | //------------------------------------------------------------------------- |
| 480 | void RootLayout::copyFrom( const RootLayout &other, bool bIncludeArrayBindings ) |
| 481 | { |
no test coverage detected