Qt3DRender::QComputeCommand Class
class Qt3DRender::QComputeCommandGPU의 컴퓨트 셰이더에 작업을 할당하는 QComponent. 더 보기...
| 헤더: | #include <qcomputecommand.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| QML에서: | ComputeCommand |
| 상속: | Qt3DCore::QComponent |
| 상태: | 사용 중단됨 |
이 클래스는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 클래스를 사용하지 않는 것을 강력히 권장합니다.
속성
- runType : RunType
- workGroupX : int
- workGroupY : int
- workGroupZ : int
공개 함수
| QComputeCommand(Qt3DCore::QNode *parent = nullptr) | |
| Qt3DRender::QComputeCommand::RunType | runType() const |
| int | workGroupX() const |
| int | workGroupY() const |
| int | workGroupZ() const |
공개 슬롯
| void | setRunType(Qt3DRender::QComputeCommand::RunType runType) |
| void | setWorkGroupX(int workGroupX) |
| void | setWorkGroupY(int workGroupY) |
| void | setWorkGroupZ(int workGroupZ) |
| void | trigger(int frameCount = 1) |
| void | trigger(int workGroupX, int workGroupY, int workGroupZ, int frameCount = 1) |
신호
| void | runTypeChanged() |
| void | workGroupXChanged() |
| void | workGroupYChanged() |
| void | workGroupZChanged() |
상세 설명
Qt3DRender::QComputeCommand 는 컴퓨트 셰이더에 작업을 발행하는 데 사용됩니다. 컴퓨트 셰이더는 QComputeCommand가 추가된 동일한 엔티티의 QMaterial 컴포넌트에서 지정됩니다. workGroupX, workGroupY 및 workGroupZ 속성은 컴퓨트 셰이더 호출 시의 워크그룹 크기를 지정합니다. 명령을 실제로 발행하려면 FrameGraph에 Qt3DRender::QDispatchCompute 노드가 존재해야 합니다.
참고: 렌더링 정책이 ‘ Qt3DRender::QRenderSettings::OnDemand ’로 설정되어 있고 씬에 변경 사항이 없는경우 , ‘ ComputeCommand ’는 반복적으로 호출되지 않습니다. 씬에 새로운 프레임 렌더링을 유발하는 다른 변경 사항이 없는 경우, ‘ ComputeCommand ’가 반복적으로 호출되려면 ‘ Qt3DRender::QRenderSettings::Always ’ 렌더링 정책이 설정되어 있어야 합니다.
속성 설명서
runType : RunType
계산 명령을 매 프레임마다 수행할지, 아니면 수동으로 실행할지 지정합니다.
'지속적(Continuous)'으로 설정하면 Compute 명령이 매 프레임마다 실행됩니다. 이것이 기본값입니다.
'수동(Manual)'으로 설정하면, 지정된 프레임 수만큼 Compute 명령이 실행된 후 컴포넌트가 자동으로 비활성화됩니다.
액세스 함수:
| Qt3DRender::QComputeCommand::RunType | runType() const |
| void | setRunType(Qt3DRender::QComputeCommand::RunType runType) |
알림 신호:
| void | runTypeChanged() |
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] QComputeCommand::QComputeCommand(Qt3DCore::QNode *parent = nullptr)
이 생성자는 지정된 ` parent`을 사용하여 새로운 ` Qt3DRender::QComputeCommand ` 인스턴스를 생성합니다.
[slot] void QComputeCommand::setWorkGroupX(int workGroupX)
첫 번째 차원의 워크그룹을 ‘ workGroupX ’으로 설정합니다.
참고: workGroupX 속성에 대한설정 함수입니다.
workGroupX()도 참조하십시오 .
[slot] void QComputeCommand::setWorkGroupY(int workGroupY)
두 번째 차원의 워크그룹을 ‘ workGroupY ’로 설정합니다.
참고: workGroupY 속성에 대한세터 함수입니다.
workGroupY()도 참조하십시오 .
[slot] void QComputeCommand::setWorkGroupZ(int workGroupZ)
세 번째 차원의 워크그룹을 workGroupZ 로 설정합니다.
참고: workGroupZ 속성에 대한세터 함수입니다.
workGroupZ()도 참조하십시오 .
[slot] void QComputeCommand::trigger(int frameCount = 1)
실행 유형이 ‘수동(Manual)’으로 설정된 경우, 트리거를 호출하면 다음 frameCount 프레임 동안 컴퓨트 명령이 실행됩니다. 실행이 완료되면 enabled 속성이 false로 설정됩니다.
참고: 이 슬롯은 오버로드되어 있습니다. 이 슬롯에 연결하려면:
// Connect using qOverload:
connect(sender, &SenderClass::signal,
computeCommand, qOverload(&QComputeCommand::trigger));
// Or using a lambda as wrapper:
connect(sender, &SenderClass::signal,
computeCommand, [receiver = computeCommand](int frameCount) { receiver->trigger(frameCount); }); [slot] void QComputeCommand::trigger(int workGroupX, int workGroupY, int workGroupZ, int frameCount = 1)
실행 유형이 ‘수동(Manual)’으로 설정된 경우, 트리거를 호출하면 다음 frameCount 프레임 동안 컴퓨트 명령이 실행됩니다. 실행이 완료되면 enabled 속성이 false로 설정됩니다. 이전에 설정된 워크그룹 크기는 workGroupX, workGroupY, workGroupZ 로 재설정됩니다.
참고: 이 슬롯은 오버로드되어 있습니다. 이 슬롯에 연결하려면:
// Connect using qOverload:
connect(sender, &SenderClass::signal,
computeCommand, qOverload(&QComputeCommand::trigger));
// Or using a lambda as wrapper:
connect(sender, &SenderClass::signal,
computeCommand, [receiver = computeCommand](int workGroupX, int workGroupY, int workGroupZ, int frameCount) { receiver->trigger(workGroupX, workGroupY, workGroupZ, frameCount); }); © 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.