-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathVirtualTexturingProfilerModule.cs
More file actions
71 lines (61 loc) · 2.2 KB
/
VirtualTexturingProfilerModule.cs
File metadata and controls
71 lines (61 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using System.Collections.Generic;
using Unity.Profiling;
using Unity.Profiling.Editor;
using UnityEngine;
using UnityEditor.Profiling;
using UnityEditor;
using UnityEngine.Profiling;
namespace UnityEditorInternal.Profiling
{
[Serializable]
[ProfilerModuleMetadata("Virtual Texturing", typeof(LocalizationResource), IconPath = "Profiler.VirtualTexturing")]
internal class VirtualTexturingProfilerModule : ProfilerModuleBase
{
[SerializeReference]
VirtualTexturingProfilerView m_VTProfilerView;
const int k_DefaultOrderIndex = 13;
static readonly string k_VTCountersCategoryName = ProfilerCategory.VirtualTexturing.Name;
static readonly string[] k_VirtualTexturingCounterNames =
{
"Required Tiles",
"Max Cache Mip Bias",
"Max Cache Demand",
"Missing Streaming Tiles",
"Missing Disk Data"
};
internal override ProfilerArea area => ProfilerArea.VirtualTexturing;
private protected override int defaultOrderIndex => k_DefaultOrderIndex;
internal override void OnEnable()
{
base.OnEnable();
if (m_VTProfilerView == null)
{
m_VTProfilerView = new VirtualTexturingProfilerView();
}
}
public override void DrawToolbar(Rect position)
{
}
public override void DrawDetailsView(Rect position)
{
m_VTProfilerView?.DrawUIPane(ProfilerWindow);
}
protected override List<ProfilerCounterData> CollectDefaultChartCounters()
{
var chartCounters = new List<ProfilerCounterData>(k_VirtualTexturingCounterNames.Length);
foreach (var counterName in k_VirtualTexturingCounterNames)
{
chartCounters.Add(new ProfilerCounterData()
{
m_Name = counterName,
m_Category = k_VTCountersCategoryName,
});
}
return chartCounters;
}
}
}