浏览代码

adding profiling to C# scriptable loop code

/Branch_Batching2
Arnaud Carre 7 年前
当前提交
048901c2
共有 2 个文件被更改,包括 7 次插入1001 次删除
  1. 1001
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 7
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs

1001
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
文件差异内容过多而无法显示
查看文件

7
Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs


using UnityObject = UnityEngine.Object;
using System.Reflection;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.Profiling;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{

bool disposed;
CommandBuffer cmd;
string name;
CustomSampler sampler;
public ProfilingSample(string _name, CommandBuffer _cmd)
{

cmd.BeginSample(name);
// Profiler.BeginSample("Direct_" + _name);
sampler = CustomSampler.Create("Direct_" + _name);
sampler.Begin();
}
public void Dispose()

if (disposing)
{
cmd.EndSample(name);
// Profiler.EndSample();
sampler.End();
}
disposed = true;

正在加载...
取消
保存