Skip repeating pixels during draw
This commit is contained in:
parent
c7bc7ba166
commit
e350fc5113
1 changed files with 10 additions and 1 deletions
|
@ -47,6 +47,8 @@ namespace Ryujinx.Profiler.UI
|
|||
}
|
||||
GL.End();
|
||||
|
||||
int furthest = 0;
|
||||
|
||||
// Draw bars
|
||||
GL.Begin(PrimitiveType.Triangles);
|
||||
foreach (var entry in _sortedProfileData)
|
||||
|
@ -54,14 +56,21 @@ namespace Ryujinx.Profiler.UI
|
|||
GL.Color3(Color.Green);
|
||||
foreach (Timestamp timestamp in entry.Value.GetAllTimestamps())
|
||||
{
|
||||
right = (int)(xOffset + width - ((float)(_captureTime - (timestamp.EndTime + graphPositionTicks)) / timeWidthTicks) * width);
|
||||
|
||||
// Skip drawing multiple timestamps on same pixel
|
||||
if (right <= furthest)
|
||||
continue;
|
||||
|
||||
left = (int)(xOffset + width - ((float)(_captureTime - (timestamp.BeginTime + graphPositionTicks)) / timeWidthTicks) * width);
|
||||
right = (int)(xOffset + width - ((float)(_captureTime - (timestamp.EndTime + graphPositionTicks)) / timeWidthTicks) * width);
|
||||
bottom = GetLineY(yOffset, LineHeight, LinePadding, true, verticalIndex);
|
||||
top = bottom + barHeight;
|
||||
|
||||
// Make sure width is at least 1px
|
||||
right = Math.Max(left + 1, right);
|
||||
|
||||
furthest = right;
|
||||
|
||||
// Skip rendering out of bounds bars
|
||||
if (top < 0 || bottom > Height)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue