diff --git a/0001-Allow-compilation-on-GLES-platforms.patch b/0001-Allow-compilation-on-GLES-platforms.patch new file mode 100644 index 0000000..2b8b470 --- /dev/null +++ b/0001-Allow-compilation-on-GLES-platforms.patch @@ -0,0 +1,55 @@ +From 2d5a68b91f9d638aa408285d1608bc5d70060602 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Fri, 1 Sep 2017 02:11:37 +0200 +Subject: [PATCH] Allow compilation on GLES platforms +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On GLES 2.0 platforms (more specifically, for Qt5 "opengl es2" builds), +QOpenGLFunctions_3_2_Core does not exist. Since Qt 5.7, +QOpenGlFramebufferObject has a static wrapper method for framebuffer +blitting, which in worst case is a noop. + +Signed-off-by: Stefan BrĂ¼ns +--- + GUISupport/Qt/QVTKOpenGLWidget.cxx | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/GUISupport/Qt/QVTKOpenGLWidget.cxx b/GUISupport/Qt/QVTKOpenGLWidget.cxx +index a1676e8..16e255f 100644 +--- a/GUISupport/Qt/QVTKOpenGLWidget.cxx ++++ b/GUISupport/Qt/QVTKOpenGLWidget.cxx +@@ -421,10 +421,15 @@ void QVTKOpenGLWidget::paintGL() + + // blit from this->FBO to QOpenGLWidget's FBO. + vtkQVTKOpenGLWidgetDebugMacro("paintGL::blit-to-defaultFBO"); ++#if QT_VERSION < 0x050700 + QOpenGLFunctions_3_2_Core* f = + QOpenGLContext::currentContext()->versionFunctions(); ++#else ++ QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions(); ++#endif + if (f) + { ++#if QT_VERSION < 0x050700 + f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, this->defaultFramebufferObject()); + f->glDrawBuffer(GL_COLOR_ATTACHMENT0); + +@@ -434,6 +439,13 @@ void QVTKOpenGLWidget::paintGL() + f->glBlitFramebuffer(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1], + 0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1], GL_COLOR_BUFFER_BIT, + GL_NEAREST); ++#else ++ f->glDisable(GL_SCISSOR_TEST); // Scissor affects glBindFramebuffer. ++ QRect rect(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1]); ++ QOpenGLFramebufferObject::blitFramebuffer(0 /* binds to default framebuffer */, rect, ++ this->FBO, rect, GL_COLOR_BUFFER_BIT, GL_NEAREST, GL_COLOR_ATTACHMENT0, ++ GL_COLOR_ATTACHMENT0, QOpenGLFramebufferObject::DontRestoreFramebufferBinding); ++#endif + + // now clear alpha otherwise we end up blending the rendering with + // background windows in certain cases. It happens on OsX +-- +2.14.1 + diff --git a/vtk-compat_gl.changes b/vtk-compat_gl.changes index 5175f45..c66f805 100644 --- a/vtk-compat_gl.changes +++ b/vtk-compat_gl.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Sep 11 13:46:28 UTC 2017 - stefan.bruens@rwth-aachen.de + +- Add 0001-Allow-compilation-on-GLES-platforms.patch + The QOpenGLFunctions_3_2_Core class providing the framebuffer + blit functions is not available on GLES 2 builds of Qt5. Let Qt + handle the framebuffer blit, and just use the GLES/GL subset + provided by QOpenGLFunctions for the remainder. + Fix for https://gitlab.kitware.com/vtk/vtk/issues/17113 + ------------------------------------------------------------------- Fri Sep 1 00:13:18 UTC 2017 - badshah400@gmail.com diff --git a/vtk-compat_gl.spec b/vtk-compat_gl.spec index 7ed20b9..ecce771 100644 --- a/vtk-compat_gl.spec +++ b/vtk-compat_gl.spec @@ -54,6 +54,8 @@ Source1: vtk-rpmlintrc Patch1: vtk-fix-file-contains-date-time.patch # PATCH-FIX-UPSTREAM vtk-Rinterface-uintptr_t.patch boo#985386 badshah400@gmail.com -- Fix issues with uintptr_t redefinition by defining the HAVE_UINTPTR_T macro using cmake functions to avoid redefinition of uintptr_t, which is already defined in stdint.h called earlier; patch sent upstream Patch2: vtk-Rinterface-uintptr_t.patch +# PATCH-FIX-OPENSUSE 0001-Allow-compilation-on-GLES-platforms.patch VTK issue #17113 stefan.bruens@rwth-aachen.de -- Fix building with Qt GLES builds +Patch3: 0001-Allow-compilation-on-GLES-platforms.patch BuildRequires: Mesa-libGL-devel BuildRequires: R-base-devel BuildRequires: boost-devel @@ -290,6 +292,7 @@ This package provides a few testing programs for VTK. %setup -q -n VTK-%{version} %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Replace relative path ../../../VTKData with %%{_datadir}/%%{pkgname}data-%%{version} # otherwise it will break on symlinks. diff --git a/vtk.changes b/vtk.changes index 5175f45..c66f805 100644 --- a/vtk.changes +++ b/vtk.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Sep 11 13:46:28 UTC 2017 - stefan.bruens@rwth-aachen.de + +- Add 0001-Allow-compilation-on-GLES-platforms.patch + The QOpenGLFunctions_3_2_Core class providing the framebuffer + blit functions is not available on GLES 2 builds of Qt5. Let Qt + handle the framebuffer blit, and just use the GLES/GL subset + provided by QOpenGLFunctions for the remainder. + Fix for https://gitlab.kitware.com/vtk/vtk/issues/17113 + ------------------------------------------------------------------- Fri Sep 1 00:13:18 UTC 2017 - badshah400@gmail.com diff --git a/vtk.spec b/vtk.spec index 8dee8fc..1ee9eef 100644 --- a/vtk.spec +++ b/vtk.spec @@ -54,6 +54,8 @@ Source1: vtk-rpmlintrc Patch1: vtk-fix-file-contains-date-time.patch # PATCH-FIX-UPSTREAM vtk-Rinterface-uintptr_t.patch boo#985386 badshah400@gmail.com -- Fix issues with uintptr_t redefinition by defining the HAVE_UINTPTR_T macro using cmake functions to avoid redefinition of uintptr_t, which is already defined in stdint.h called earlier; patch sent upstream Patch2: vtk-Rinterface-uintptr_t.patch +# PATCH-FIX-OPENSUSE 0001-Allow-compilation-on-GLES-platforms.patch VTK issue #17113 stefan.bruens@rwth-aachen.de -- Fix building with Qt GLES builds +Patch3: 0001-Allow-compilation-on-GLES-platforms.patch BuildRequires: Mesa-libGL-devel BuildRequires: R-base-devel BuildRequires: boost-devel @@ -290,6 +292,7 @@ This package provides a few testing programs for VTK. %setup -q -n VTK-%{version} %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Replace relative path ../../../VTKData with %%{_datadir}/%%{pkgname}data-%%{version} # otherwise it will break on symlinks.