|
|
|
|
|
|
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; |
|
|
|