diff --git a/src/graphics/glwrap.cpp b/src/graphics/glwrap.cpp index 675e6edeb..7ae745d3e 100644 --- a/src/graphics/glwrap.cpp +++ b/src/graphics/glwrap.cpp @@ -263,8 +263,9 @@ ScopedGPUTimer::~ScopedGPUTimer() } GPUTimer::GPUTimer(const char* name) - : initialised(false), lastResult(0), canSubmitQuery(true), m_name(name) + : m_name(name) { + reset(); } unsigned GPUTimer::elapsedTimeus() diff --git a/src/graphics/glwrap.hpp b/src/graphics/glwrap.hpp index 951ce81fb..99dfe0665 100644 --- a/src/graphics/glwrap.hpp +++ b/src/graphics/glwrap.hpp @@ -61,6 +61,12 @@ public: GPUTimer(const char* name); unsigned elapsedTimeus(); const char* getName() const { return m_name; } + void reset() + { + initialised = false; + lastResult = 0; + canSubmitQuery = true; + } }; class VertexUtils diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index c9bf4c1cc..91561c806 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -897,6 +897,13 @@ void IrrDriver::applyResolutionSettings() SharedGPUObjects::reset(); initDevice(); +#ifndef SERVER_ONLY + for (unsigned i = 0; i < Q_LAST; i++) + { + m_perf_query[i]->reset(); + } +#endif + font_manager = new FontManager(); font_manager->loadFonts(); // Re-init GUI engine