Qt3DRender::QDispatchCompute Class

class Qt3DRender::QDispatchCompute

FrameGraph 节点,用于为 GPU 上的计算着色器发布工作。更多

Header: #include <QDispatchCompute>
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 上运行的计算着色器发布工作。workGroupXworkGroupYworkGroupZ 属性指定了调用计算着色器的工作组大小。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 创建一个实例。

© 2025 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.