コード例 #1
0
        public ProfilerCounter(ProfilerCategory category, string name, ProfilerMarkerDataUnit dataUnit)
        {
#if ENABLE_PROFILER
            m_Type = ProfilerUtility.GetProfilerMarkerDataType <T>();
            m_Ptr  = ProfilerUnsafeUtility.CreateMarker(name, category, MarkerFlags.Counter, 1);
            ProfilerUnsafeUtility.SetMarkerMetadata(m_Ptr, 0, null, m_Type, (byte)dataUnit);
#endif
        }
コード例 #2
0
        public ProfilerMarker(ProfilerCategory category, string name, string param1Name)
        {
#if ENABLE_PROFILER
            m_P1Type = ProfilerUtility.GetProfilerMarkerDataType <TP1>();
            m_Ptr    = ProfilerUnsafeUtility.CreateMarker(name, category, MarkerFlags.Default, 1);
            ProfilerUnsafeUtility.SetMarkerMetadata(m_Ptr, 0, param1Name, m_P1Type, (byte)ProfilerMarkerDataUnit.Undefined);
#endif
        }
コード例 #3
0
        public static unsafe void BeginSample(string s)
        {
#if ENABLE_PROFILER
            // Just gets the marker if it already exists - this is much slower than using ProfilerMarker objects though
            // because they just store the marker internally for reuse (avoiding a lot of potential string comparisons)
            IntPtr marker = ProfilerUnsafeUtility.CreateMarker(s, ProfilerUnsafeUtility.InternalCategoryInternal, MarkerFlags.Default, 0);
            ProfilerUnsafeUtility.BeginSample(marker);
            ProfilerProtocolThread.Stream.markerStack.PushMarker(marker);
#endif
        }
コード例 #4
0
        public static CustomSampler Create(string name, bool collectGpuData = false)
        {
            IntPtr nativeSampler = ProfilerUnsafeUtility.CreateMarker(name, ProfilerUnsafeUtility.CategoryScripts, MarkerFlags.Default | (collectGpuData ? MarkerFlags.SampleGPU : 0), 0);

            if (nativeSampler == IntPtr.Zero)
            {
                return(s_InvalidCustomSampler);
            }
            return(new CustomSampler(nativeSampler));
        }
コード例 #5
0
        public static ProfilerMarkerWithStringData Create(string name, string parameterName)
        {
            var marker = ProfilerUnsafeUtility.CreateMarker(name, ProfilerUnsafeUtility.CategoryOther, MarkerFlags.Default, 1);

            ProfilerUnsafeUtility.SetMarkerMetadata(marker, 0, parameterName, (byte)ProfilerMarkerDataType.String16, 0);
            return(new ProfilerMarkerWithStringData
            {
                _marker = marker
            });
        }
コード例 #6
0
        public ProfilerMarker(string name, string param1Name, string param2Name, string param3Name)
        {
#if ENABLE_PROFILER
            m_P1Type = ProfilerUtility.GetProfilerMarkerDataType <TP1>();
            m_P2Type = ProfilerUtility.GetProfilerMarkerDataType <TP2>();
            m_P3Type = ProfilerUtility.GetProfilerMarkerDataType <TP3>();
            m_Ptr    = ProfilerUnsafeUtility.CreateMarker(name, ProfilerUnsafeUtility.CategoryScripts, MarkerFlags.Default, 3);
            ProfilerUnsafeUtility.SetMarkerMetadata(m_Ptr, 0, param1Name, m_P1Type, (byte)ProfilerMarkerDataUnit.Undefined);
            ProfilerUnsafeUtility.SetMarkerMetadata(m_Ptr, 1, param2Name, m_P2Type, (byte)ProfilerMarkerDataUnit.Undefined);
            ProfilerUnsafeUtility.SetMarkerMetadata(m_Ptr, 2, param3Name, m_P3Type, (byte)ProfilerMarkerDataUnit.Undefined);
#endif
        }
コード例 #7
0
 public unsafe ProfilerMarker(ProfilerCategory category, char *name, int nameLen)
 {
     this.m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, nameLen, category, MarkerFlags.Default, 0);
 }
コード例 #8
0
 public ProfilerMarker(ProfilerCategory category, string name)
 {
     this.m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, category, MarkerFlags.Default, 0);
 }
コード例 #9
0
 public ProfilerMarker(string name)
 {
     this.m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, 1, MarkerFlags.Default, 0);
 }
コード例 #10
0
 public unsafe ProfilerMarker(ProfilerCategory category, char *name, int nameLen, MarkerFlags flags)
 {
     m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, nameLen, category, flags, 0);
 }
コード例 #11
0
 public ProfilerMarker(ProfilerCategory category, string name, MarkerFlags flags)
 {
     m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, category, flags, 0);
 }
コード例 #12
0
 public unsafe ProfilerMarker(char *name, int nameLen)
 {
     m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, nameLen, ProfilerUnsafeUtility.CategoryScripts, MarkerFlags.Default, 0);
 }
コード例 #13
0
 public ProfilerMarker(string name)
 {
     m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, ProfilerUnsafeUtility.CategoryScripts, MarkerFlags.Default, 0);
 }