浏览代码

Avoid GC pressure by caching camera profiler tag.

/main
Felipe Lira 7 年前
当前提交
a96f6a59
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 6
      com.unity.render-pipelines.lightweight/LWRP/LightweightPipeline.cs

6
com.unity.render-pipelines.lightweight/LWRP/LightweightPipeline.cs


List<int> m_LocalLightIndices = new List<int>();
bool m_IsCameraRendering;
const string k_CameraProfilerTag = "Render Camera";
public LightweightPipeline(LightweightPipelineAsset asset)
{

foreach (Camera camera in cameras)
{
BeginCameraRendering(camera);
string renderCameraTag = "Render " + camera.name;
CommandBuffer cmd = CommandBufferPool.Get(renderCameraTag);
using (new ProfilingSample(cmd, renderCameraTag))
CommandBuffer cmd = CommandBufferPool.Get(k_CameraProfilerTag);
using (new ProfilingSample(cmd, k_CameraProfilerTag))
{
CameraData cameraData;
InitializeCameraData(camera, out cameraData);

正在加载...
取消
保存