浏览代码

Fix feedback from PR

/main
Tim Cooper 8 年前
当前提交
0f344926
共有 4 个文件被更改,包括 17 次插入18 次删除
  1. 12
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 6
      Assets/ScriptableRenderLoop/core/RenderPipeline.cs
  3. 5
      Assets/ScriptableRenderLoop/core/RenderingDataStore.cs
  4. 12
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs

12
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


protected override void InternalBuild()
{
base.InternalBuild();
HDRenderLoop realOwner = GetRealOwner<HDRenderLoop>();
realOwner.Build();
HDRenderLoop theOwner = owner as HDRenderLoop;
if (theOwner != null)
theOwner.Build();
base.InternalBuild();
HDRenderLoop realOwner = GetRealOwner<HDRenderLoop>();
realOwner.Cleanup();
base.InternalCleanup();
HDRenderLoop theOwner = owner as HDRenderLoop;
if (theOwner != null)
theOwner.Cleanup();
}
}

6
Assets/ScriptableRenderLoop/core/RenderPipeline.cs


public override void Render(ScriptableRenderContext renderContext, IScriptableRenderDataStore dataStore)
{
if (dataStore == null)
throw new ArgumentException(string.Format("DataStore has been passed into pipe {0}", this));
throw new ArgumentException(string.Format("Null DataStore has been passed into pipe {0}", this));
throw new ArgumentException(string.Format("DataStore owner is not set to {0}", this));
throw new ArgumentException(string.Format("DataStore owner is null. It needs o be owned by loop {0}", this));
if (dataStore.owner != null && !ReferenceEquals(dataStore.owner, this))
throw new ArgumentException(string.Format("DataStore {0} has been passed into pipe {1}, but is owned by {2}", dataStore, this, dataStore.owner));

}
public override void Cleanup()
public override void ClearCachedData()
{
foreach (var store in m_AssociatedDataStores)
store.Cleanup();

5
Assets/ScriptableRenderLoop/core/RenderingDataStore.cs


{}
public IRenderPipeline owner { get; private set; }
public T GetRealOwner<T>() where T : IRenderPipeline
{
return (T)owner;
}
}
}

12
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


protected override void InternalBuild()
{
base.InternalBuild();
FptlLighting realOwner = GetRealOwner<FptlLighting>();
realOwner.Build();
FptlLighting theOwner = owner as FptlLighting;
if (theOwner != null)
theOwner.Build();
base.InternalBuild();
FptlLighting realOwner = GetRealOwner<FptlLighting>();
realOwner.Cleanup();
base.InternalCleanup();
FptlLighting theOwner = owner as FptlLighting;
if (owner != null)
theOwner.Cleanup();
}
}

正在加载...
取消
保存