本页内容

Qt3DRender::QDispatchCompute Class

class Qt3DRender::QDispatchCompute

FrameGraph 节点用于向 GPU 上的计算着色器分发任务。更多内容...

标题: #include <qdispatchcompute.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: DispatchCompute
继承自: Qt3DRender::QFrameGraphNode
状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

属性

公共函数

QDispatchCompute(Qt3DCore::QNode *parent = nullptr)
int workGroupX() const
int workGroupY() const
int workGroupZ() const

公共槽位

void setWorkGroupX(int workGroupX)
void setWorkGroupY(int workGroupY)
void setWorkGroupZ(int workGroupZ)

信号

详细说明

Qt3DRender::QDispatchCompute 允许向计算着色器分发工作,以便其在GPU上运行。workGroupX 、workGroupY 和workGroupZ 属性指定了计算着色器调用的工作组大小。需要向实体添加QComputeCommand 组件,以指示Qt3D从实体中选择材质和几何体用于计算调用。 着色器调用的工作组大小将为 QDispatchCompute 和QComputeCommand 中指定的工作组大小的最大值。

属性文档

workGroupX : int

指定 X 工作组。

访问功能:

int workGroupX() const
void setWorkGroupX(int workGroupX)

通知信号:

void workGroupXChanged()

workGroupY : int

指定 Y 工作组。

访问功能:

int workGroupY() const
void setWorkGroupY(int workGroupY)

通知信号:

void workGroupYChanged()

workGroupZ : int

指定 Z 工作组。

访问功能:

int workGroupZ() const
void setWorkGroupZ(int workGroupZ)

通知信号:

void workGroupZChanged()

成员函数文档

[explicit] QDispatchCompute::QDispatchCompute(Qt3DCore::QNode *parent = nullptr)

该构造函数会根据指定的parent 创建一个实例。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.