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();
|
GL.End();
|
||||||
|
|
||||||
|
int furthest = 0;
|
||||||
|
|
||||||
// Draw bars
|
// Draw bars
|
||||||
GL.Begin(PrimitiveType.Triangles);
|
GL.Begin(PrimitiveType.Triangles);
|
||||||
foreach (var entry in _sortedProfileData)
|
foreach (var entry in _sortedProfileData)
|
||||||
|
@ -54,14 +56,21 @@ namespace Ryujinx.Profiler.UI
|
||||||
GL.Color3(Color.Green);
|
GL.Color3(Color.Green);
|
||||||
foreach (Timestamp timestamp in entry.Value.GetAllTimestamps())
|
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);
|
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);
|
bottom = GetLineY(yOffset, LineHeight, LinePadding, true, verticalIndex);
|
||||||
top = bottom + barHeight;
|
top = bottom + barHeight;
|
||||||
|
|
||||||
// Make sure width is at least 1px
|
// Make sure width is at least 1px
|
||||||
right = Math.Max(left + 1, right);
|
right = Math.Max(left + 1, right);
|
||||||
|
|
||||||
|
furthest = right;
|
||||||
|
|
||||||
// Skip rendering out of bounds bars
|
// Skip rendering out of bounds bars
|
||||||
if (top < 0 || bottom > Height)
|
if (top < 0 || bottom > Height)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue