Axiom.Graphics.CompositionTechnique.IsSupported C# (CSharp) Method

IsSupported() public method

Determine if this technique is supported on the current rendering device.
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
public IsSupported ( bool allowTextureDegradation ) : bool
allowTextureDegradation bool True to accept a reduction in texture depth
return bool
		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;
		}
	}