]> git.lizzy.rs Git - minetest.git/commitdiff
Minor profiler fixes.
authorLars <larsh@apache.org>
Mon, 21 Dec 2020 03:22:04 +0000 (19:22 -0800)
committerlhofhansl <larsh@apache.org>
Wed, 23 Dec 2020 22:48:08 +0000 (14:48 -0800)
src/client/clientmap.cpp
src/profiler.cpp

index fa47df3f4bbf51716f7b92fc4c3aa195f6bd55d3..b9e0cc2ce4320e852790a6c0b27b7d1795762886 100644 (file)
@@ -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,
index be8be591e543e4a8ebfe9d04a715ce4961653649..d05b7abfe36cafb0f5425d49c552969f7e7dec90 100644 (file)
@@ -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: