From da40c5cb395c2d6650e172c3f044cc8ecc3b19f0 Mon Sep 17 00:00:00 2001 From: Jaswant Panchumarti Date: Tue, 10 Dec 2024 11:10:00 -0500 Subject: [PATCH] Remove debug print in QVTKRenderWindowAdapter - This commit removes a left over print statement in QVTKRenderWindowAdapter.cxx - The message is already handled correctly by the opengl debug logger mechanism in VTK. It is caught by vtkOpenGLMessageHandler in vtkOpenGLRenderWindow and sent to vtkLog macro. There is no need to print it to console. - This was not caught until https://gitlab.kitware.com/vtk/vtk/-/commit/5d4edb2c13412e9b30511fe5b17c8b3b3df87af6 enabled debug OpenGL context in Qt. The surrounding code never executed at all. - added a release note for OpenGL debug output feature in VTK. --- Documentation/release/dev/add-opengl-debug-output.md | 6 ++++++ GUISupport/Qt/QVTKRenderWindowAdapter.cxx | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 Documentation/release/dev/add-opengl-debug-output.md diff --git a/Documentation/release/dev/add-opengl-debug-output.md b/Documentation/release/dev/add-opengl-debug-output.md new file mode 100644 index 000000000000..ea9747c06a6d --- /dev/null +++ b/Documentation/release/dev/add-opengl-debug-output.md @@ -0,0 +1,6 @@ +## Improved OpenGL Debug Logging + +You can now see detailed debug messages from OpenGL when VTK is built with `VTK_REPORT_OPENGL_ERRORS=ON` and `VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS=ON` for release builds. The `vtkOpenGLRenderWindow` utilizes the `GL_ARB_debug_output` extension to provide +more detailed error messages, that explain which methods caused an invalid operation. These messages offer you more clarity than the cryptic error codes returned by `glGetError`. + +The `QVTKRenderWindowAdapter` class now creates a debug OpenGL context to enable debug output when `VTK_REPORT_OPENGL_ERRORS` is turned on. diff --git a/GUISupport/Qt/QVTKRenderWindowAdapter.cxx b/GUISupport/Qt/QVTKRenderWindowAdapter.cxx index c69ff49f8bca..c2069d67f016 100644 --- a/GUISupport/Qt/QVTKRenderWindowAdapter.cxx +++ b/GUISupport/Qt/QVTKRenderWindowAdapter.cxx @@ -36,7 +36,6 @@ { \ std::ostringstream str; \ str << "QVTKRenderWindowAdapter(" << this << "): " << msg; \ - cout << str.str() << endl; \ this->Logger->logMessage( \ QOpenGLDebugMessage::createApplicationMessage(QString(str.str().c_str()))); \ } -- GitLab