diff options
Diffstat (limited to 'src/plugins')
26 files changed, 62 insertions, 47 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; diff --git a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp index 5b217929c..2d0292d9d 100644 --- a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp +++ b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp @@ -39,6 +39,7 @@ #include "submissioncontext_p.h" +#include <Qt3DCore/private/qbuffer_p.h> #include <Qt3DRender/qgraphicsapifilter.h> #include <Qt3DRender/qparameter.h> #include <Qt3DRender/qcullface.h> @@ -60,7 +61,6 @@ #include <Qt3DRender/private/buffermanager_p.h> #include <Qt3DRender/private/managers_p.h> #include <Qt3DRender/private/attachmentpack_p.h> -#include <Qt3DRender/private/qbuffer_p.h> #include <Qt3DRender/private/stringtoint_p.h> #include <Qt3DRender/private/vulkaninstance_p.h> #include <QGuiApplication> @@ -96,6 +96,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt3DCore; + namespace Qt3DRender { namespace Render { namespace Rhi { @@ -1514,7 +1516,7 @@ void SubmissionContext::uploadDataToRHIBuffer(Buffer *buffer, RHIBuffer *b, bool // Note: we are only storing the updates data CPU side at this point // actually upload will be performed when the buffer will be bound // as we would otherwise need to know the usage type of the buffer - QVector<Qt3DRender::QBufferUpdate> updates = std::move(buffer->pendingBufferUpdates()); + QVector<Qt3DCore::QBufferUpdate> updates = std::move(buffer->pendingBufferUpdates()); for (auto it = updates.begin(); it != updates.end(); ++it) { auto update = it; // We have a partial update diff --git a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h index 7578639e6..979bf7ec9 100644 --- a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h +++ b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext_p.h @@ -54,7 +54,6 @@ #include <rhibuffer_p.h> #include <Qt3DRender/qclearbuffers.h> -#include <Qt3DRender/qattribute.h> #include <Qt3DRender/private/handle_types_p.h> #include <Qt3DRender/qblitframebuffer.h> #include <Qt3DRender/private/shader_p.h> diff --git a/src/plugins/renderers/rhi/managers/rhiresourcemanagers_p.h b/src/plugins/renderers/rhi/managers/rhiresourcemanagers_p.h index 34758530d..3d78c5d07 100644 --- a/src/plugins/renderers/rhi/managers/rhiresourcemanagers_p.h +++ b/src/plugins/renderers/rhi/managers/rhiresourcemanagers_p.h @@ -132,6 +132,13 @@ inline uint qHash(const GraphicsPipelineIdentifier &key, uint seed) return qHash(p, seed) + qHash(key.renderViewIndex, seed); } +inline uint qHash(const GraphicsPipelineIdentifier &key) +{ + const QPair<HGeometry, Qt3DCore::QNodeId> p = { key.geometry, key.shader }; + using QT_PREPEND_NAMESPACE(qHash); + return qHash(p) + qHash(key.renderViewIndex); +} + inline bool operator==(const GraphicsPipelineIdentifier &a, const GraphicsPipelineIdentifier &b) { return a.geometry == b.geometry && a.shader == b.shader diff --git a/src/plugins/renderers/rhi/renderer/rendercommand.cpp b/src/plugins/renderers/rhi/renderer/rendercommand.cpp index 8320abac1..065bc71a0 100644 --- a/src/plugins/renderers/rhi/renderer/rendercommand.cpp +++ b/src/plugins/renderers/rhi/renderer/rendercommand.cpp @@ -62,7 +62,7 @@ RenderCommand::RenderCommand() m_instanceCount(0), m_indexOffset(0), m_indexAttributeByteOffset(0), - m_indexAttributeDataType(Qt3DRender::QAttribute::UnsignedShort), + m_indexAttributeDataType(Qt3DCore::QAttribute::UnsignedShort), m_indirectAttributeByteOffset(0), m_drawIndexed(false), m_drawIndirect(false), diff --git a/src/plugins/renderers/rhi/renderer/rendercommand_p.h b/src/plugins/renderers/rhi/renderer/rendercommand_p.h index e6924a60c..decc87230 100644 --- a/src/plugins/renderers/rhi/renderer/rendercommand_p.h +++ b/src/plugins/renderers/rhi/renderer/rendercommand_p.h @@ -62,7 +62,7 @@ #include <QOpenGLTexture> #include <QMatrix4x4> #include <QtGui/private/qrhi_p.h> -#include <Qt3DRender/qattribute.h> +#include <Qt3DCore/qattribute.h> QT_BEGIN_NAMESPACE class QRhiGraphicsPipeline; @@ -137,7 +137,7 @@ public: int m_instanceCount; int m_indexOffset; uint m_indexAttributeByteOffset; - Qt3DRender::QAttribute::VertexBaseType m_indexAttributeDataType; + Qt3DCore::QAttribute::VertexBaseType m_indexAttributeDataType; uint m_indirectAttributeByteOffset; bool m_drawIndexed; bool m_drawIndirect; diff --git a/src/plugins/renderers/rhi/renderer/renderer.cpp b/src/plugins/renderers/rhi/renderer/renderer.cpp index ee9a26a98..c27a4e097 100644 --- a/src/plugins/renderers/rhi/renderer/renderer.cpp +++ b/src/plugins/renderers/rhi/renderer/renderer.cpp @@ -73,7 +73,6 @@ #include <Qt3DRender/private/geometryrenderermanager_p.h> #include <Qt3DRender/private/techniquemanager_p.h> #include <Qt3DRender/private/platformsurfacefilter_p.h> -#include <Qt3DRender/private/loadbufferjob_p.h> #include <Qt3DRender/private/rendercapture_p.h> #include <Qt3DRender/private/updatelevelofdetailjob_p.h> #include <Qt3DRender/private/buffercapture_p.h> @@ -1286,7 +1285,7 @@ void Renderer::lookForDownloadableBuffers() const QVector<HBuffer> activeBufferHandles = m_nodesManager->bufferManager()->activeHandles(); for (const HBuffer &handle : activeBufferHandles) { Buffer *buffer = m_nodesManager->bufferManager()->data(handle); - if (buffer->access() & QBuffer::Read) + if (buffer->access() & Qt3DCore::QBuffer::Read) m_downloadableBuffers.push_back(buffer->peerId()); } } diff --git a/src/plugins/renderers/rhi/renderer/renderview.cpp b/src/plugins/renderers/rhi/renderer/renderview.cpp index 54295ef5f..789118f60 100644 --- a/src/plugins/renderers/rhi/renderer/renderview.cpp +++ b/src/plugins/renderers/rhi/renderer/renderview.cpp @@ -621,6 +621,8 @@ EntityRenderCommandData RenderView::buildDrawRenderCommands(const QVector<Entity const QVector<Qt3DCore::QNodeId> attributeIds = geometry->attributes(); for (Qt3DCore::QNodeId attributeId : attributeIds) { + using namespace Qt3DCore; + Attribute *attribute = m_manager->attributeManager()->lookupResource(attributeId); switch (attribute->attributeType()) { diff --git a/src/plugins/renderers/rhi/renderer/renderviewbuilder.cpp b/src/plugins/renderers/rhi/renderer/renderviewbuilder.cpp index 6455d2e10..72c27de1d 100644 --- a/src/plugins/renderers/rhi/renderer/renderviewbuilder.cpp +++ b/src/plugins/renderers/rhi/renderer/renderviewbuilder.cpp @@ -466,9 +466,13 @@ public: m_renderer->cache()->leafNodeCache[m_leafNode]; dataCacheForLeaf.materialParameterGatherer.clear(); - for (const auto &materialGatherer : qAsConst(m_materialParameterGathererJobs)) - dataCacheForLeaf.materialParameterGatherer.unite( - materialGatherer->materialToPassAndParameter()); + for (const auto &materialGatherer : qAsConst(m_materialParameterGathererJobs)) { + const MaterialParameterGathererData &source = materialGatherer->materialToPassAndParameter(); + for (auto it = std::begin(source); it != std::end(source); ++it) { + Q_ASSERT(!dataCacheForLeaf.materialParameterGatherer.contains(it.key())); + dataCacheForLeaf.materialParameterGatherer.insert(it.key(), it.value()); + } + } } private: diff --git a/src/plugins/renderers/rhi/textures/texture_p.h b/src/plugins/renderers/rhi/textures/texture_p.h index 536cb962e..c78bc1c1b 100644 --- a/src/plugins/renderers/rhi/textures/texture_p.h +++ b/src/plugins/renderers/rhi/textures/texture_p.h @@ -53,7 +53,7 @@ #include <Qt3DRender/qtexture.h> #include <Qt3DRender/qtextureimagedata.h> -#include <Qt3DRender/qtexturegenerator.h> +#include <Qt3DRender/private/qtexturegenerator_p.h> #include <Qt3DRender/private/backendnode_p.h> #include <Qt3DRender/private/handle_types_p.h> #include <Qt3DRender/private/texture_p.h> |