Fix GPU profiler event percentage calculation and add tint highlight to spot slow entries
This commit is contained in:
@@ -321,8 +321,7 @@ namespace FlaxEditor.Windows.Profiler
|
|||||||
var data = _events.Get(_drawTimeCPU.SelectedSampleIndex);
|
var data = _events.Get(_drawTimeCPU.SelectedSampleIndex);
|
||||||
if (data == null || data.Length == 0)
|
if (data == null || data.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
float totalTimeMs = _drawTimeGPU.SelectedSample;
|
||||||
float totalTimeMs = _drawTimeCPU.SelectedSample;
|
|
||||||
|
|
||||||
// Add rows
|
// Add rows
|
||||||
var rowColor2 = Style.Current.Background * 1.4f;
|
var rowColor2 = Style.Current.Background * 1.4f;
|
||||||
@@ -343,14 +342,19 @@ namespace FlaxEditor.Windows.Profiler
|
|||||||
row = new Row
|
row = new Row
|
||||||
{
|
{
|
||||||
Values = new object[6],
|
Values = new object[6],
|
||||||
|
BackgroundColors = new Color[6],
|
||||||
};
|
};
|
||||||
|
for (int k = 0; k < row.BackgroundColors.Length; k++)
|
||||||
|
row.BackgroundColors[k] = Color.Transparent;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Event
|
// Event
|
||||||
row.Values[0] = name;
|
row.Values[0] = name;
|
||||||
|
|
||||||
// Total (%)
|
// Total (%)
|
||||||
row.Values[1] = (int)(e.Time / totalTimeMs * 1000.0f) / 10.0f;
|
float rowTimePerc = (float)(e.Time / totalTimeMs);
|
||||||
|
row.Values[1] = (int)(rowTimePerc * 1000.0f) / 10.0f;
|
||||||
|
row.BackgroundColors[1] = Color.Red.AlphaMultiplied(Mathf.Min(1, rowTimePerc) * 0.5f);
|
||||||
|
|
||||||
// GPU ms
|
// GPU ms
|
||||||
row.Values[2] = (e.Time * 10000.0f) / 10000.0f;
|
row.Values[2] = (e.Time * 10000.0f) / 10000.0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user