SHA256
1
0
forked from pool/vtk
vtk/0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch

103 lines
4.1 KiB
Diff
Raw Normal View History

2021-11-25 01:20:17 +01:00
From b035ea7f784a842dda0c3b0dc437514879a873c2 Mon Sep 17 00:00:00 2001
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 4 Jul 2020 21:04:52 +0200
Subject: [PATCH] Add missing guard required for GLES to disable stereo
rendering
2021-11-25 01:20:17 +01:00
fmt.stereo()/StereoRender will evaluate to false for GLES, guard the whole
block so GL_*_RIGHT is not used.
Change the GL_*_LEFT defines for GLES so it actually refers to a front/
back buffer, otherwise on GLES the invalid constant 0 will be used to
select the front (0x404) and back buffer (0x405). Remove GL_*_RIGHT
defines to avoid any accidental, unguarded use.
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00
---
2021-11-25 01:20:17 +01:00
GUISupport/Qt/QVTKOpenGLWindow.cxx | 5 +++++
Rendering/External/vtkExternalOpenGLRenderWindow.cxx | 2 ++
Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx | 2 ++
ThirdParty/glew/vtk_glew.h.in | 6 ++----
4 files changed, 11 insertions(+), 4 deletions(-)
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00
diff --git a/GUISupport/Qt/QVTKOpenGLWindow.cxx b/GUISupport/Qt/QVTKOpenGLWindow.cxx
2021-11-25 01:20:17 +01:00
index 067e27cf6e..79bd714f58 100644
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00
--- a/GUISupport/Qt/QVTKOpenGLWindow.cxx
+++ b/GUISupport/Qt/QVTKOpenGLWindow.cxx
2021-11-25 01:20:17 +01:00
@@ -259,6 +259,7 @@ void QVTKOpenGLWindow::paintGL()
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00
const QSize deviceSize = this->size() * this->devicePixelRatioF();
const auto fmt = this->context()->format();
+#ifndef GL_ES_VERSION_2_0
if (fmt.stereo() && this->RenderWindow->GetStereoRender() &&
this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES)
{
2021-11-25 01:20:17 +01:00
@@ -272,6 +273,10 @@ void QVTKOpenGLWindow::paintGL()
this->RenderWindowAdapter->blit(
this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));
}
+#else
+ this->RenderWindowAdapter->blit(
+ this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize));
+#endif
ostate->Pop();
}
else
diff --git a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
index 445bfce802..d870568f99 100644
--- a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
+++ b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
@@ -64,12 +64,14 @@ void vtkExternalOpenGLRenderWindow::Start()
for (this->GetRenderers()->InitTraversal(sit);
(renderer = this->GetRenderers()->GetNextRenderer(sit));)
{
+#ifndef GL_ES_VERSION_3_0
if (bufferType == GL_BACK_RIGHT || bufferType == GL_RIGHT || bufferType == GL_FRONT_RIGHT)
{
this->StereoRenderOn();
this->SetStereoTypeToRight();
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00
}
else
+#endif
{
2021-11-25 01:20:17 +01:00
this->SetStereoTypeToLeft();
}
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
index 46064d3360..f5b7f6f0c3 100644
--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
@@ -1156,6 +1156,7 @@ void vtkOpenGLRenderWindow::BlitDisplayFramebuffersToHardware()
ostate->vtkglBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+#ifndef GL_ES_VERSION_3_0
if (this->StereoRender && this->StereoType == VTK_STEREO_CRYSTAL_EYES)
{
// bind the read buffer to detach the display framebuffer to be safe
@@ -1168,6 +1169,7 @@ void vtkOpenGLRenderWindow::BlitDisplayFramebuffersToHardware()
ostate->vtkglBlitFramebuffer(0, 0, this->Size[0], this->Size[1], 0, 0, this->Size[0],
this->Size[1], GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
+#endif
ostate->vtkglDrawBuffer(this->DoubleBuffer ? GL_BACK_LEFT : GL_FRONT_LEFT);
// bind the read buffer to detach the display framebuffer to be safe
diff --git a/ThirdParty/glew/vtk_glew.h.in b/ThirdParty/glew/vtk_glew.h.in
index 1763e79319..8b3074b357 100644
--- a/ThirdParty/glew/vtk_glew.h.in
+++ b/ThirdParty/glew/vtk_glew.h.in
@@ -52,10 +52,8 @@
/* some fixes for both ES 2 and 3 */
#ifdef GL_ES_VERSION_3_0
-#define GL_BACK_LEFT 0
-#define GL_BACK_RIGHT 0
-#define GL_FRONT_LEFT 0
-#define GL_FRONT_RIGHT 0
+#define GL_BACK_LEFT GL_BACK
+#define GL_FRONT_LEFT GL_FRONT
/* this sends all the data each time as opposed to allowing a subset */
#define glMultiDrawElements(mode, counts, type, indicies, primcount) \
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00
--
2021-11-25 01:20:17 +01:00
2.33.1
Accepting request 821682 from home:StefanBruens:branches:science - Update to version 9.0.1: * Drop obsolete patches: + bundled_exodusii_add_missing_libpthread.patch + vtk-parallelgeometry-dependency.patch + vtk-qt-5.15-include-QPainterPath.patch - Explicitly enable module RenderingContextOpenGL2 required for PCL - Conditionally add pugixml-devel Requires in devel package - Make devel package installable even when built without Java - Remove CAPITALIZATION from comments - Drop obsolete TK build dependency - Drop unused wget build dependency - Wrap devel-doc generation in bcond (keep defaulted to off), and drop the essentially empty package when disabled. - Fix build on ARM/Qt GLES (boo#1172723): * set VTK_OPENGL_USE_GLES * Add 0001-clean-up-some-old-opengl-es-stuff.patch * Add 0001-Remove-duplicate-check-for-QOpenGLFunctions_3_2_Core.patch * Rebase 0001-Allow-compilation-on-GLES-platforms.patch * Add 0001-Replace-last-glDrawBuffer-call-with-glDrawBuffers-1.patch * Add 0001-Use-2D-textures-for-1D-texture-emulation-on-GLES.patch * Add 0001-Add-missing-guard-required-for-GLES-to-disable-stere.patch * Add 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch * Add 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch * Add 0001-GL_POINT_SPRITE-is-only-available-for-Compatibility-.patch * Add 0002-Guard-GL_LINE_SMOOTH-for-GLES.patch * Add 0001-Guard-glPointSize-with-GL_ES_VERSION_3_0.patch - Add 0001-Fix-PyVTKAddFile_-function-signature-mismatch.patch - Add 0001-Replace-invalid-GL_LINE-with-GL_LINES-for-glDrawArra.patch OBS-URL: https://build.opensuse.org/request/show/821682 OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=164
2020-07-19 00:18:35 +02:00