Skip to content

Commit

Permalink
Wait a single frame until we got actual data before checking performa…
Browse files Browse the repository at this point in the history
…nce budgets.
  • Loading branch information
npruehs committed Jul 8, 2020
1 parent 1530256 commit 726457c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,15 @@ void ADaeTestPerformanceBudgetActor::Tick(float DeltaSeconds)
}

// Check if we should start recording (again).
bool bJustBeganRecording = false;

if (!bIsRecording
&& (BudgetViolations.Num() == 0 || Time > LastBudgetViolationTime + BudgetViolationTimeout))
{
BeginRecording();

// Need to wait one frame before we got actual data.
bJustBeganRecording = true;
}

if (FlightPath.IsValidIndex(CurrentTargetPointIndex))
Expand Down Expand Up @@ -170,7 +175,7 @@ void ADaeTestPerformanceBudgetActor::Tick(float DeltaSeconds)
}

// Check performance.
if (bIsRecording)
if (bIsRecording && !bJustBeganRecording)
{
const FStatUnitData* StatUnitData = World->GetGameViewport()->GetStatUnitData();

Expand Down

0 comments on commit 726457c

Please sign in to comment.