private void DeriveTextureRenderTargetOptions( string texname, out bool hwGammaWrite, out int fsaa, out string fsaaHint )
{
// search for passes on this texture def that either include a render_scene
// or use input previous
bool renderingScene = false;
foreach ( CompositionTargetPass tp in technique.TargetPasses )
{
if ( tp.OutputName == texname )
{
if ( tp.InputMode == CompositorInputMode.Previous )
{
// this may be rendering the scene implicitly
// Can't check _previousInstance against _Chain.OriginalSceneCompositor
// at this time, so check the position
renderingScene = true;
foreach ( CompositorInstance inst in chain.Instances )
{
if ( inst == this )
{
break;
}
else if ( inst.IsEnabled )
{
// nope, we have another compositor before us, this will
// be doing the AA
renderingScene = false;
}
}
if ( renderingScene )
{
break;
}
}
else
{
// look for a render_scene pass
foreach ( CompositionPass pass in tp.Passes )
{
if ( pass.Type == CompositorPassType.RenderScene )
{
renderingScene = true;
break;
}
}
}
}
}
if ( renderingScene )
{
// Ok, inherit settings from target
RenderTarget target = chain.Viewport.Target;
hwGammaWrite = target.IsHardwareGammaEnabled;
fsaa = target.FSAA;
fsaaHint = target.FSAAHint;
}
else
{
hwGammaWrite = false;
fsaa = 0;
fsaaHint = string.Empty;
}
}