diff options
26 files changed, 124 insertions, 124 deletions
diff --git a/examples/qt3d/compute-particles/ComputeFrameGraph.qml b/examples/qt3d/compute-particles/ComputeFrameGraph.qml index 902d8ef74..17b3b27db 100644 --- a/examples/qt3d/compute-particles/ComputeFrameGraph.qml +++ b/examples/qt3d/compute-particles/ComputeFrameGraph.qml @@ -77,7 +77,7 @@ Viewport { CameraSelector { id: selector TechniqueFilter { - MemoryBarrier { barrierTypes: MemoryBarrier.VertexAttributeArrayBarrier } + MemoryBarrier { waitFor: MemoryBarrier.VertexAttributeArray } matchAll: [ FilterKey { name: "type"; value: "draw"} ] diff --git a/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp b/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp index a899d36c5..0754a0cf5 100644 --- a/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp +++ b/src/quick3d/quick3drender/items/quick3dmemorybarrier.cpp @@ -55,16 +55,16 @@ Quick3DMemoryBarrier::~Quick3DMemoryBarrier() { } -void Quick3DMemoryBarrier::setBarrierTypesInt(int barrierTypes) +void Quick3DMemoryBarrier::setWaitFor(int barrierTypes) { - QMemoryBarrier::BarrierTypes types(QMemoryBarrier::AllBarrier); + QMemoryBarrier::Operations types(QMemoryBarrier::All); types &= barrierTypes; // Will only keep flags that are actually set - parentBarrier()->setBarrierTypes(types); + parentBarrier()->setWaitOperations(types); } -int Quick3DMemoryBarrier::barrierTypesInt() const +int Quick3DMemoryBarrier::waitFor() const { - return QMemoryBarrier::BarrierTypes::Int(parentBarrier()->barrierTypes()); + return QMemoryBarrier::Operations::Int(parentBarrier()->waitOperations()); } } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h b/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h index 5e402f006..ab8f72a76 100644 --- a/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h +++ b/src/quick3d/quick3drender/items/quick3dmemorybarrier_p.h @@ -65,15 +65,15 @@ namespace Quick { class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DMemoryBarrier : public QObject { Q_OBJECT - Q_PROPERTY(int barrierTypes READ barrierTypesInt WRITE setBarrierTypesInt) + Q_PROPERTY(int waitFor READ waitFor WRITE setWaitFor) public: explicit Quick3DMemoryBarrier(QObject *parent = nullptr); ~Quick3DMemoryBarrier(); inline QMemoryBarrier *parentBarrier() const { return qobject_cast<QMemoryBarrier*>(parent()); } - void setBarrierTypesInt(int barrierTypes); - int barrierTypesInt() const; + void setWaitFor(int waitOperations); + int waitFor() const; }; } // namespace Quick diff --git a/src/render/backend/renderview_p.h b/src/render/backend/renderview_p.h index 92fb502d9..5c0f5971a 100644 --- a/src/render/backend/renderview_p.h +++ b/src/render/backend/renderview_p.h @@ -221,8 +221,8 @@ public: inline void setRenderCaptureNodeId(const Qt3DCore::QNodeId nodeId) Q_DECL_NOTHROW { m_renderCaptureNodeId = nodeId; } inline const Qt3DCore::QNodeId renderCaptureNodeId() const Q_DECL_NOTHROW { return m_renderCaptureNodeId; } - void setMemoryBarrier(QMemoryBarrier::BarrierTypes barrier) Q_DECL_NOTHROW { m_memoryBarrier = barrier; } - QMemoryBarrier::BarrierTypes memoryBarrier() const Q_DECL_NOTHROW { return m_memoryBarrier; } + void setMemoryBarrier(QMemoryBarrier::Operations barrier) Q_DECL_NOTHROW { m_memoryBarrier = barrier; } + QMemoryBarrier::Operations memoryBarrier() const Q_DECL_NOTHROW { return m_memoryBarrier; } // Helps making the size of RenderView smaller // Contains all the data needed for the actual building of the RenderView @@ -282,7 +282,7 @@ private: bool m_compute:1; bool m_frustumCulling:1; int m_workGroups[3]; - QMemoryBarrier::BarrierTypes m_memoryBarrier; + QMemoryBarrier::Operations m_memoryBarrier; // We do not use pointers to RenderNodes or Drawable's here so that the // render aspect is free to change the drawables on the next frame whilst diff --git a/src/render/framegraph/memorybarrier.cpp b/src/render/framegraph/memorybarrier.cpp index c82f6eae8..ee8f156e3 100644 --- a/src/render/framegraph/memorybarrier.cpp +++ b/src/render/framegraph/memorybarrier.cpp @@ -49,7 +49,7 @@ namespace Render { MemoryBarrier::MemoryBarrier() : FrameGraphNode(FrameGraphNode::MemoryBarrier) - , m_barrierTypes(QMemoryBarrier::None) + , m_waitOperations(QMemoryBarrier::None) { } @@ -57,17 +57,17 @@ MemoryBarrier::~MemoryBarrier() { } -QMemoryBarrier::BarrierTypes MemoryBarrier::barrierTypes() const +QMemoryBarrier::Operations MemoryBarrier::waitOperations() const { - return m_barrierTypes; + return m_waitOperations; } void MemoryBarrier::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) { if (e->type() == Qt3DCore::PropertyUpdated) { Qt3DCore::QPropertyUpdatedChangePtr propertyChange = qSharedPointerCast<Qt3DCore::QPropertyUpdatedChange>(e); - if (propertyChange->propertyName() == QByteArrayLiteral("barrierTypes")) { - m_barrierTypes = propertyChange->value().value<QMemoryBarrier::BarrierTypes>(); + if (propertyChange->propertyName() == QByteArrayLiteral("waitOperations")) { + m_waitOperations = propertyChange->value().value<QMemoryBarrier::Operations>(); markDirty(AbstractRenderer::AllDirty); } } @@ -79,7 +79,7 @@ void MemoryBarrier::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr FrameGraphNode::initializeFromPeer(change); const auto typedChange = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<QMemoryBarrierData>>(change); const QMemoryBarrierData &data = typedChange->data; - m_barrierTypes = data.barrierTypes; + m_waitOperations = data.waitOperations; } } // Render diff --git a/src/render/framegraph/memorybarrier_p.h b/src/render/framegraph/memorybarrier_p.h index 4c0242476..66a3ae823 100644 --- a/src/render/framegraph/memorybarrier_p.h +++ b/src/render/framegraph/memorybarrier_p.h @@ -66,12 +66,12 @@ public: MemoryBarrier(); ~MemoryBarrier(); - QMemoryBarrier::BarrierTypes barrierTypes() const; + QMemoryBarrier::Operations waitOperations() const; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE; private: void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_FINAL; - QMemoryBarrier::BarrierTypes m_barrierTypes; + QMemoryBarrier::Operations m_waitOperations; }; } // Render diff --git a/src/render/framegraph/qmemorybarrier.cpp b/src/render/framegraph/qmemorybarrier.cpp index 9aa3ba560..0633e203e 100644 --- a/src/render/framegraph/qmemorybarrier.cpp +++ b/src/render/framegraph/qmemorybarrier.cpp @@ -97,30 +97,30 @@ namespace Qt3DRender { */ /*! - \enum QMemoryBarrier::BarrierType + \enum QMemoryBarrier::Operation This enum type describes types of buffer to be cleared. \value None - \value ElementArrayBarrier - \value UniformBarrier - \value TextureFetchBarrier - \value ShaderImageAccessBarrier - \value CommandBarrier - \value PixelBufferBarrier - \value TextureUpdateBarrier - \value BufferUpdateBarrier - \value FrameBufferBarrier - \value TransformFeedbackBarrier - \value AtomicCounterBarrier - \value ShaderStorageBarrier - \value QueryBufferBarrier - \value AllBarrier + \value ElementArray + \value Uniform + \value TextureFetch + \value ShaderImageAccess + \value Command + \value PixelBuffer + \value TextureUpdate + \value BufferUpdate + \value FrameBuffer + \value TransformFeedback + \value AtomicCounter + \value ShaderStorage + \value QueryBuffer + \value All */ QMemoryBarrierPrivate::QMemoryBarrierPrivate() : QFrameGraphNodePrivate() - , m_barrierTypes(QMemoryBarrier::None) + , m_waitOperations(QMemoryBarrier::None) { } @@ -133,20 +133,20 @@ QMemoryBarrier::~QMemoryBarrier() { } -void QMemoryBarrier::setBarrierTypes(QMemoryBarrier::BarrierTypes barrierTypes) +void QMemoryBarrier::setWaitOperations(QMemoryBarrier::Operations waitOperations) { Q_D(QMemoryBarrier); - if (barrierTypes != d->m_barrierTypes) { - d->m_barrierTypes = barrierTypes; - emit barrierTypesChanged(barrierTypes); - d->notifyPropertyChange("barrierTypes", QVariant::fromValue(barrierTypes)); + if (waitOperations != d->m_waitOperations) { + d->m_waitOperations = waitOperations; + emit waitOperationsChanged(waitOperations); + d->notifyPropertyChange("waitOperations", QVariant::fromValue(waitOperations)); } } -QMemoryBarrier::BarrierTypes QMemoryBarrier::barrierTypes() const +QMemoryBarrier::Operations QMemoryBarrier::waitOperations() const { Q_D(const QMemoryBarrier); - return d->m_barrierTypes; + return d->m_waitOperations; } QMemoryBarrier::QMemoryBarrier(QMemoryBarrierPrivate &dd, Qt3DCore::QNode *parent) @@ -159,7 +159,7 @@ Qt3DCore::QNodeCreatedChangeBasePtr QMemoryBarrier::createNodeCreationChange() c auto creationChange = QFrameGraphNodeCreatedChangePtr<QMemoryBarrierData>::create(this); QMemoryBarrierData &data = creationChange->data; Q_D(const QMemoryBarrier); - data.barrierTypes = d->m_barrierTypes; + data.waitOperations = d->m_waitOperations; return creationChange; } diff --git a/src/render/framegraph/qmemorybarrier.h b/src/render/framegraph/qmemorybarrier.h index 8b73c86bf..aaeeac6bc 100644 --- a/src/render/framegraph/qmemorybarrier.h +++ b/src/render/framegraph/qmemorybarrier.h @@ -55,33 +55,33 @@ public: explicit QMemoryBarrier(Qt3DCore::QNode *parent = nullptr); ~QMemoryBarrier(); - enum BarrierType { + enum Operation { None = 0, - VertexAttributeArrayBarrier = (1 << 0), - ElementArrayBarrier = (1 << 1), - UniformBarrier = (1 << 2), - TextureFetchBarrier = (1 << 3), - ShaderImageAccessBarrier = (1 << 4), - CommandBarrier = (1 << 5), - PixelBufferBarrier = (1 << 6), - TextureUpdateBarrier = (1 << 7), - BufferUpdateBarrier = (1 << 8), - FrameBufferBarrier = (1 << 9), - TransformFeedbackBarrier = (1 << 10), - AtomicCounterBarrier = (1 << 11), - ShaderStorageBarrier = (1 << 12), - QueryBufferBarrier = (1 << 13), - AllBarrier = 0xFFFFFFFF + VertexAttributeArray = (1 << 0), + ElementArray = (1 << 1), + Uniform = (1 << 2), + TextureFetch = (1 << 3), + ShaderImageAccess = (1 << 4), + Command = (1 << 5), + PixelBuffer = (1 << 6), + TextureUpdate = (1 << 7), + BufferUpdate = (1 << 8), + FrameBuffer = (1 << 9), + TransformFeedback = (1 << 10), + AtomicCounter = (1 << 11), + ShaderStorage = (1 << 12), + QueryBuffer = (1 << 13), + All = 0xFFFFFFFF }; - Q_ENUM(BarrierType) - Q_DECLARE_FLAGS(BarrierTypes, BarrierType) + Q_ENUM(Operation) + Q_DECLARE_FLAGS(Operations, Operation) public Q_SLOTS: - void setBarrierTypes(QMemoryBarrier::BarrierTypes barrierTypes); - BarrierTypes barrierTypes() const; + void setWaitOperations(QMemoryBarrier::Operations operations); + Operations waitOperations() const; Q_SIGNALS: - void barrierTypesChanged(QMemoryBarrier::BarrierTypes barrierTypes); + void waitOperationsChanged(QMemoryBarrier::Operations barrierTypes); protected: explicit QMemoryBarrier(QMemoryBarrierPrivate &dd, Qt3DCore::QNode *parent = nullptr); @@ -95,6 +95,6 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(Qt3DRender::QMemoryBarrier::BarrierTypes) +Q_DECLARE_METATYPE(Qt3DRender::QMemoryBarrier::Operations) #endif // QT3DRENDER_QMEMORYBARRIER_H diff --git a/src/render/framegraph/qmemorybarrier_p.h b/src/render/framegraph/qmemorybarrier_p.h index 09df0c89c..384dbee3d 100644 --- a/src/render/framegraph/qmemorybarrier_p.h +++ b/src/render/framegraph/qmemorybarrier_p.h @@ -63,12 +63,12 @@ public: QMemoryBarrierPrivate(); Q_DECLARE_PUBLIC(QMemoryBarrier) - QMemoryBarrier::BarrierTypes m_barrierTypes; + QMemoryBarrier::Operations m_waitOperations; }; struct QMemoryBarrierData { - QMemoryBarrier::BarrierTypes barrierTypes; + QMemoryBarrier::Operations waitOperations; }; } // namespace Qt3DRender diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp index c6a7aaff3..875f619b8 100644 --- a/src/render/graphicshelpers/graphicscontext.cpp +++ b/src/render/graphicshelpers/graphicscontext.cpp @@ -1477,7 +1477,7 @@ bool GraphicsContext::hasGLBufferForBuffer(Buffer *buffer) return (it != m_renderBufferHash.end()); } -void GraphicsContext::memoryBarrier(QMemoryBarrier::BarrierTypes barriers) +void GraphicsContext::memoryBarrier(QMemoryBarrier::Operations barriers) { m_glHelper->memoryBarrier(barriers); } diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h index 0d9b24b6e..4358da999 100644 --- a/src/render/graphicshelpers/graphicscontext_p.h +++ b/src/render/graphicshelpers/graphicscontext_p.h @@ -163,7 +163,7 @@ public: void releaseBuffer(Qt3DCore::QNodeId bufferId); bool hasGLBufferForBuffer(Buffer *buffer); - void memoryBarrier(QMemoryBarrier::BarrierTypes barriers); + void memoryBarrier(QMemoryBarrier::Operations barriers); void setParameters(ShaderParameterPack ¶meterPack); diff --git a/src/render/graphicshelpers/graphicshelperes2.cpp b/src/render/graphicshelpers/graphicshelperes2.cpp index 08331e192..3b821f804 100644 --- a/src/render/graphicshelpers/graphicshelperes2.cpp +++ b/src/render/graphicshelpers/graphicshelperes2.cpp @@ -498,7 +498,7 @@ GLint GraphicsHelperES2::maxClipPlaneCount() return 0; } -void GraphicsHelperES2::memoryBarrier(QMemoryBarrier::BarrierTypes barriers) +void GraphicsHelperES2::memoryBarrier(QMemoryBarrier::Operations barriers) { Q_UNUSED(barriers); qWarning() << "memory barrier is not supported by OpenGL ES 2.0 (since 4.3)"; diff --git a/src/render/graphicshelpers/graphicshelperes2_p.h b/src/render/graphicshelpers/graphicshelperes2_p.h index 25f6c8cd8..f34eb7f87 100644 --- a/src/render/graphicshelpers/graphicshelperes2_p.h +++ b/src/render/graphicshelpers/graphicshelperes2_p.h @@ -110,7 +110,7 @@ public: void initializeHelper(QOpenGLContext *context, QAbstractOpenGLFunctions *functions) Q_DECL_OVERRIDE; void pointSize(bool programmable, GLfloat value) Q_DECL_OVERRIDE; GLint maxClipPlaneCount() Q_DECL_OVERRIDE; - void memoryBarrier(QMemoryBarrier::BarrierTypes barriers) Q_DECL_OVERRIDE; + void memoryBarrier(QMemoryBarrier::Operations barriers) Q_DECL_OVERRIDE; QVector<ShaderUniformBlock> programUniformBlocks(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderAttribute> programAttributesAndLocations(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderUniform> programUniformsAndLocations(GLuint programId) Q_DECL_OVERRIDE; diff --git a/src/render/graphicshelpers/graphicshelpergl2.cpp b/src/render/graphicshelpers/graphicshelpergl2.cpp index 4d5d17d11..5f798f94e 100644 --- a/src/render/graphicshelpers/graphicshelpergl2.cpp +++ b/src/render/graphicshelpers/graphicshelpergl2.cpp @@ -518,7 +518,7 @@ GLint GraphicsHelperGL2::maxClipPlaneCount() return max; } -void GraphicsHelperGL2::memoryBarrier(QMemoryBarrier::BarrierTypes barriers) +void GraphicsHelperGL2::memoryBarrier(QMemoryBarrier::Operations barriers) { Q_UNUSED(barriers); qWarning() << "memory barrier is not supported by OpenGL 2.0 (since 4.3)"; diff --git a/src/render/graphicshelpers/graphicshelpergl2_p.h b/src/render/graphicshelpers/graphicshelpergl2_p.h index 8652b2bef..8966e48b2 100644 --- a/src/render/graphicshelpers/graphicshelpergl2_p.h +++ b/src/render/graphicshelpers/graphicshelpergl2_p.h @@ -110,7 +110,7 @@ public: void initializeHelper(QOpenGLContext *context, QAbstractOpenGLFunctions *functions) Q_DECL_OVERRIDE; void pointSize(bool programmable, GLfloat value) Q_DECL_OVERRIDE; GLint maxClipPlaneCount() Q_DECL_OVERRIDE; - void memoryBarrier(QMemoryBarrier::BarrierTypes barriers) Q_DECL_OVERRIDE; + void memoryBarrier(QMemoryBarrier::Operations barriers) Q_DECL_OVERRIDE; QVector<ShaderUniformBlock> programUniformBlocks(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderAttribute> programAttributesAndLocations(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderUniform> programUniformsAndLocations(GLuint programId) Q_DECL_OVERRIDE; diff --git a/src/render/graphicshelpers/graphicshelpergl3_2.cpp b/src/render/graphicshelpers/graphicshelpergl3_2.cpp index 7599513fa..6c768e94e 100644 --- a/src/render/graphicshelpers/graphicshelpergl3_2.cpp +++ b/src/render/graphicshelpers/graphicshelpergl3_2.cpp @@ -797,7 +797,7 @@ GLint GraphicsHelperGL3_2::maxClipPlaneCount() return max; } -void GraphicsHelperGL3_2::memoryBarrier(QMemoryBarrier::BarrierTypes barriers) +void GraphicsHelperGL3_2::memoryBarrier(QMemoryBarrier::Operations barriers) { Q_UNUSED(barriers); qWarning() << "memory barrier is not supported by OpenGL 3.0 (since 4.3)"; diff --git a/src/render/graphicshelpers/graphicshelpergl3_2_p.h b/src/render/graphicshelpers/graphicshelpergl3_2_p.h index e12a65801..fbca14361 100644 --- a/src/render/graphicshelpers/graphicshelpergl3_2_p.h +++ b/src/render/graphicshelpers/graphicshelpergl3_2_p.h @@ -112,7 +112,7 @@ public: void initializeHelper(QOpenGLContext *context, QAbstractOpenGLFunctions *functions) Q_DECL_OVERRIDE; void pointSize(bool programmable, GLfloat value) Q_DECL_OVERRIDE; GLint maxClipPlaneCount() Q_DECL_OVERRIDE; - void memoryBarrier(QMemoryBarrier::BarrierTypes barriers) Q_DECL_OVERRIDE; + void memoryBarrier(QMemoryBarrier::Operations barriers) Q_DECL_OVERRIDE; QVector<ShaderUniformBlock> programUniformBlocks(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderAttribute> programAttributesAndLocations(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderUniform> programUniformsAndLocations(GLuint programId) Q_DECL_OVERRIDE; diff --git a/src/render/graphicshelpers/graphicshelpergl3_3.cpp b/src/render/graphicshelpers/graphicshelpergl3_3.cpp index 4f6e38bf4..6959bdc6b 100644 --- a/src/render/graphicshelpers/graphicshelpergl3_3.cpp +++ b/src/render/graphicshelpers/graphicshelpergl3_3.cpp @@ -794,7 +794,7 @@ GLint GraphicsHelperGL3_3::maxClipPlaneCount() return max; } -void GraphicsHelperGL3_3::memoryBarrier(QMemoryBarrier::BarrierTypes barriers) +void GraphicsHelperGL3_3::memoryBarrier(QMemoryBarrier::Operations barriers) { Q_UNUSED(barriers); qWarning() << "memory barrier is not supported by OpenGL 3.3 (since 4.3)"; diff --git a/src/render/graphicshelpers/graphicshelpergl3_3_p.h b/src/render/graphicshelpers/graphicshelpergl3_3_p.h index 6d87c99b7..c093c801e 100644 --- a/src/render/graphicshelpers/graphicshelpergl3_3_p.h +++ b/src/render/graphicshelpers/graphicshelpergl3_3_p.h @@ -112,7 +112,7 @@ public: void initializeHelper(QOpenGLContext *context, QAbstractOpenGLFunctions *functions) Q_DECL_OVERRIDE; void pointSize(bool programmable, GLfloat value) Q_DECL_OVERRIDE; GLint maxClipPlaneCount() Q_DECL_OVERRIDE; - void memoryBarrier(QMemoryBarrier::BarrierTypes barriers) Q_DECL_OVERRIDE; + void memoryBarrier(QMemoryBarrier::Operations barriers) Q_DECL_OVERRIDE; QVector<ShaderUniformBlock> programUniformBlocks(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderAttribute> programAttributesAndLocations(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderUniform> programUniformsAndLocations(GLuint programId) Q_DECL_OVERRIDE; diff --git a/src/render/graphicshelpers/graphicshelpergl4.cpp b/src/render/graphicshelpers/graphicshelpergl4.cpp index 682b3ac3b..26f03ac8a 100644 --- a/src/render/graphicshelpers/graphicshelpergl4.cpp +++ b/src/render/graphicshelpers/graphicshelpergl4.cpp @@ -88,42 +88,42 @@ namespace Render { namespace { -GLbitfield memoryBarrierGLBitfield(QMemoryBarrier::BarrierTypes barriers) +GLbitfield memoryBarrierGLBitfield(QMemoryBarrier::Operations barriers) { GLbitfield bits = 0; - if (barriers.testFlag(QMemoryBarrier::AllBarrier)) { + if (barriers.testFlag(QMemoryBarrier::All)) { bits |= GL_ALL_BARRIER_BITS; return bits; } - if (barriers.testFlag(QMemoryBarrier::VertexAttributeArrayBarrier)) + if (barriers.testFlag(QMemoryBarrier::VertexAttributeArray)) bits |= GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::ElementArrayBarrier)) + if (barriers.testFlag(QMemoryBarrier::ElementArray)) bits |= GL_ELEMENT_ARRAY_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::UniformBarrier)) + if (barriers.testFlag(QMemoryBarrier::Uniform)) bits |= GL_UNIFORM_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::TextureFetchBarrier)) + if (barriers.testFlag(QMemoryBarrier::TextureFetch)) bits |= GL_TEXTURE_FETCH_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::ShaderImageAccessBarrier)) + if (barriers.testFlag(QMemoryBarrier::ShaderImageAccess)) bits |= GL_SHADER_IMAGE_ACCESS_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::CommandBarrier)) + if (barriers.testFlag(QMemoryBarrier::Command)) bits |= GL_COMMAND_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::PixelBufferBarrier)) + if (barriers.testFlag(QMemoryBarrier::PixelBuffer)) bits |= GL_PIXEL_BUFFER_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::TextureUpdateBarrier)) + if (barriers.testFlag(QMemoryBarrier::TextureUpdate)) bits |= GL_TEXTURE_UPDATE_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::BufferUpdateBarrier)) + if (barriers.testFlag(QMemoryBarrier::BufferUpdate)) bits |= GL_BUFFER_UPDATE_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::FrameBufferBarrier)) + if (barriers.testFlag(QMemoryBarrier::FrameBuffer)) bits |= GL_FRAMEBUFFER_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::TransformFeedbackBarrier)) + if (barriers.testFlag(QMemoryBarrier::TransformFeedback)) bits |= GL_TRANSFORM_FEEDBACK_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::AtomicCounterBarrier)) + if (barriers.testFlag(QMemoryBarrier::AtomicCounter)) bits |= GL_ATOMIC_COUNTER_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::ShaderStorageBarrier)) + if (barriers.testFlag(QMemoryBarrier::ShaderStorage)) bits |= GL_SHADER_STORAGE_BARRIER_BIT; - if (barriers.testFlag(QMemoryBarrier::QueryBufferBarrier)) + if (barriers.testFlag(QMemoryBarrier::QueryBuffer)) bits |= GL_QUERY_BUFFER_BARRIER_BIT; return bits; @@ -1047,7 +1047,7 @@ GLint GraphicsHelperGL4::maxClipPlaneCount() return max; } -void GraphicsHelperGL4::memoryBarrier(QMemoryBarrier::BarrierTypes barriers) +void GraphicsHelperGL4::memoryBarrier(QMemoryBarrier::Operations barriers) { m_funcs->glMemoryBarrier(memoryBarrierGLBitfield(barriers)); } diff --git a/src/render/graphicshelpers/graphicshelpergl4_p.h b/src/render/graphicshelpers/graphicshelpergl4_p.h index 5d464e116..6b3385838 100644 --- a/src/render/graphicshelpers/graphicshelpergl4_p.h +++ b/src/render/graphicshelpers/graphicshelpergl4_p.h @@ -110,7 +110,7 @@ public: void initializeHelper(QOpenGLContext *context, QAbstractOpenGLFunctions *functions) Q_DECL_OVERRIDE; void pointSize(bool programmable, GLfloat value) Q_DECL_OVERRIDE; GLint maxClipPlaneCount() Q_DECL_OVERRIDE; - void memoryBarrier(QMemoryBarrier::BarrierTypes barriers) Q_DECL_OVERRIDE; + void memoryBarrier(QMemoryBarrier::Operations barriers) Q_DECL_OVERRIDE; QVector<ShaderUniformBlock> programUniformBlocks(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderAttribute> programAttributesAndLocations(GLuint programId) Q_DECL_OVERRIDE; QVector<ShaderUniform> programUniformsAndLocations(GLuint programId) Q_DECL_OVERRIDE; diff --git a/src/render/graphicshelpers/graphicshelperinterface_p.h b/src/render/graphicshelpers/graphicshelperinterface_p.h index 1048e1b26..4b2569263 100644 --- a/src/render/graphicshelpers/graphicshelperinterface_p.h +++ b/src/render/graphicshelpers/graphicshelperinterface_p.h @@ -125,7 +125,7 @@ public: virtual QSize getTextureDimensions(GLuint textureId, GLenum target, uint level = 0) = 0; virtual void initializeHelper(QOpenGLContext *context, QAbstractOpenGLFunctions *functions) = 0; virtual GLint maxClipPlaneCount() = 0; - virtual void memoryBarrier(QMemoryBarrier::BarrierTypes barriers) = 0; + virtual void memoryBarrier(QMemoryBarrier::Operations barriers) = 0; virtual void pointSize(bool programmable, GLfloat value) = 0; virtual QVector<ShaderAttribute> programAttributesAndLocations(GLuint programId) = 0; virtual QVector<ShaderUniform> programUniformsAndLocations(GLuint programId) = 0; diff --git a/src/render/jobs/renderviewjobutils.cpp b/src/render/jobs/renderviewjobutils.cpp index 694c4b8ac..f75ea3f0c 100644 --- a/src/render/jobs/renderviewjobutils.cpp +++ b/src/render/jobs/renderviewjobutils.cpp @@ -240,7 +240,7 @@ void setRenderViewConfigFromFrameGraphLeafNode(RenderView *rv, const FrameGraphN case FrameGraphNode::MemoryBarrier: { const Render::MemoryBarrier *barrier = static_cast<const Render::MemoryBarrier *>(node); - rv->setMemoryBarrier(barrier->barrierTypes()|rv->memoryBarrier()); + rv->setMemoryBarrier(barrier->waitOperations()|rv->memoryBarrier()); break; } diff --git a/tests/auto/render/memorybarrier/tst_memorybarrier.cpp b/tests/auto/render/memorybarrier/tst_memorybarrier.cpp index d4f54f3af..f0d4931d9 100644 --- a/tests/auto/render/memorybarrier/tst_memorybarrier.cpp +++ b/tests/auto/render/memorybarrier/tst_memorybarrier.cpp @@ -50,14 +50,14 @@ private Q_SLOTS: QCOMPARE(backendMemoryBarrier.nodeType(), Qt3DRender::Render::FrameGraphNode::MemoryBarrier); QCOMPARE(backendMemoryBarrier.isEnabled(), false); QVERIFY(backendMemoryBarrier.peerId().isNull()); - QCOMPARE(backendMemoryBarrier.barrierTypes(), Qt3DRender::QMemoryBarrier::None); + QCOMPARE(backendMemoryBarrier.waitOperations(), Qt3DRender::QMemoryBarrier::None); } void checkInitializeFromPeer() { // GIVEN Qt3DRender::QMemoryBarrier memoryBarrier; - memoryBarrier.setBarrierTypes(Qt3DRender::QMemoryBarrier::VertexAttributeArrayBarrier); + memoryBarrier.setWaitOperations(Qt3DRender::QMemoryBarrier::VertexAttributeArray); { // WHEN @@ -67,7 +67,7 @@ private Q_SLOTS: // THEN QCOMPARE(backendMemoryBarrier.isEnabled(), true); QCOMPARE(backendMemoryBarrier.peerId(), memoryBarrier.id()); - QCOMPARE(backendMemoryBarrier.barrierTypes(), Qt3DRender::QMemoryBarrier::VertexAttributeArrayBarrier); + QCOMPARE(backendMemoryBarrier.waitOperations(), Qt3DRender::QMemoryBarrier::VertexAttributeArray); } { // WHEN @@ -101,14 +101,14 @@ private Q_SLOTS: } { // WHEN - const Qt3DRender::QMemoryBarrier::BarrierTypes newValue(Qt3DRender::QMemoryBarrier::AtomicCounterBarrier|Qt3DRender::QMemoryBarrier::ElementArrayBarrier); + const Qt3DRender::QMemoryBarrier::Operations newValue(Qt3DRender::QMemoryBarrier::AtomicCounter|Qt3DRender::QMemoryBarrier::ElementArray); const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(Qt3DCore::QNodeId()); - change->setPropertyName("barrierTypes"); + change->setPropertyName("waitOperations"); change->setValue(QVariant::fromValue(newValue)); backendMemoryBarrier.sceneChangeEvent(change); // THEN - QCOMPARE(backendMemoryBarrier.barrierTypes(), newValue); + QCOMPARE(backendMemoryBarrier.waitOperations(), newValue); } } diff --git a/tests/auto/render/qmemorybarrier/tst_qmemorybarrier.cpp b/tests/auto/render/qmemorybarrier/tst_qmemorybarrier.cpp index 87c813a03..25ee10cad 100644 --- a/tests/auto/render/qmemorybarrier/tst_qmemorybarrier.cpp +++ b/tests/auto/render/qmemorybarrier/tst_qmemorybarrier.cpp @@ -45,7 +45,7 @@ private Q_SLOTS: void initTestCase() { - qRegisterMetaType<Qt3DRender::QMemoryBarrier::BarrierTypes>("QMemoryBarrier::BarrierTypes"); + qRegisterMetaType<Qt3DRender::QMemoryBarrier::Operations>("QMemoryBarrier::Operations"); } void checkDefaultConstruction() @@ -54,7 +54,7 @@ private Q_SLOTS: Qt3DRender::QMemoryBarrier memoryBarrier; // THEN - QCOMPARE(memoryBarrier.barrierTypes(), Qt3DRender::QMemoryBarrier::None); + QCOMPARE(memoryBarrier.waitOperations(), Qt3DRender::QMemoryBarrier::None); } void checkPropertyChanges() @@ -64,21 +64,21 @@ private Q_SLOTS: { // WHEN - QSignalSpy spy(&memoryBarrier, SIGNAL(barrierTypesChanged(QMemoryBarrier::BarrierTypes))); - const Qt3DRender::QMemoryBarrier::BarrierTypes newValue(Qt3DRender::QMemoryBarrier::ShaderStorageBarrier|Qt3DRender::QMemoryBarrier::VertexAttributeArrayBarrier); - memoryBarrier.setBarrierTypes(newValue); + QSignalSpy spy(&memoryBarrier, SIGNAL(waitOperationsChanged(QMemoryBarrier::Operations))); + const Qt3DRender::QMemoryBarrier::Operations newValue(Qt3DRender::QMemoryBarrier::ShaderStorage|Qt3DRender::QMemoryBarrier::VertexAttributeArray); + memoryBarrier.setWaitOperations(newValue); // THEN QVERIFY(spy.isValid()); - QCOMPARE(memoryBarrier.barrierTypes(), newValue); + QCOMPARE(memoryBarrier.waitOperations(), newValue); QCOMPARE(spy.count(), 1); // WHEN spy.clear(); - memoryBarrier.setBarrierTypes(newValue); + memoryBarrier.setWaitOperations(newValue); // THEN - QCOMPARE(memoryBarrier.barrierTypes(), newValue); + QCOMPARE(memoryBarrier.waitOperations(), newValue); QCOMPARE(spy.count(), 0); } } @@ -88,7 +88,7 @@ private Q_SLOTS: // GIVEN Qt3DRender::QMemoryBarrier memoryBarrier; - memoryBarrier.setBarrierTypes(Qt3DRender::QMemoryBarrier::CommandBarrier); + memoryBarrier.setWaitOperations(Qt3DRender::QMemoryBarrier::Command); // WHEN QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges; @@ -105,7 +105,7 @@ private Q_SLOTS: const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DRender::QMemoryBarrierData>>(creationChanges.first()); const Qt3DRender::QMemoryBarrierData cloneData = creationChangeData->data; - QCOMPARE(memoryBarrier.barrierTypes(), cloneData.barrierTypes); + QCOMPARE(memoryBarrier.waitOperations(), cloneData.waitOperations); QCOMPARE(memoryBarrier.id(), creationChangeData->subjectId()); QCOMPARE(memoryBarrier.isEnabled(), true); QCOMPARE(memoryBarrier.isEnabled(), creationChangeData->isNodeEnabled()); @@ -127,7 +127,7 @@ private Q_SLOTS: const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DRender::QMemoryBarrierData>>(creationChanges.first()); const Qt3DRender::QMemoryBarrierData cloneData = creationChangeData->data; - QCOMPARE(memoryBarrier.barrierTypes(), cloneData.barrierTypes); + QCOMPARE(memoryBarrier.waitOperations(), cloneData.waitOperations); QCOMPARE(memoryBarrier.id(), creationChangeData->subjectId()); QCOMPARE(memoryBarrier.isEnabled(), false); QCOMPARE(memoryBarrier.isEnabled(), creationChangeData->isNodeEnabled()); @@ -144,14 +144,14 @@ private Q_SLOTS: { // WHEN - memoryBarrier.setBarrierTypes(Qt3DRender::QMemoryBarrier::ShaderStorageBarrier); + memoryBarrier.setWaitOperations(Qt3DRender::QMemoryBarrier::ShaderStorage); QCoreApplication::processEvents(); // THEN QCOMPARE(arbiter.events.size(), 1); auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "barrierTypes"); - QCOMPARE(change->value().value<Qt3DRender::QMemoryBarrier::BarrierTypes>(), memoryBarrier.barrierTypes()); + QCOMPARE(change->propertyName(), "waitOperations"); + QCOMPARE(change->value().value<Qt3DRender::QMemoryBarrier::Operations>(), memoryBarrier.waitOperations()); QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); arbiter.events.clear(); @@ -159,7 +159,7 @@ private Q_SLOTS: { // WHEN - memoryBarrier.setBarrierTypes(Qt3DRender::QMemoryBarrier::ShaderStorageBarrier); + memoryBarrier.setWaitOperations(Qt3DRender::QMemoryBarrier::ShaderStorage); QCoreApplication::processEvents(); // THEN diff --git a/tests/auto/render/renderviews/tst_renderviews.cpp b/tests/auto/render/renderviews/tst_renderviews.cpp index 70109d718..d469298f4 100644 --- a/tests/auto/render/renderviews/tst_renderviews.cpp +++ b/tests/auto/render/renderviews/tst_renderviews.cpp @@ -93,7 +93,7 @@ private Q_SLOTS: QCOMPARE(renderView.memoryBarrier(), QMemoryBarrier::None); // WHEN - const QMemoryBarrier::BarrierTypes barriers(QMemoryBarrier::BufferUpdateBarrier|QMemoryBarrier::ShaderImageAccessBarrier); + const QMemoryBarrier::Operations barriers(QMemoryBarrier::BufferUpdate|QMemoryBarrier::ShaderImageAccess); renderView.setMemoryBarrier(barriers); // THEN @@ -104,7 +104,7 @@ private Q_SLOTS: { { // GIVEN - const QMemoryBarrier::BarrierTypes barriers(QMemoryBarrier::AtomicCounterBarrier|QMemoryBarrier::ShaderStorageBarrier); + const QMemoryBarrier::Operations barriers(QMemoryBarrier::AtomicCounter|QMemoryBarrier::ShaderStorage); Qt3DRender::QMemoryBarrier frontendBarrier; FrameGraphManager frameGraphManager; MemoryBarrier backendBarrier; @@ -113,18 +113,18 @@ private Q_SLOTS: backendBarrier.setFrameGraphManager(&frameGraphManager); // WHEN - frontendBarrier.setBarrierTypes(barriers); + frontendBarrier.setWaitOperations(barriers); simulateInitialization(&frontendBarrier, &backendBarrier); // THEN QCOMPARE(renderView.memoryBarrier(), QMemoryBarrier::None); - QCOMPARE(backendBarrier.barrierTypes(), barriers); + QCOMPARE(backendBarrier.waitOperations(), barriers); // WHEN Qt3DRender::Render::setRenderViewConfigFromFrameGraphLeafNode(&renderView, &backendBarrier); // THEN - QCOMPARE(backendBarrier.barrierTypes(), renderView.memoryBarrier()); + QCOMPARE(backendBarrier.waitOperations(), renderView.memoryBarrier()); } // TO DO: Complete tests for other framegraph node types } |