public virtual bool IsSupported( bool allowTextureDegradation )
{
// Check output target pass is supported
if ( !this.outputTarget.IsSupported )
{
return false;
}
// Check all target passes is supported
foreach ( CompositionTargetPass targetPass in this.targetPasses )
{
if ( !targetPass.IsSupported )
{
return false;
}
}
TextureManager texMgr = TextureManager.Instance;
// Check all Texture Definitions is supported
foreach ( TextureDefinition td in this.textureDefinitions )
{
// Firstly check MRTs
if ( td.PixelFormats.Count > Root.Instance.RenderSystem.Capabilities.MultiRenderTargetCount )
{
return false;
}
foreach ( PixelFormat pf in td.PixelFormats )
{
// Check whether equivalent supported
if ( allowTextureDegradation )
{
// Don't care about exact format so long as something is supported
if ( texMgr.GetNativeFormat( TextureType.TwoD, pf, TextureUsage.RenderTarget ) == PixelFormat.Unknown )
{
return false;
}
}
else
{
// Need a format which is the same number of bits to pass
if ( !texMgr.IsEquivalentFormatSupported( TextureType.TwoD, pf, TextureUsage.RenderTarget ) )
{
return false;
}
}
}
}
// must be ok
return true;
}
}