Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/opengl/scene_opengl.cpp
Show First 20 Lines • Show All 385 Lines • ▼ Show 20 Line(s) | 385 | if (!gs_debuggedScene) | |||
---|---|---|---|---|---|
386 | return; | 386 | return; | ||
387 | 387 | | |||
388 | static QPointer<QTimer> timer; | 388 | static QPointer<QTimer> timer; | ||
389 | if (!timer) { | 389 | if (!timer) { | ||
390 | delete timer; | 390 | delete timer; | ||
391 | timer = new QTimer(gs_debuggedScene); | 391 | timer = new QTimer(gs_debuggedScene); | ||
392 | timer->setSingleShot(true); | 392 | timer->setSingleShot(true); | ||
393 | QObject::connect(timer.data(), &QTimer::timeout, gs_debuggedScene, []() { | 393 | QObject::connect(timer.data(), &QTimer::timeout, gs_debuggedScene, []() { | ||
394 | makeOpenGLContextCurrent(); | ||||
394 | GLVertexBuffer::cleanup(); | 395 | GLVertexBuffer::cleanup(); | ||
395 | GLVertexBuffer::initStatic(); | 396 | GLVertexBuffer::initStatic(); | ||
396 | }); | 397 | }); | ||
397 | } | 398 | } | ||
zzag: Was there any reason not to use gl_debuggedScene directly? | |||||
398 | timer->start(250); | 399 | timer->start(250); | ||
399 | } | 400 | } | ||
400 | 401 | | |||
401 | void SceneOpenGL::initDebugOutput() | 402 | void SceneOpenGL::initDebugOutput() | ||
402 | { | 403 | { | ||
403 | const bool have_KHR_debug = hasGLExtension(QByteArrayLiteral("GL_KHR_debug")); | 404 | const bool have_KHR_debug = hasGLExtension(QByteArrayLiteral("GL_KHR_debug")); | ||
404 | const bool have_ARB_debug = hasGLExtension(QByteArrayLiteral("GL_ARB_debug_output")); | 405 | const bool have_ARB_debug = hasGLExtension(QByteArrayLiteral("GL_ARB_debug_output")); | ||
405 | if (!have_KHR_debug && !have_ARB_debug) | 406 | if (!have_KHR_debug && !have_ARB_debug) | ||
Show All 39 Lines | 431 | auto callback = [](GLenum source, GLenum type, GLuint id, | |||
445 | 446 | | |||
446 | case GL_DEBUG_TYPE_OTHER: | 447 | case GL_DEBUG_TYPE_OTHER: | ||
447 | // at least the nvidia driver seems prone to end up with invalid VBOs after | 448 | // at least the nvidia driver seems prone to end up with invalid VBOs after | ||
448 | // transferring them between system heap and VRAM | 449 | // transferring them between system heap and VRAM | ||
449 | // so we re-init them whenever this happens (typically when switching VT, resuming | 450 | // so we re-init them whenever this happens (typically when switching VT, resuming | ||
450 | // from STR and XRandR events - #344326 | 451 | // from STR and XRandR events - #344326 | ||
451 | if (strstr(message, "Buffer detailed info:") && strstr(message, "has been updated")) | 452 | if (strstr(message, "Buffer detailed info:") && strstr(message, "has been updated")) | ||
452 | scheduleVboReInit(); | 453 | scheduleVboReInit(); | ||
453 | // fall through! for general message printing | 454 | // fall through! for general message printing | ||
454 | Q_FALLTHROUGH(); | 455 | Q_FALLTHROUGH(); | ||
zzag: Please remove these two lines as well. | |||||
455 | case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: | 456 | case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: | ||
456 | case GL_DEBUG_TYPE_PORTABILITY: | 457 | case GL_DEBUG_TYPE_PORTABILITY: | ||
457 | case GL_DEBUG_TYPE_PERFORMANCE: | 458 | case GL_DEBUG_TYPE_PERFORMANCE: | ||
458 | default: | 459 | default: | ||
459 | qCDebug(KWIN_OPENGL, "%#x: %.*s", id, length, message); | 460 | qCDebug(KWIN_OPENGL, "%#x: %.*s", id, length, message); | ||
460 | break; | 461 | break; | ||
461 | } | 462 | } | ||
462 | }; | 463 | }; | ||
▲ Show 20 Lines • Show All 2297 Lines • Show Last 20 Lines |
Was there any reason not to use gl_debuggedScene directly?