コード例 #1
0
ファイル: ProfilingState.cs プロジェクト: santoshna/xenko-1
 internal ProfilingState(int profilingId, ProfilingKey profilingKey, bool isEnabled)
 {
     ProfilingId     = profilingId;
     ProfilingKey    = profilingKey;
     this.isEnabled  = isEnabled;
     DisposeDelegate = null;
     attributes      = null;
     beginText       = null;
     startTime       = 0;
     eventType       = ProfilingEventType.CpuProfilingEvent;
 }
コード例 #2
0
ファイル: Profiler.cs プロジェクト: santoshna/xenko-1
        /// <summary>
        /// Retrieve the selected type of events and returns the number of elapsed frames.
        /// </summary>
        /// <param name="eventType">The type of events to retrieve</param>
        /// <param name="clearOtherEventTypes">if true, also clears the event types to avoid event over-accumulation.</param>
        /// <returns></returns>
        public static FastList <ProfilingEvent> GetEvents(ProfilingEventType eventType, bool clearOtherEventTypes = true)
        {
            lock (Locker)
            {
                var returnValue = eventType == ProfilingEventType.CpuProfilingEvent ? cpuEvents.GetBuffer() : gpuEvents.GetBuffer();

                if (eventType == ProfilingEventType.CpuProfilingEvent || clearOtherEventTypes)
                {
                    cpuEvents.MoveToNextBuffer();
                }
                if (eventType == ProfilingEventType.GpuProfilingEvent || clearOtherEventTypes)
                {
                    gpuEvents.MoveToNextBuffer();
                }

                return(returnValue);
            }
        }
コード例 #3
0
ファイル: Profiler.cs プロジェクト: santoshna/xenko-1
        public static void ProcessEvent(ref ProfilingEvent profilingEvent, ProfilingEventType eventType)
        {
            // Add event
            lock (Locker)
            {
                var list = eventType == ProfilingEventType.CpuProfilingEvent ? cpuEvents.GetBuffer() : gpuEvents.GetBuffer();
                list.Add(profilingEvent);
            }

            // Log it
            if ((profilingEvent.Key.Flags & ProfilingKeyFlags.Log) != 0)
            {
                Logger.Log(new ProfilingMessage(profilingEvent.Id, profilingEvent.Key, profilingEvent.Type)
                {
                    Attributes = profilingEvent.Attributes, ElapsedTime = new TimeSpan((profilingEvent.ElapsedTime * 10000000) / Stopwatch.Frequency), Text = profilingEvent.Text
                });
            }
        }
コード例 #4
0
ファイル: ProfilingState.cs プロジェクト: santoshna/xenko-1
 internal void Begin(long timeStamp)
 {
     eventType = ProfilingEventType.GpuProfilingEvent;
     EmitEvent(ProfilingMessageType.Begin, null, timeStamp);
 }