Ejemplo n.º 1
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            // Count memory allocated during last frame
            int nativeMemoryAllocation  = 0;
            int managedMemoryAllocation = 0;
            var events = sharedData.GetEventsCPU();
            var length = events?.Length ?? 0;

            for (int i = 0; i < length; i++)
            {
                var ee = events[i].Events;
                if (ee == null)
                {
                    continue;
                }
                for (int j = 0; j < ee.Length; j++)
                {
                    ref var e = ref ee[j];
                    if (e.NameStartsWith("ProfilerWindow"))
                    {
                        continue;
                    }
                    nativeMemoryAllocation  += e.NativeMemoryAllocation;
                    managedMemoryAllocation += e.ManagedMemoryAllocation;
                }
            }
Ejemplo n.º 2
0
 /// <inheritdoc />
 public override void Update(ref SharedUpdateData sharedData)
 {
     _fpsChart.AddSample(sharedData.Stats.FPS);
     _updateTimeChart.AddSample(sharedData.Stats.UpdateTimeMs);
     _drawTimeChart.AddSample(sharedData.Stats.DrawTimeMs);
     _cpuMemChart.AddSample(sharedData.Stats.ProcessMemory_UsedPhysicalMemory / 1024 / 1024);
     _gpuMemChart.AddSample(sharedData.Stats.MemoryGPU_Used / 1024 / 1024);
 }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            _mainChart.AddSample(sharedData.Stats.UpdateTimeMs);

            // Gather CPU events
            var events = sharedData.GetEventsCPU();

            if (_events == null)
            {
                _events = new SamplesBuffer <ProfilingTools.ThreadStats[]>();
            }
            _events.Add(events);
        }
Ejemplo n.º 4
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            // Gather GPU events
            var data = sharedData.GetEventsGPU();

            if (_events == null)
            {
                _events = new SamplesBuffer <ProfilerGPU.Event[]>();
            }
            _events.Add(data);

            // Peek draw time
            _drawTimeCPU.AddSample(sharedData.Stats.DrawCPUTimeMs);
            _drawTimeGPU.AddSample(sharedData.Stats.DrawGPUTimeMs);
        }
Ejemplo n.º 5
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            _mainChart.AddSample(sharedData.Stats.UpdateTimeMs);

            // Gather CPU events
            var events = sharedData.GetEventsCPU();

            _events.Add(events);

            // Update timeline if using the last frame
            if (_mainChart.SelectedSampleIndex == -1)
            {
                var viewRange = GetEventsViewRange();
                UpdateTimeline(ref viewRange);
                UpdateTable(ref viewRange);
            }
        }
Ejemplo n.º 6
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            // Count memory allocated during last frame
            int memoryAlloc = 0;
            var events      = sharedData.GetEventsCPU();

            for (int i = 0; i < events.Length; i++)
            {
                for (int j = 0; j < events[i].Events.Length; j++)
                {
                    var e = events[i].Events[j];
                    memoryAlloc += e.MemoryAllocation;
                }
            }

            _allocationsChart.AddSample(memoryAlloc);
        }
Ejemplo n.º 7
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            // Gather GPU events
            var data = sharedData.GetEventsGPU();

            _events.Add(data);

            // Peek draw time
            _drawTimeCPU.AddSample(sharedData.Stats.DrawCPUTimeMs);
            _drawTimeGPU.AddSample(sharedData.Stats.DrawGPUTimeMs);

            // Update timeline if using the last frame
            if (_drawTimeCPU.SelectedSampleIndex == -1)
            {
                UpdateTimeline();
                UpdateTable();
            }
        }
Ejemplo n.º 8
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            // Count memory allocated during last frame
            int nativeMemoryAllocation  = 0;
            int managedMemoryAllocation = 0;
            var events = sharedData.GetEventsCPU();
            var length = events?.Length ?? 0;

            for (int i = 0; i < length; i++)
            {
                for (int j = 0; j < events[i].Events.Length; j++)
                {
                    var e = events[i].Events[j];
                    nativeMemoryAllocation  += e.NativeMemoryAllocation;
                    managedMemoryAllocation += e.ManagedMemoryAllocation;
                }
            }

            _nativeAllocationsChart.AddSample(nativeMemoryAllocation);
            _managedAllocationsChart.AddSample(managedMemoryAllocation);
        }
Ejemplo n.º 9
0
        /// <inheritdoc />
        public override void Update(ref SharedUpdateData sharedData)
        {
            // Gather GPU events
            var data = sharedData.GetEventsGPU();

            _events.Add(data);

            // Peek draw time
            float drawTime = sharedData.Stats.DrawTimeMs;

            if (data != null && data.Length > 0)
            {
                drawTime = data[0].Time;
            }
            _mainChart.AddSample(drawTime);

            // Update timeline if using the last frame
            if (_mainChart.SelectedSampleIndex == -1)
            {
                UpdateTimeline();
                UpdateTable();
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Updates this instance. Called every frame if live recording is enabled.
 /// </summary>
 /// <param name="sharedData">The shared data.</param>
 public virtual void Update(ref SharedUpdateData sharedData)
 {
 }