Fix queries stop working after changing resolution

This commit is contained in:
Benau 2018-02-11 15:06:35 +08:00
parent 0e3398a46b
commit 971db902a8
3 changed files with 15 additions and 1 deletions

View File

@ -263,8 +263,9 @@ ScopedGPUTimer::~ScopedGPUTimer()
} }
GPUTimer::GPUTimer(const char* name) GPUTimer::GPUTimer(const char* name)
: initialised(false), lastResult(0), canSubmitQuery(true), m_name(name) : m_name(name)
{ {
reset();
} }
unsigned GPUTimer::elapsedTimeus() unsigned GPUTimer::elapsedTimeus()

View File

@ -61,6 +61,12 @@ public:
GPUTimer(const char* name); GPUTimer(const char* name);
unsigned elapsedTimeus(); unsigned elapsedTimeus();
const char* getName() const { return m_name; } const char* getName() const { return m_name; }
void reset()
{
initialised = false;
lastResult = 0;
canSubmitQuery = true;
}
}; };
class VertexUtils class VertexUtils

View File

@ -897,6 +897,13 @@ void IrrDriver::applyResolutionSettings()
SharedGPUObjects::reset(); SharedGPUObjects::reset();
initDevice(); initDevice();
#ifndef SERVER_ONLY
for (unsigned i = 0; i < Q_LAST; i++)
{
m_perf_query[i]->reset();
}
#endif
font_manager = new FontManager(); font_manager = new FontManager();
font_manager->loadFonts(); font_manager->loadFonts();
// Re-init GUI engine // Re-init GUI engine