Merge pull request #2183 from ts-korhonen/qt-opengl-renderer

qt: fix linux arm32 build error
This commit is contained in:
Miran Grča
2022-03-01 19:47:53 +01:00
committed by GitHub
2 changed files with 8 additions and 4 deletions

View File

@@ -202,7 +202,7 @@ OpenGLRenderer::getOptions(QWidget *parent)
void void
OpenGLRenderer::setupExtensions() OpenGLRenderer::setupExtensions()
{ {
#ifndef Q_OS_MACOS #ifndef NO_BUFFER_STORAGE
if (context->hasExtension("GL_ARB_buffer_storage")) { if (context->hasExtension("GL_ARB_buffer_storage")) {
hasBufferStorage = true; hasBufferStorage = true;
@@ -219,7 +219,7 @@ OpenGLRenderer::setupBuffers()
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, unpackBufferID); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, unpackBufferID);
if (hasBufferStorage) { if (hasBufferStorage) {
#ifndef Q_OS_MACOS #ifndef NO_BUFFER_STORAGE
/* Create persistent buffer for pixel transfer. */ /* Create persistent buffer for pixel transfer. */
glBufferStorage(GL_PIXEL_UNPACK_BUFFER, BUFFERBYTES * BUFFERCOUNT, NULL, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); glBufferStorage(GL_PIXEL_UNPACK_BUFFER, BUFFERBYTES * BUFFERCOUNT, NULL, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);

View File

@@ -17,13 +17,17 @@
#ifndef QT_OPENGLRENDERER_HPP #ifndef QT_OPENGLRENDERER_HPP
#define QT_OPENGLRENDERER_HPP #define QT_OPENGLRENDERER_HPP
#if defined Q_OS_MACOS || __arm__
# define NO_BUFFER_STORAGE
#endif
#include <QOpenGLContext> #include <QOpenGLContext>
#include <QOpenGLExtraFunctions> #include <QOpenGLExtraFunctions>
#include <QResizeEvent> #include <QResizeEvent>
#include <QTimer> #include <QTimer>
#include <QWidget> #include <QWidget>
#include <QWindow> #include <QWindow>
#if !defined Q_OS_MACOS && !(QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if !defined NO_BUFFER_STORAGE && !(QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
# include <QtOpenGLExtensions/QOpenGLExtensions> # include <QtOpenGLExtensions/QOpenGLExtensions>
#endif #endif
@@ -94,7 +98,7 @@ private:
/* GL_ARB_buffer_storage */ /* GL_ARB_buffer_storage */
bool hasBufferStorage = false; bool hasBufferStorage = false;
#ifndef Q_OS_MACOS #ifndef NO_BUFFER_STORAGE
PFNGLBUFFERSTORAGEPROC glBufferStorage = nullptr; PFNGLBUFFERSTORAGEPROC glBufferStorage = nullptr;
#endif #endif