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
OpenGLRenderer::setupExtensions()
{
#ifndef Q_OS_MACOS
#ifndef NO_BUFFER_STORAGE
if (context->hasExtension("GL_ARB_buffer_storage")) {
hasBufferStorage = true;
@@ -219,7 +219,7 @@ OpenGLRenderer::setupBuffers()
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, unpackBufferID);
if (hasBufferStorage) {
#ifndef Q_OS_MACOS
#ifndef NO_BUFFER_STORAGE
/* 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);

View File

@@ -17,13 +17,17 @@
#ifndef QT_OPENGLRENDERER_HPP
#define QT_OPENGLRENDERER_HPP
#if defined Q_OS_MACOS || __arm__
# define NO_BUFFER_STORAGE
#endif
#include <QOpenGLContext>
#include <QOpenGLExtraFunctions>
#include <QResizeEvent>
#include <QTimer>
#include <QWidget>
#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>
#endif
@@ -94,7 +98,7 @@ private:
/* GL_ARB_buffer_storage */
bool hasBufferStorage = false;
#ifndef Q_OS_MACOS
#ifndef NO_BUFFER_STORAGE
PFNGLBUFFERSTORAGEPROC glBufferStorage = nullptr;
#endif