mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
add gl info and gpu free memory to user stats
This commit is contained in:
parent
272055b6ee
commit
e22a2e9e2f
2 changed files with 19 additions and 12 deletions
|
@ -1181,8 +1181,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
properties["current_path"] = currentPath;
|
||||
properties["build_version"] = BuildInfo::VERSION;
|
||||
|
||||
qDebug() << "just sent stats with:" << currentDomain << currentPath << "build:" << BuildInfo::VERSION;
|
||||
|
||||
auto displayPlugin = qApp->getActiveDisplayPlugin();
|
||||
|
||||
properties["fps"] = _frameCounter.rate();
|
||||
|
@ -1233,6 +1231,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
properties["active_display_plugin"] = getActiveDisplayPlugin()->getName();
|
||||
properties["using_hmd"] = isHMDMode();
|
||||
|
||||
auto glInfo = getGLContextData();
|
||||
properties["gl_info"] = glInfo;
|
||||
properties["gpu_free_memory"] = (int)BYTES_TO_MB(gpu::Context::getFreeGPUMemory());
|
||||
|
||||
auto hmdHeadPose = getHMDSensorPose();
|
||||
properties["hmd_head_pose_changed"] = isHMDMode() && (hmdHeadPose != lastHMDHeadPose);
|
||||
lastHMDHeadPose = hmdHeadPose;
|
||||
|
|
|
@ -35,17 +35,22 @@ int glVersionToInteger(QString glVersion) {
|
|||
}
|
||||
|
||||
QJsonObject getGLContextData() {
|
||||
QString glVersion = QString((const char*)glGetString(GL_VERSION));
|
||||
QString glslVersion = QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||
QString glVendor = QString((const char*) glGetString(GL_VENDOR));
|
||||
QString glRenderer = QString((const char*)glGetString(GL_RENDERER));
|
||||
static QJsonObject result;
|
||||
static std::once_flag once;
|
||||
std::call_once(once, [] {
|
||||
QString glVersion = QString((const char*)glGetString(GL_VERSION));
|
||||
QString glslVersion = QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||
QString glVendor = QString((const char*) glGetString(GL_VENDOR));
|
||||
QString glRenderer = QString((const char*)glGetString(GL_RENDERER));
|
||||
|
||||
return QJsonObject {
|
||||
{ "version", glVersion },
|
||||
{ "slVersion", glslVersion },
|
||||
{ "vendor", glVendor },
|
||||
{ "renderer", glRenderer },
|
||||
};
|
||||
result = QJsonObject {
|
||||
{ "version", glVersion },
|
||||
{ "slVersion", glslVersion },
|
||||
{ "vendor", glVendor },
|
||||
{ "renderer", glRenderer },
|
||||
};
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
QThread* RENDER_THREAD = nullptr;
|
||||
|
|
Loading…
Reference in a new issue