QMemoryBarrier Class | Qt 3D 5.13.0

Qt 5.13 | Qt 3D | C++ Classes | QMemoryBarrier

Qt 5.13.0 Reference Documentation

# QMemoryBarrier Class

(Qt3DRender::QMemoryBarrier)

Class to emplace a memory barrier. More...

Header: | #include <QMemoryBarrier>
qmake: | QT += 3drender
Since: | Qt 5.9
Instantiated By: | MemoryBarrier
Inherits: | Qt3DRender::QFrameGraphNode

This class was introduced in Qt 5.9.

- List of all members, including inherited members
- Obsolete members

## Public Types

enum | Operation { None, ElementArray, Uniform, TextureFetch, ..., All }
flags | Operations

## Related Non-Members

typedef | QNodePtr
typedef | QNodeVector
typedef | QObjectList
QList<T> | qFindChildren(const QObject *obj, const QRegExp &regExp)
Qt3DCore::QNodeId | qIdForNode(Qt3DCore::QNode *node)
Qt3DCore::QNodeIdVector | qIdsForNodes(const T &nodes)
T | qobject_cast(QObject *object)
T | qobject_cast(const QObject *object)

## Macros

| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
| Q_CLASSINFO(Name, Value)
| Q_DISABLE_COPY(Class)
| Q_DISABLE_COPY_MOVE(Class)
| Q_DISABLE_MOVE(Class)
| Q_EMIT
| Q_ENUM(...)
| Q_ENUM_NS(...)
| Q_FLAG(...)
| Q_FLAG_NS(...)
| Q_GADGET
| Q_INTERFACES(...)
| Q_INVOKABLE
| Q_NAMESPACE
| Q_OBJECT
| Q_PROPERTY(...)
| Q_REVISION
| Q_SET_OBJECT_NAME(Object)
| Q_SIGNAL
| Q_SIGNALS
| Q_SLOT
| Q_SLOTS

### Additional Inherited Members

- 3 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject
- 1 public function inherited from Qt3DRender::QFrameGraphNode
- 13 public functions inherited from Qt3DCore::QNode
- 30 public functions inherited from QObject
- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject
- 4 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject
- 9 static public members inherited from QObject
- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject

## Detailed Description

A Qt3DRender::QMemoryBarrier FrameGraph node is used to emplace a specific memory barrier at a specific time of the rendering. This is required to properly synchronize drawing and compute commands on the GPU.

The barrier defines the ordering of memory operations issued by a prior command. This means that if command1 is manipulating a buffer that is to be used as a vertex attribute buffer in a following command2, then the memory barrier should be placed after command1 and setting the appropriate barrier type for vertex attribute buffer.

When a QMemoryBarrier node is found in a FrameGraph branch, the barrier will be enforced prior to any draw or compute command even if these are defined deeper in the branch.

For OpenGL rendering, this page gives more info about the Memory Model

## Member Type Documentation

### enum QMemoryBarrier::Operation
flags QMemoryBarrier::Operations

This enum type describes types of buffer to be cleared.

Constant | Value
--- | ---
`Qt3DRender::QMemoryBarrier::None` | `0`
`Qt3DRender::QMemoryBarrier::ElementArray` | `(1 << 1)`
`Qt3DRender::QMemoryBarrier::Uniform` | `(1 << 2)`
`Qt3DRender::QMemoryBarrier::TextureFetch` | `(1 << 3)`
`Qt3DRender::QMemoryBarrier::ShaderImageAccess` | `(1 << 4)`
`Qt3DRender::QMemoryBarrier::Command` | `(1 << 5)`
`Qt3DRender::QMemoryBarrier::PixelBuffer` | `(1 << 6)`
`Qt3DRender::QMemoryBarrier::TextureUpdate` | `(1 << 7)`
`Qt3DRender::QMemoryBarrier::BufferUpdate` | `(1 << 8)`
`Qt3DRender::QMemoryBarrier::FrameBuffer` | `(1 << 9)`
`Qt3DRender::QMemoryBarrier::TransformFeedback` | `(1 << 10)`
`Qt3DRender::QMemoryBarrier::AtomicCounter` | `(1 << 11)`
`Qt3DRender::QMemoryBarrier::ShaderStorage` | `(1 << 12)`
`Qt3DRender::QMemoryBarrier::QueryBuffer` | `(1 << 13)`
`Qt3DRender::QMemoryBarrier::VertexAttributeArray` | `(1 << 0)`
`Qt3DRender::QMemoryBarrier::All` | `0xFFFFFFFF`

The Operations type is a typedef for QFlags<Operation>. It stores an OR combination of Operation values.