浏览代码

Pipeline always respects user decision to not clear camera even if it impacts performance on mobile.

/2018.1
Felipe Lira 7 年前
当前提交
27a4d825
共有 1 个文件被更改,包括 7 次插入21 次删除
  1. 28
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

28
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


depthRT = m_DepthRT;
}
if (ForceClear())
ClearFlag clearFlag = ClearFlag.None;
CameraClearFlags cameraClearFlags = m_CurrCamera.clearFlags;
if (cameraClearFlags != CameraClearFlags.Nothing)
SetRenderTarget(cmd, colorRT, depthRT, ClearFlag.All);
clearFlag |= ClearFlag.Depth;
if (cameraClearFlags == CameraClearFlags.Color || cameraClearFlags == CameraClearFlags.Skybox)
clearFlag |= ClearFlag.Color;
else
{
ClearFlag clearFlag = ClearFlag.None;
CameraClearFlags cameraClearFlags = m_CurrCamera.clearFlags;
if (cameraClearFlags != CameraClearFlags.Nothing)
{
clearFlag |= ClearFlag.Depth;
if (cameraClearFlags == CameraClearFlags.Color || cameraClearFlags == CameraClearFlags.Skybox)
clearFlag |= ClearFlag.Color;
}
SetRenderTarget(cmd, colorRT, depthRT, clearFlag);
}
SetRenderTarget(cmd, colorRT, depthRT, clearFlag);
// If rendering to an intermediate RT we resolve viewport on blit due to offset not being supported
// while rendering to a RT.

private int GetLightUnsortedIndex(int index)
{
return (index < m_SortedLightIndexMap.Count) ? m_SortedLightIndexMap[index] : index;
}
private bool ForceClear()
{
// Clear RenderTarget to avoid tile initialization on mobile GPUs
// https://community.arm.com/graphics/b/blog/posts/mali-performance-2-how-to-correctly-handle-framebuffers
return (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer);
}
private void Blit(CommandBuffer cmd, FrameRenderingConfiguration renderingConfig, RenderTargetIdentifier sourceRT, RenderTargetIdentifier destRT, Material material = null)

正在加载...
取消
保存