Introduce Boost as a submodule + Minor Fixes

Utilize Boost Container's `small_vector` for optimizing allocations, fix certain implicit casting issues and make `ILogger` not output an additional newline in the log when the application supplies one at the end of the log
This commit is contained in:
PixelyIon
2021-08-21 01:27:22 +05:30
parent 190fde110f
commit 8cba1edf6d
10 changed files with 32 additions and 21 deletions

View File

@ -279,7 +279,7 @@ namespace skyline::gpu {
if (frameTimestamp) {
i64 now{static_cast<i64>(util::GetTimeNs())};
auto sampleWeight{swapInterval ? constant::NsInSecond / (refreshCycleDuration * swapInterval) : 10}; //!< The weight of each sample in calculating the average, we arbitrarily average 10 samples for unlocked FPS
i64 sampleWeight{static_cast<i64>(swapInterval ? constant::NsInSecond / (refreshCycleDuration * swapInterval) : 10)}; //!< The weight of each sample in calculating the average, we arbitrarily average 10 samples for unlocked FPS
auto weightedAverage{[](auto weight, auto previousAverage, auto current) {
return (((weight - 1) * previousAverage) + current) / weight;
@ -293,13 +293,13 @@ namespace skyline::gpu {
averageFrametimeDeviationNs = weightedAverage(sampleWeight, averageFrametimeDeviationNs, currentFrametimeDeviation);
AverageFrametimeDeviationMs = static_cast<jfloat>(averageFrametimeDeviationNs) / constant::NsInMillisecond;
Fps = std::round(static_cast<float>(constant::NsInSecond) / averageFrametimeNs);
Fps = static_cast<jint>(std::round(static_cast<float>(constant::NsInSecond) / static_cast<float>(averageFrametimeNs)));
TRACE_EVENT_INSTANT("gpu", "Present", presentationTrack, "FrameTimeNs", now - frameTimestamp, "Fps", Fps);
frameTimestamp = now;
} else {
frameTimestamp = util::GetTimeNs();
frameTimestamp = static_cast<i64>(util::GetTimeNs());
}
}