diff options
author | Lars <larsh@apache.org> | 2020-12-20 19:22:04 -0800 |
---|---|---|
committer | lhofhansl <larsh@apache.org> | 2020-12-23 14:48:08 -0800 |
commit | 289425f6bd6cfe1f66218918d9d5bd1b9f89aa7c (patch) | |
tree | 8f0f16a081b6620f5d3c8d86931eb9a04e302e3c | |
parent | 2c3593b51eef193eb543a08eb1e83c37e2fafe72 (diff) | |
download | minetest-289425f6bd6cfe1f66218918d9d5bd1b9f89aa7c.tar.gz minetest-289425f6bd6cfe1f66218918d9d5bd1b9f89aa7c.tar.bz2 minetest-289425f6bd6cfe1f66218918d9d5bd1b9f89aa7c.zip |
Minor profiler fixes.
-rw-r--r-- | src/client/clientmap.cpp | 3 | ||||
-rw-r--r-- | src/profiler.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/client/clientmap.cpp b/src/client/clientmap.cpp index fa47df3f4..b9e0cc2ce 100644 --- a/src/client/clientmap.cpp +++ b/src/client/clientmap.cpp @@ -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; @@ -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; @@ -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, diff --git a/src/profiler.cpp b/src/profiler.cpp index be8be591e..d05b7abfe 100644 --- a/src/profiler.cpp +++ b/src/profiler.cpp @@ -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: |