SHA256
1
0
forked from pool/vtk
vtk/0001-Allow-compilation-on-GLES-platforms.patch

56 lines
2.4 KiB
Diff
Raw Normal View History

From 2d5a68b91f9d638aa408285d1608bc5d70060602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
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 <stefan.bruens@rwth-aachen.de>
---
Accepting request 685449 from home:StefanBruens:branches:science - Update to version 8.2.0 * Removed support for TCL and Qt4 * Removed all VTK_OVERRIDE, VTK_FINAL, VTK_DELETE_FUNCTION macros as C++11 is now required. * vtkAbstractArray gained support for runtime user defined free functions, allowing for custom allocator memory to be used with VTK. * The vtkGeovis classes are now deprecated. See https://blog.kitware.com/vtk-8-2-0/ for a more exhaustive list. - Packaging changes: * Python bindings for MPI flavors are now installed below the MPI prefix and thus no longer conflict with each other. To use these, the PYTHONPATH currently has to be amended manually. * Removed several devel Requires: from the devel package. This reduces the dependency chain (e.g. java-devel) for all packages building against VTK, but may require to specify some dependencies explicitly, depending on the used VTK modules and bindings. - Patch updates/additions: * Rebase vtk-fix-file-contains-date-time.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Drop obsolete fix_qt5_example_cmake.patch * Add bundled_libharu_add_missing_libm.patch * Add bundled_exodusii_add_missing_libpthread.patch * Add 0001-Add-libogg-to-IOMovie-target-link-libraries.patch * Add 0001-Make-code-calling-proj4-compatible-with-proj4-5.0-an.patch Moved two omitted python modules to python3-vtk OBS-URL: https://build.opensuse.org/request/show/685449 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=136
2019-03-19 14:50:29 +01:00
GUISupport/Qt/QVTKOpenGLNativeWidget.cxx | 12 ++++++++++++
1 file changed, 12 insertions(+)
Accepting request 685449 from home:StefanBruens:branches:science - Update to version 8.2.0 * Removed support for TCL and Qt4 * Removed all VTK_OVERRIDE, VTK_FINAL, VTK_DELETE_FUNCTION macros as C++11 is now required. * vtkAbstractArray gained support for runtime user defined free functions, allowing for custom allocator memory to be used with VTK. * The vtkGeovis classes are now deprecated. See https://blog.kitware.com/vtk-8-2-0/ for a more exhaustive list. - Packaging changes: * Python bindings for MPI flavors are now installed below the MPI prefix and thus no longer conflict with each other. To use these, the PYTHONPATH currently has to be amended manually. * Removed several devel Requires: from the devel package. This reduces the dependency chain (e.g. java-devel) for all packages building against VTK, but may require to specify some dependencies explicitly, depending on the used VTK modules and bindings. - Patch updates/additions: * Rebase vtk-fix-file-contains-date-time.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Drop obsolete fix_qt5_example_cmake.patch * Add bundled_libharu_add_missing_libm.patch * Add bundled_exodusii_add_missing_libpthread.patch * Add 0001-Add-libogg-to-IOMovie-target-link-libraries.patch * Add 0001-Make-code-calling-proj4-compatible-with-proj4-5.0-an.patch Moved two omitted python modules to python3-vtk OBS-URL: https://build.opensuse.org/request/show/685449 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=136
2019-03-19 14:50:29 +01:00
diff --git a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx
index a1676e8..16e255f 100644
Accepting request 685449 from home:StefanBruens:branches:science - Update to version 8.2.0 * Removed support for TCL and Qt4 * Removed all VTK_OVERRIDE, VTK_FINAL, VTK_DELETE_FUNCTION macros as C++11 is now required. * vtkAbstractArray gained support for runtime user defined free functions, allowing for custom allocator memory to be used with VTK. * The vtkGeovis classes are now deprecated. See https://blog.kitware.com/vtk-8-2-0/ for a more exhaustive list. - Packaging changes: * Python bindings for MPI flavors are now installed below the MPI prefix and thus no longer conflict with each other. To use these, the PYTHONPATH currently has to be amended manually. * Removed several devel Requires: from the devel package. This reduces the dependency chain (e.g. java-devel) for all packages building against VTK, but may require to specify some dependencies explicitly, depending on the used VTK modules and bindings. - Patch updates/additions: * Rebase vtk-fix-file-contains-date-time.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Drop obsolete fix_qt5_example_cmake.patch * Add bundled_libharu_add_missing_libm.patch * Add bundled_exodusii_add_missing_libpthread.patch * Add 0001-Add-libogg-to-IOMovie-target-link-libraries.patch * Add 0001-Make-code-calling-proj4-compatible-with-proj4-5.0-an.patch Moved two omitted python modules to python3-vtk OBS-URL: https://build.opensuse.org/request/show/685449 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=136
2019-03-19 14:50:29 +01:00
--- a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx
+++ b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx
@@ -534,10 +534,15 @@ void QVTKOpenGLNativeWidget::paintGL()
// blit from this->FBO to QOpenGLWidget's FBO.
Accepting request 685449 from home:StefanBruens:branches:science - Update to version 8.2.0 * Removed support for TCL and Qt4 * Removed all VTK_OVERRIDE, VTK_FINAL, VTK_DELETE_FUNCTION macros as C++11 is now required. * vtkAbstractArray gained support for runtime user defined free functions, allowing for custom allocator memory to be used with VTK. * The vtkGeovis classes are now deprecated. See https://blog.kitware.com/vtk-8-2-0/ for a more exhaustive list. - Packaging changes: * Python bindings for MPI flavors are now installed below the MPI prefix and thus no longer conflict with each other. To use these, the PYTHONPATH currently has to be amended manually. * Removed several devel Requires: from the devel package. This reduces the dependency chain (e.g. java-devel) for all packages building against VTK, but may require to specify some dependencies explicitly, depending on the used VTK modules and bindings. - Patch updates/additions: * Rebase vtk-fix-file-contains-date-time.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Drop obsolete fix_qt5_example_cmake.patch * Add bundled_libharu_add_missing_libm.patch * Add bundled_exodusii_add_missing_libpthread.patch * Add 0001-Add-libogg-to-IOMovie-target-link-libraries.patch * Add 0001-Make-code-calling-proj4-compatible-with-proj4-5.0-an.patch Moved two omitted python modules to python3-vtk OBS-URL: https://build.opensuse.org/request/show/685449 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=136
2019-03-19 14:50:29 +01:00
vtkQVTKOpenGLNativeWidgetDebugMacro("paintGL::blit-to-defaultFBO");
+#if QT_VERSION < 0x050700
QOpenGLFunctions_3_2_Core* f =
QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
+#else
+ QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions();
+#endif
if (f)
{
+#if QT_VERSION < 0x050700
Accepting request 685449 from home:StefanBruens:branches:science - Update to version 8.2.0 * Removed support for TCL and Qt4 * Removed all VTK_OVERRIDE, VTK_FINAL, VTK_DELETE_FUNCTION macros as C++11 is now required. * vtkAbstractArray gained support for runtime user defined free functions, allowing for custom allocator memory to be used with VTK. * The vtkGeovis classes are now deprecated. See https://blog.kitware.com/vtk-8-2-0/ for a more exhaustive list. - Packaging changes: * Python bindings for MPI flavors are now installed below the MPI prefix and thus no longer conflict with each other. To use these, the PYTHONPATH currently has to be amended manually. * Removed several devel Requires: from the devel package. This reduces the dependency chain (e.g. java-devel) for all packages building against VTK, but may require to specify some dependencies explicitly, depending on the used VTK modules and bindings. - Patch updates/additions: * Rebase vtk-fix-file-contains-date-time.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Drop obsolete fix_qt5_example_cmake.patch * Add bundled_libharu_add_missing_libm.patch * Add bundled_exodusii_add_missing_libpthread.patch * Add 0001-Add-libogg-to-IOMovie-target-link-libraries.patch * Add 0001-Make-code-calling-proj4-compatible-with-proj4-5.0-an.patch Moved two omitted python modules to python3-vtk OBS-URL: https://build.opensuse.org/request/show/685449 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=136
2019-03-19 14:50:29 +01:00
vtkOpenGLState *ostate = this->RenderWindow->GetState();
Accepting request 685449 from home:StefanBruens:branches:science - Update to version 8.2.0 * Removed support for TCL and Qt4 * Removed all VTK_OVERRIDE, VTK_FINAL, VTK_DELETE_FUNCTION macros as C++11 is now required. * vtkAbstractArray gained support for runtime user defined free functions, allowing for custom allocator memory to be used with VTK. * The vtkGeovis classes are now deprecated. See https://blog.kitware.com/vtk-8-2-0/ for a more exhaustive list. - Packaging changes: * Python bindings for MPI flavors are now installed below the MPI prefix and thus no longer conflict with each other. To use these, the PYTHONPATH currently has to be amended manually. * Removed several devel Requires: from the devel package. This reduces the dependency chain (e.g. java-devel) for all packages building against VTK, but may require to specify some dependencies explicitly, depending on the used VTK modules and bindings. - Patch updates/additions: * Rebase vtk-fix-file-contains-date-time.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Drop obsolete fix_qt5_example_cmake.patch * Add bundled_libharu_add_missing_libm.patch * Add bundled_exodusii_add_missing_libpthread.patch * Add 0001-Add-libogg-to-IOMovie-target-link-libraries.patch * Add 0001-Make-code-calling-proj4-compatible-with-proj4-5.0-an.patch Moved two omitted python modules to python3-vtk OBS-URL: https://build.opensuse.org/request/show/685449 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=136
2019-03-19 14:50:29 +01:00
f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, this->defaultFramebufferObject());
@@ -556,6 +561,13 @@ void QVTKOpenGLNativeWidget::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