diff options
Diffstat (limited to 'src/plugins/renderers/opengl')
17 files changed, 37 insertions, 35 deletions
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp index 30a8184b5..5daef2d47 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp @@ -63,7 +63,8 @@ #include <renderbuffer_p.h> #include <glshader_p.h> -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) +#include <QtOpenGL/QOpenGLVersionFunctionsFactory> #include <QOpenGLFunctions_2_0> #include <QOpenGLFunctions_3_2_Core> #include <QOpenGLFunctions_3_3_Core> @@ -384,19 +385,19 @@ GraphicsHelperInterface *GraphicsContext::resolveHighestOpenGLFunctions() } glHelper->initializeHelper(m_gl, nullptr); } -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) else { QAbstractOpenGLFunctions *glFunctions = nullptr; - if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_4_3_Core>()) != nullptr) { + if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_3_Core>()) != nullptr) { qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 4.3"; glHelper = new GraphicsHelperGL4(); - } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_3_3_Core>()) != nullptr) { + } else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_3_Core>()) != nullptr) { qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 3.3"; glHelper = new GraphicsHelperGL3_3(); - } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_3_2_Core>()) != nullptr) { + } else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_2_Core>()) != nullptr) { qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 3.2"; glHelper = new GraphicsHelperGL3_2(); - } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_2_0>()) != nullptr) { + } else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_2_0>()) != nullptr) { qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 2 Helper"; glHelper = new GraphicsHelperGL2(); } @@ -892,7 +893,7 @@ GLint GraphicsContext::elementType(GLint type) case GL_FLOAT_VEC4: return GL_FLOAT; -#ifndef QT_OPENGL_ES_2 // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 +#if !QT_CONFIG(opengles2) // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 case GL_DOUBLE: #ifdef GL_DOUBLE_VEC3 // For compiling on pre GL 4.1 systems case GL_DOUBLE_VEC2: @@ -912,7 +913,7 @@ GLint GraphicsContext::tupleSizeFromType(GLint type) { switch (type) { case GL_FLOAT: -#ifndef QT_OPENGL_ES_2 // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 +#if !QT_CONFIG(opengles2) // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 case GL_DOUBLE: #endif case GL_UNSIGNED_BYTE: @@ -948,7 +949,7 @@ GLuint GraphicsContext::byteSizeFromType(GLint type) { switch (type) { case GL_FLOAT: return sizeof(float); -#ifndef QT_OPENGL_ES_2 // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 +#if !QT_CONFIG(opengles2) // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 case GL_DOUBLE: return sizeof(double); #endif case GL_UNSIGNED_BYTE: return sizeof(unsigned char); @@ -990,7 +991,7 @@ GLint GraphicsContext::glDataTypeFromAttributeDataType(Qt3DCore::QAttribute::Ver #ifdef GL_HALF_FLOAT return GL_HALF_FLOAT; #endif -#ifndef QT_OPENGL_ES_2 // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 +#if !QT_CONFIG(opengles2) // Otherwise compile error as Qt defines GL_DOUBLE as GL_FLOAT when using ES2 case QAttribute::Double: return GL_DOUBLE; #endif diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp index 3ae9ed932..72cee57a4 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp @@ -79,7 +79,7 @@ GraphicsHelperES2::~GraphicsHelperES2() } void GraphicsHelperES2::initializeHelper(QOpenGLContext *context, - QAbstractOpenGLFunctions *) + QAbstractOpenGLFunctions *) { Q_ASSERT(context); m_funcs = context->functions(); diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp index 97a256b9c..c4a68229c 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp @@ -180,7 +180,7 @@ GraphicsHelperES3::~GraphicsHelperES3() } void GraphicsHelperES3::initializeHelper(QOpenGLContext *context, - QAbstractOpenGLFunctions *functions) + QAbstractOpenGLFunctions *functions) { GraphicsHelperES2::initializeHelper(context, functions); m_extraFuncs = context->extraFunctions(); diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp index 6989be743..45704076b 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp @@ -38,7 +38,7 @@ ****************************************************************************/ #include "graphicshelpergl2_p.h" -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) #include <QOpenGLFunctions_2_0> #include <private/attachmentpack_p.h> #include <QtOpenGLExtensions/QOpenGLExtensions> diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h index 7eac312b8..cb38ea481 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h @@ -53,7 +53,7 @@ #include <graphicshelperinterface_p.h> -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) QT_BEGIN_NAMESPACE diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp index cb0a62224..021c668b2 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp @@ -39,7 +39,7 @@ #include "graphicshelpergl3_2_p.h" -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) #include <QOpenGLFunctions_3_2_Core> #include <QOpenGLFunctions_3_3_Core> #include <QtOpenGLExtensions/qopenglextensions.h> diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h index a7396dc87..3e363337d 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h @@ -54,7 +54,7 @@ #include <graphicshelperinterface_p.h> #include <QtCore/qscopedpointer.h> -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) QT_BEGIN_NAMESPACE diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp index f5a61aa4b..200d9c3eb 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp @@ -39,7 +39,7 @@ #include "graphicshelpergl3_3_p.h" -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) #include <QOpenGLFunctions_3_3_Core> #include <QtOpenGLExtensions/qopenglextensions.h> #include <private/attachmentpack_p.h> diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h index 3b667420c..68eebe987 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h @@ -54,7 +54,7 @@ #include <graphicshelperinterface_p.h> #include <QtCore/qscopedpointer.h> -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) QT_BEGIN_NAMESPACE diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp index 96e055870..0a36e6a24 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp @@ -39,7 +39,7 @@ #include "graphicshelpergl4_p.h" -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) #include <QOpenGLFunctions_4_3_Core> #include <QtOpenGLExtensions/qopenglextensions.h> #include <private/attachmentpack_p.h> diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h index 1fa390806..8d3e8f957 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h @@ -54,7 +54,7 @@ #include <graphicshelperinterface_p.h> #include <QtCore/qscopedpointer.h> -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) QT_BEGIN_NAMESPACE diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h index bbbf05ee0..b574c34a1 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h @@ -53,6 +53,7 @@ #include <QOpenGLFunctions> #include <QOpenGLTexture> +#include <QOpenGLVersionFunctions> #include <QVector> #include <shadervariables_p.h> #include <Qt3DRender/private/uniform_p.h> diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp index d4d3457ab..0cba8760c 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -66,7 +66,7 @@ #include <openglvertexarrayobject_p.h> #include <QOpenGLShaderProgram> -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) #include <QOpenGLFunctions_2_0> #include <QOpenGLFunctions_3_2_Core> #include <QOpenGLFunctions_3_3_Core> @@ -628,7 +628,7 @@ QImage SubmissionContext::readFramebuffer(const QRect &rect) case QAbstractTexture::RGBA8_UNorm: case QAbstractTexture::RGBA8U: case QAbstractTexture::SRGB8_Alpha8: -#ifdef QT_OPENGL_ES_2 +#if QT_CONFIG(opengles2) format = GL_RGBA; imageFormat = QImage::Format_RGBA8888_Premultiplied; #else @@ -644,7 +644,7 @@ QImage SubmissionContext::readFramebuffer(const QRect &rect) case QAbstractTexture::RGBFormat: case QAbstractTexture::RGB8U: case QAbstractTexture::RGB8_UNorm: -#ifdef QT_OPENGL_ES_2 +#if QT_CONFIG(opengles2) format = GL_RGBA; imageFormat = QImage::Format_RGBX8888; #else @@ -656,7 +656,7 @@ QImage SubmissionContext::readFramebuffer(const QRect &rect) bytes = area * 4; stride = rect.width() * 4; break; -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) case QAbstractTexture::RG11B10F: bytes = area * 4; format = GL_RGB; @@ -1074,7 +1074,7 @@ void SubmissionContext::resetMasked(qint64 maskOfStatesToReset) if (maskOfStatesToReset & LineWidthMask) funcs->glLineWidth(1.0f); -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) if (maskOfStatesToReset & RasterModeMask) m_glHelper->rasterMode(GL_FRONT_AND_BACK, GL_FILL); #endif diff --git a/src/plugins/renderers/opengl/renderer/frameprofiler_p.h b/src/plugins/renderers/opengl/renderer/frameprofiler_p.h index 591ace53e..f1d235724 100644 --- a/src/plugins/renderers/opengl/renderer/frameprofiler_p.h +++ b/src/plugins/renderers/opengl/renderer/frameprofiler_p.h @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) && !QT_CONFIG(opengles2) #define QT3D_SUPPORTS_GL_MONITOR #endif diff --git a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h index ff58b3074..7ab7fbb05 100644 --- a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h +++ b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <QtGui/qopenglvertexarrayobject.h> +#include <QOpenGLVertexArrayObject> #include <submissioncontext_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/renderers/opengl/renderer/renderer.cpp b/src/plugins/renderers/opengl/renderer/renderer.cpp index 57ee5ec88..45b74d924 100644 --- a/src/plugins/renderers/opengl/renderer/renderer.cpp +++ b/src/plugins/renderers/opengl/renderer/renderer.cpp @@ -866,7 +866,6 @@ void Renderer::enqueueRenderView(RenderView *renderView, int submitOrder) } bool Renderer::canRender() const - { // Make sure that we've not been told to terminate if (m_renderThread && !m_running.loadRelaxed()) { diff --git a/src/plugins/renderers/opengl/textures/gltexture.cpp b/src/plugins/renderers/opengl/textures/gltexture.cpp index 30247a719..a44ef6877 100644 --- a/src/plugins/renderers/opengl/textures/gltexture.cpp +++ b/src/plugins/renderers/opengl/textures/gltexture.cpp @@ -45,6 +45,7 @@ #include <private/qopengltexturehelper_p.h> #include <QDebug> #include <QOpenGLFunctions> +#include <QtOpenGL/QOpenGLVersionFunctionsFactory> #include <QOpenGLTexture> #include <QOpenGLPixelTransferOptions> #include <Qt3DRender/qtexture.h> @@ -55,7 +56,7 @@ #include <Qt3DRender/private/qtextureimagedata_p.h> #include <renderbuffer_p.h> -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) #include <QOpenGLFunctions_3_1> #include <QOpenGLFunctions_4_5_Core> #endif @@ -660,7 +661,7 @@ void GLTexture::introspectPropertiesFromSharedTextureId() const QAbstractTexture::Target targets[] = { QAbstractTexture::Target2D, QAbstractTexture::TargetCubeMap, -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) QAbstractTexture::Target1D, QAbstractTexture::Target1DArray, QAbstractTexture::Target3D, @@ -673,13 +674,13 @@ void GLTexture::introspectPropertiesFromSharedTextureId() #endif }; -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) // Try to find texture target with GL 4.5 functions const QPair<int, int> ctxGLVersion = ctx->format().version(); if (ctxGLVersion.first > 4 || (ctxGLVersion.first == 4 && ctxGLVersion.second >= 5)) { // Only for GL 4.5+ #ifdef GL_TEXTURE_TARGET - QOpenGLFunctions_4_5_Core *gl5 = ctx->versionFunctions<QOpenGLFunctions_4_5_Core>(); + QOpenGLFunctions_4_5_Core *gl5 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_5_Core>(); if (gl5 != nullptr) gl5->glGetTextureParameteriv(m_sharedTextureId, GL_TEXTURE_TARGET, reinterpret_cast<int *>(&m_properties.target)); #endif @@ -694,7 +695,7 @@ void GLTexture::introspectPropertiesFromSharedTextureId() const GLenum targetBindings[] = { GL_TEXTURE_BINDING_2D, GL_TEXTURE_BINDING_CUBE_MAP, -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) GL_TEXTURE_BINDING_1D, GL_TEXTURE_BINDING_1D_ARRAY, GL_TEXTURE_BINDING_3D, @@ -748,10 +749,10 @@ void GLTexture::introspectPropertiesFromSharedTextureId() gl->glGetTexParameteriv(int(m_properties.target), GL_TEXTURE_WRAP_S, reinterpret_cast<int *>(&m_parameters.wrapModeY)); gl->glGetTexParameteriv(int(m_properties.target), GL_TEXTURE_WRAP_T, reinterpret_cast<int *>(&m_parameters.wrapModeZ)); -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) // Try to retrieve dimensions (not available on ES 2.0) if (!ctx->isOpenGLES()) { - QOpenGLFunctions_3_1 *gl3 = ctx->versionFunctions<QOpenGLFunctions_3_1>(); + QOpenGLFunctions_3_1 *gl3 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_1>(); if (!gl3) { qWarning() << "Failed to retrieve shared texture dimensions"; return; |