MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / MemoryGPU

Method MemoryGPU

Source/Editor/Windows/Profiler/MemoryGPU.cs:40–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 private GPUResource[] _gpuResourcesCached;
39
40 public MemoryGPU()
41 : base("GPU Memory")
42 {
43 // Layout
44 var mainPanel = new Panel(ScrollBars.None)
45 {
46 AnchorPreset = AnchorPresets.StretchAll,
47 Offsets = Margin.Zero,
48 Parent = this,
49 };
50
51 // Chart
52 _memoryUsageChart = new SingleChart
53 {
54 Title = "GPU Memory Usage",
55 AnchorPreset = AnchorPresets.HorizontalStretchTop,
56 Offsets = Margin.Zero,
57 Height = SingleChart.DefaultHeight,
58 FormatSample = v => Utilities.Utils.FormatBytesCount((ulong)v),
59 Parent = mainPanel,
60 };
61 _memoryUsageChart.SelectedSampleChanged += OnSelectedSampleChanged;
62
63 var panel = new Panel(ScrollBars.Vertical)
64 {
65 AnchorPreset = AnchorPresets.StretchAll,
66 Offsets = new Margin(0, 0, _memoryUsageChart.Height + 2, 0),
67 Parent = mainPanel,
68 };
69 var layout = new VerticalPanel
70 {
71 AnchorPreset = AnchorPresets.HorizontalStretchTop,
72 Offsets = Margin.Zero,
73 Pivot = Float2.Zero,
74 IsScrollable = true,
75 Parent = panel,
76 };
77
78 // Table
79 var style = Style.Current;
80 var headerColor = style.LightBackground;
81 var textColor = style.Foreground;
82 _table = new Table
83 {
84 Columns = new[]
85 {
86 new ColumnDefinition
87 {
88 UseExpandCollapseMode = true,
89 CellAlignment = TextAlignment.Near,
90 Title = "Resource",
91 TitleBackgroundColor = headerColor,
92 TitleColor = textColor,
93 },
94 new ColumnDefinition
95 {
96 Title = "Type",
97 CellAlignment = TextAlignment.Center,

Callers

nothing calls this directly

Calls 1

FormatBytesCountMethod · 0.80

Tested by

no test coverage detected