Skip to content

Commit

Permalink
Minor profiler fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lhofhansl committed Dec 23, 2020
1 parent 2c3593b commit 289425f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/client/clientmap.cpp
Expand Up @@ -290,6 +290,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
*/

u32 vertex_count = 0;
u32 drawcall_count = 0;

// For limiting number of mesh animations per frame
u32 mesh_animate_count = 0;
Expand Down Expand Up @@ -391,6 +392,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
}
driver->setMaterial(list.m);

drawcall_count += list.bufs.size();
for (auto &pair : list.bufs) {
scene::IMeshBuffer *buf = pair.second;

Expand All @@ -411,6 +413,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
}

g_profiler->avg(prefix + "vertices drawn [#]", vertex_count);
g_profiler->avg(prefix + "drawcalls [#]", drawcall_count);
}

static bool getVisibleBrightness(Map *map, const v3f &p0, v3f dir, float step,
Expand Down
2 changes: 1 addition & 1 deletion src/profiler.cpp
Expand Up @@ -38,7 +38,7 @@ ScopeProfiler::~ScopeProfiler()
return;

float duration_ms = m_timer->stop(true);
float duration = duration_ms / 1000.0;
float duration = duration_ms;
if (m_profiler) {
switch (m_type) {
case SPT_ADD:
Expand Down

0 comments on commit 289425f

Please sign in to comment.