EffectSpecSharedPtr EffectLibraryImpl::registerSpec( const EffectSpecSharedPtr& effectSpec, EffectLoader* effectLoader ) { DP_ASSERT( effectSpec ); EffectSpecs::iterator it = m_effectSpecs.find( effectSpec->getName() ); if ( it != m_effectSpecs.end() ) { DP_ASSERT( it->second.effectLoader == effectLoader ); DP_ASSERT( it->second.effectSpec->isEquivalent( effectSpec, false, false ) ); DP_ASSERT( !m_currentFile.empty() && ( it->second.effectFile == m_currentFile.top() ) ); return it->second.effectSpec; } else { m_effectSpecs[ effectSpec->getName()] = EffectSpecInfo( effectSpec, effectLoader, m_currentFile.top() ); // create EffectData for default values of EffectSpec EffectDataPrivateSharedPtr effectData = EffectDataPrivate::create( effectSpec, effectSpec->getName() ); for ( EffectSpec::iterator it = effectSpec->beginParameterGroupSpecs(); it != effectSpec->endParameterGroupSpecs(); ++it ) { effectData->setParameterGroupData( it, getParameterGroupData( (*it)->getName() ) ); } registerEffectData( effectData ); return effectSpec; } }
bool EffectLibraryImpl::effectHasTechnique( EffectSpecSharedPtr const& effectSpec, std::string const& techniqueName, bool rasterizer ) const { EffectSpecs::const_iterator it = m_effectSpecs.find( effectSpec->getName() ); if ( it != m_effectSpecs.end() ) { return( it->second.effectLoader->effectHasTechnique( effectSpec, techniqueName, rasterizer ) ); } return( false ); }