vtk/0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch
Stefan Brüns e8cb4e64b5 - Fix broken LD_LIBRARY_PATH mangling for openmpi builds
- Rebase GLES patches:
  * 0001-Correct-GL_BACK-GL_BACK_LEFT-mapping-on-GLES.patch
  * 0002-Use-GL_DRAW_BUFFER0-instead-of-GL_DRAW_BUFFER-for-GL.patch
- Drop obsolete patch:
  * Do-not-request-CUBE_MAP_SEAMLESS-on-GLES.patch
- - Update to version 9.4.0, see:
  https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/release/9.4.md
- Drop upstream patches:
  * 0001-ioss-update-fmt-includes.patch
- Add patches:
  * 0001-Add-missing-libm-link-library-for-bundled-ExodusII.patch
  * 0001-Fix-fmt-includes-again.patch
  * 0001-Fix-missing-GLAD-symbol-mangling-in-Rendering-GL2PSO.patch

OBS-URL: https://build.opensuse.org/package/show/science/vtk?expand=0&rev=196
2024-12-25 00:53:14 +00:00

57 lines
2.0 KiB
Diff

From c048ec987bf06d76ca19a292af2b5d6641cf4587 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Thu, 16 Jul 2020 03:52:23 +0200
Subject: [PATCH 1/2] Correct GL_BACK/GL_BACK_LEFT mapping on GLES
GLES does not have LEFT/RIGHT targets for the default framebuffer, but
just GL_BACK, so there is no need to remap it. Desktop GL may have
LEFT and RIGHT attached at the simultaneously, so one of the buffers
has to be selected when querying the attributes.
---
Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
index 514e960b..394128b0 100644
--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
@@ -890,6 +890,11 @@ bool vtkOpenGLRenderWindow::GetUsingSRGBColorSpace()
{
this->MakeCurrent();
+#ifdef GL_ES_VERSION_3_0
+ // GLES only has the GL_BACK color
+ // attachment for the default framebuffer
+ return this->UseSRGBColorSpace;
+#else
GLint attachment = GL_BACK_LEFT;
#ifdef GL_DRAW_BUFFER
glGetIntegerv(GL_DRAW_BUFFER, &attachment);
@@ -923,6 +928,7 @@ bool vtkOpenGLRenderWindow::GetUsingSRGBColorSpace()
}
vtkDebugMacro(<< "Error getting color encoding!");
return false;
+#endif
}
vtkDebugMacro(<< "OpenGL is not initialized yet!");
@@ -950,6 +956,7 @@ int vtkOpenGLRenderWindow::GetColorBufferSizes(int* rgba)
#ifdef GL_DRAW_BUFFER
glGetIntegerv(GL_DRAW_BUFFER, &attachment);
#endif
+#ifdef GL_ES_VERSION_3_0
// GL seems odd with its handling of left/right.
// if it says we are using GL_FRONT or GL_BACK
// then convert those to GL_FRONT_LEFT and
@@ -971,6 +978,7 @@ int vtkOpenGLRenderWindow::GetColorBufferSizes(int* rgba)
// before querying the color buffer sizes.
attachment = GL_BACK_LEFT;
}
+#endif
// make sure we clear any errors before we start
// otherwise we may get incorrect results
--
2.47.1