Skip to content

Commit 289425f

Browse files
committedDec 23, 2020
Minor profiler fixes.
1 parent 2c3593b commit 289425f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎src/client/clientmap.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
290290
*/
291291

292292
u32 vertex_count = 0;
293+
u32 drawcall_count = 0;
293294

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

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

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

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

416419
static bool getVisibleBrightness(Map *map, const v3f &p0, v3f dir, float step,

‎src/profiler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ScopeProfiler::~ScopeProfiler()
3838
return;
3939

4040
float duration_ms = m_timer->stop(true);
41-
float duration = duration_ms / 1000.0;
41+
float duration = duration_ms;
4242
if (m_profiler) {
4343
switch (m_type) {
4444
case SPT_ADD:

0 commit comments

Comments
 (0)
Please sign in to comment.