summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2016-09-07 15:29:59 +0300
committerSean Harmer <sean.harmer@kdab.com>2016-11-14 14:20:03 +0000
commita6ffc89bec6462b6c49504c4f0fd5a8672665b14 (patch)
tree53631ca2c3966ffb4c2c83b3d76ea8ede0b6e206
parent5b9ea0f614fd2941a7149166039d558f0113f6af (diff)
Update QComputeCommand and QDispatchCompute docs
Change-Id: Ic6555d2900a4d6a10ea8ebf8da746c70915ae6f1 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/framegraph/qdispatchcompute.cpp42
-rw-r--r--src/render/frontend/qcomputecommand.cpp82
2 files changed, 95 insertions, 29 deletions
diff --git a/src/render/framegraph/qdispatchcompute.cpp b/src/render/framegraph/qdispatchcompute.cpp
index abb4d7bdb..ca656c114 100644
--- a/src/render/framegraph/qdispatchcompute.cpp
+++ b/src/render/framegraph/qdispatchcompute.cpp
@@ -44,12 +44,18 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
/*!
- \class Qt3DRender::QDispatchCompute
- \inmodule Qt3DRender
- \since 5.7
- \ingroup framegraph
+ \class Qt3DRender::QDispatchCompute
+ \inmodule Qt3DRender
+ \since 5.7
+ \ingroup framegraph
+ \brief FrameGraph node to issue work for the compute shader on GPU
- \brief Allows a glDispatchCompute call to be issued to do work in a compute shader on the GPU.
+ A Qt3DRender::QDispatchCompute allows work to be issued for the compute shader to
+ run on the GPU. The workGroupX, workGroupY and workGroupZ properties specify the work group
+ sizes for the compute shader invocation. QComputeCommand components need to be added
+ to entities to instruct Qt3D to select the materials and geometry from the entities
+ for the compute invocation. The work group sizes for the shader invocation will be
+ the maximum of the work group sizes specified in QDispatchCompute and QComputeCommand.
*/
@@ -59,11 +65,33 @@ namespace Qt3DRender {
\instantiates Qt3DRender::QDispatchCompute
\inherits FrameGraphNode
\since 5.7
- \qmlabstract Allows a glDispatchCompute call to be issued to do work in a compute shader on the GPU.
+ \brief FrameGraph node to issue work for the compute shader on GPU
+
+ A DispatchCompute allows work to be issued for the compute shader to run on the GPU.
+ The workGroupX, workGroupY and workGroupZ properties specify the work group sizes for
+ the compute shader invocation. ComputeCommand components need to be added
+ to entities to instruct Qt3D to select the materials and geometry from the entities
+ for the compute invocation. The work group sizes for the shader invocation will be
+ the maximum of the work group sizes specified in DispatchCompute and ComputeCommand.
*/
/*!
- The constructor creates an instance with the specified \a parent.
+ \qmlproperty int DispatchCompute::workGroupX
+ Specifies X workgroup size.
+ */
+
+/*!
+ \qmlproperty int DispatchCompute::workGroupY
+ Specifies Y workgroup size.
+ */
+
+/*!
+ \qmlproperty int DispatchCompute::workGroupZ
+ Specifies Z workgroup size.
+ */
+
+/*!
+ The constructor creates an instance with the specified \a parent.
*/
QDispatchCompute::QDispatchCompute(Qt3DCore::QNode *parent)
: QFrameGraphNode(*new QDispatchComputePrivate(), parent)
diff --git a/src/render/frontend/qcomputecommand.cpp b/src/render/frontend/qcomputecommand.cpp
index 0bd2f629b..c36e4039c 100644
--- a/src/render/frontend/qcomputecommand.cpp
+++ b/src/render/frontend/qcomputecommand.cpp
@@ -45,10 +45,61 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
/*!
- * \class Qt3DRender::QComputeCommand
- * \brief The QComputerCommand class
- * \since 5.7
- * \inmodule Qt3DRender
+ \class Qt3DRender::QComputeCommand
+ \since 5.7
+ \inmodule Qt3DRender
+ \brief QComponent to issue work for the compute shader on GPU
+
+ A Qt3DRender::QComputeCommand is used to issue work for the compute shader.
+ The compute shader is specified in the QMaterial component of the same entity the
+ QComputeCommand is added to. The workGroupX, workGroupY and workGroupZ properties
+ specify the work group sizes for the compute shader invocation. Qt3DRender::QDispatchCompute
+ node needs to be present in the FrameGraph to actually issue the commands.
+ */
+
+/*!
+ \qmltype ComputeCommand
+ \since 5.7
+ \inmodule Qt3DRender
+ \inherits Component3D
+ \instantiates Qt3DRender::QComputeCommand
+ \brief Component to issue work for the compute shader on GPU
+
+ A ComputeCommand is used to issue work for the compute shader.
+ The compute shader is specified in the Material component of the same entity the
+ ComputeCommand is added to. The workGroupX, workGroupY and workGroupZ properties
+ specify the work group sizes for the compute shader invocation. DispatchCompute
+ node needs to be present in the FrameGraph to actually issue the commands.
+ */
+
+/*!
+ \qmlproperty int ComputeCommand::workGroupX
+ Specifies X workgroup size.
+ */
+
+/*!
+ \qmlproperty int ComputeCommand::workGroupY
+ Specifies Y workgroup size.
+ */
+
+/*!
+ \qmlproperty int ComputeCommand::workGroupZ
+ Specifies Z workgroup size.
+ */
+
+/*!
+ \property QComputeCommand::workGroupX
+ Specifies X workgroup size.
+ */
+
+/*!
+ \property QComputeCommand::workGroupY
+ Specifies Y workgroup size.
+ */
+
+/*!
+ \property QComputeCommand::workGroupZ
+ Specifies Z workgroup size.
*/
QComputeCommandPrivate::QComputeCommandPrivate()
@@ -60,9 +111,8 @@ QComputeCommandPrivate::QComputeCommandPrivate()
}
/*!
- * The constructor creates a new Qt3DRender::QComputeCommand instance with the
- * specified \a parent.
- * \param parent
+ The constructor creates a new Qt3DRender::QComputeCommand instance with the
+ specified \a parent.
*/
QComputeCommand::QComputeCommand(Qt3DCore::QNode *parent)
: Qt3DCore::QComponent(*new QComputeCommandPrivate, parent)
@@ -74,27 +124,18 @@ QComputeCommand::~QComputeCommand()
{
}
-/*!
- * \return the workgroup size for the first dimension.
- */
int QComputeCommand::workGroupX() const
{
Q_D(const QComputeCommand);
return d->m_workGroupX;
}
-/*!
- * \return the workgroup size for the second dimension.
- */
int QComputeCommand::workGroupY() const
{
Q_D(const QComputeCommand);
return d->m_workGroupY;
}
-/*!
- * \return the workgroup size for the third dimension.
- */
int QComputeCommand::workGroupZ() const
{
Q_D(const QComputeCommand);
@@ -102,8 +143,7 @@ int QComputeCommand::workGroupZ() const
}
/*!
- * Sets the workgroup for the first dimension to \a workGroupX.
- * \param workGroupX
+ Sets the workgroup for the first dimension to \a workGroupX.
*/
void QComputeCommand::setWorkGroupX(int workGroupX)
{
@@ -115,8 +155,7 @@ void QComputeCommand::setWorkGroupX(int workGroupX)
}
/*!
- * Sets the workgroup for the second dimension to \a workGroupY.
- * \param workGroupY
+ Sets the workgroup for the second dimension to \a workGroupY.
*/
void QComputeCommand::setWorkGroupY(int workGroupY)
{
@@ -128,8 +167,7 @@ void QComputeCommand::setWorkGroupY(int workGroupY)
}
/*!
- * Sets the workgroup for the third dimension to \a workGroupZ.
- * \param workGroupZ
+ Sets the workgroup for the third dimension to \a workGroupZ.
*/
void QComputeCommand::setWorkGroupZ(int workGroupZ)
{