diff options
| author | emmauss <emmausssss@gmail.com> | 2020-02-06 11:25:47 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-06 11:25:47 +0000 |
| commit | f2b9a9c2b0a3d7af3b56df9ae09db8a3b2d8506c (patch) | |
| tree | 7c4a0019c1c904397927567a0ad0685299cce1eb /Ryujinx.Profiler/UI/ProfileWindowBars.cs | |
| parent | db9f8f999f2c9a50e25685424271735ed3538539 (diff) | |
Render Profiler in GUI (#854)
* move profiler output to gui
* addressed commits, rebased
* removed whitespaces
Diffstat (limited to 'Ryujinx.Profiler/UI/ProfileWindowBars.cs')
| -rw-r--r-- | Ryujinx.Profiler/UI/ProfileWindowBars.cs | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/Ryujinx.Profiler/UI/ProfileWindowBars.cs b/Ryujinx.Profiler/UI/ProfileWindowBars.cs deleted file mode 100644 index ab5b4fd1..00000000 --- a/Ryujinx.Profiler/UI/ProfileWindowBars.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using OpenTK; -using OpenTK.Graphics.OpenGL; - -namespace Ryujinx.Profiler.UI -{ - public partial class ProfileWindow - { - private void DrawBars(float xOffset, float yOffset, float width) - { - if (_sortedProfileData.Count != 0) - { - long maxAverage; - long maxTotal; - - int verticalIndex = 0; - float barHeight = (LineHeight - LinePadding) / 3.0f; - - // Get max values - long maxInstant = maxAverage = maxTotal = 0; - foreach (KeyValuePair<ProfileConfig, TimingInfo> kvp in _sortedProfileData) - { - maxInstant = Math.Max(maxInstant, kvp.Value.Instant); - maxAverage = Math.Max(maxAverage, kvp.Value.AverageTime); - maxTotal = Math.Max(maxTotal, kvp.Value.TotalTime); - } - - GL.Enable(EnableCap.ScissorTest); - GL.Begin(PrimitiveType.Triangles); - foreach (var entry in _sortedProfileData) - { - // Instant - GL.Color3(Color.Blue); - float bottom = GetLineY(yOffset, LineHeight, LinePadding, true, verticalIndex++); - float top = bottom + barHeight; - float right = (float)entry.Value.Instant / maxInstant * width + xOffset; - - // Skip rendering out of bounds bars - if (top < 0 || bottom > Height) - continue; - - GL.Vertex2(xOffset, bottom); - GL.Vertex2(xOffset, top); - GL.Vertex2(right, top); - - GL.Vertex2(right, top); - GL.Vertex2(right, bottom); - GL.Vertex2(xOffset, bottom); - - // Average - GL.Color3(Color.Green); - top += barHeight; - bottom += barHeight; - right = (float)entry.Value.AverageTime / maxAverage * width + xOffset; - - GL.Vertex2(xOffset, bottom); - GL.Vertex2(xOffset, top); - GL.Vertex2(right, top); - - GL.Vertex2(right, top); - GL.Vertex2(right, bottom); - GL.Vertex2(xOffset, bottom); - - // Total - GL.Color3(Color.Red); - top += barHeight; - bottom += barHeight; - right = (float)entry.Value.TotalTime / maxTotal * width + xOffset; - - GL.Vertex2(xOffset, bottom); - GL.Vertex2(xOffset, top); - GL.Vertex2(right, top); - - GL.Vertex2(right, top); - GL.Vertex2(right, bottom); - GL.Vertex2(xOffset, bottom); - } - - GL.End(); - GL.Disable(EnableCap.ScissorTest); - } - } - } -} |
