本文整理汇总了C++中CompositionTargetPass::_isSupported方法的典型用法代码示例。如果您正苦于以下问题:C++ CompositionTargetPass::_isSupported方法的具体用法?C++ CompositionTargetPass::_isSupported怎么用?C++ CompositionTargetPass::_isSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompositionTargetPass
的用法示例。
在下文中一共展示了CompositionTargetPass::_isSupported方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isSupported
//-----------------------------------------------------------------------
bool CompositionTechnique::isSupported(bool acceptTextureDegradation)
{
// A technique is supported if all materials referenced have a supported
// technique, and the intermediate texture formats requested are supported
// Material support is a cast-iron requirement, but if no texture formats
// are directly supported we can let the rendersystem create the closest
// match for the least demanding technique
// Check output target pass is supported
if (!mOutputTarget->_isSupported())
{
return false;
}
// Check all target passes is supported
TargetPasses::iterator pi, piend;
piend = mTargetPasses.end();
for (pi = mTargetPasses.begin(); pi != piend; ++pi)
{
CompositionTargetPass* targetPass = *pi;
if (!targetPass->_isSupported())
{
return false;
}
}
TextureDefinitions::iterator i, iend;
iend = mTextureDefinitions.end();
TextureManager& texMgr = TextureManager::getSingleton();
for (i = mTextureDefinitions.begin(); i != iend; ++i)
{
TextureDefinition* td = *i;
// Firstly check MRTs
if (td->formatList.size() >
Root::getSingleton().getRenderSystem()->getCapabilities()->getNumMultiRenderTargets())
{
return false;
}
for (PixelFormatList::iterator pfi = td->formatList.begin(); pfi != td->formatList.end(); ++pfi)
{
// Check whether equivalent supported
if(acceptTextureDegradation)
{
// Don't care about exact format so long as something is supported
if(texMgr.getNativeFormat(TEX_TYPE_2D, *pfi, TU_RENDERTARGET) == PF_UNKNOWN)
{
return false;
}
}
else
{
// Need a format which is the same number of bits to pass
if (!texMgr.isEquivalentFormatSupported(TEX_TYPE_2D, *pfi, TU_RENDERTARGET))
{
return false;
}
}
}
//Check all render targets have same number of bits
if( !Root::getSingleton().getRenderSystem()->getCapabilities()->
hasCapability( RSC_MRT_DIFFERENT_BIT_DEPTHS ) && !td->formatList.empty() )
{
PixelFormat nativeFormat = texMgr.getNativeFormat( TEX_TYPE_2D, td->formatList.front(),
TU_RENDERTARGET );
size_t nativeBits = PixelUtil::getNumElemBits( nativeFormat );
for( PixelFormatList::iterator pfi = td->formatList.begin()+1;
pfi != td->formatList.end(); ++pfi )
{
PixelFormat nativeTmp = texMgr.getNativeFormat( TEX_TYPE_2D, *pfi, TU_RENDERTARGET );
if( PixelUtil::getNumElemBits( nativeTmp ) != nativeBits )
{
return false;
}
}
}
}
// Must be ok
return true;
}