-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move render stats to a new class
RenderStatistics
.
- Loading branch information
Showing
11 changed files
with
338 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/engine_lib/private/render/general/RenderStatistics.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "render/RenderStatistics.h" | ||
|
||
namespace ne { | ||
|
||
RenderStatistics::FrameTemporaryStatistics::FrameTemporaryStatistics() { | ||
// Initialize some variables. | ||
mtxFrustumCullingTimeInMs.second = 0.0F; | ||
} | ||
|
||
void RenderStatistics::FrameTemporaryStatistics::reset() { | ||
{ | ||
std::scoped_lock guard(mtxFrustumCullingTimeInMs.first); | ||
mtxFrustumCullingTimeInMs.second = 0.0F; | ||
} | ||
|
||
iCulledObjectCount.store(0); | ||
iDrawCallCount.store(0); | ||
|
||
#if defined(DEBUG) | ||
static_assert(sizeof(FrameTemporaryStatistics) == 104, "reset new statistics here"); // NOLINT | ||
#endif | ||
} | ||
|
||
size_t RenderStatistics::getFramesPerSecond() const { return fpsInfo.iFramesPerSecond; } | ||
|
||
size_t RenderStatistics::getLastFrameDrawCallCount() const { return counters.iLastFrameDrawCallCount; } | ||
|
||
size_t RenderStatistics::getLastFrameCulledObjectCount() const { | ||
return counters.iLastFrameCulledObjectCount; | ||
} | ||
|
||
float RenderStatistics::getTimeSpentLastFrameWaitingForGpu() const { | ||
return taskTimeInfo.timeSpentLastFrameWaitingForGpuInMs; | ||
} | ||
|
||
float RenderStatistics::getTimeSpentLastFrameOnFrustumCulling() const { | ||
return taskTimeInfo.timeSpentLastFrameOnFrustumCullingInMs; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.