PySide6.Qt3DRender.Qt3DRender.QComputeCommand

class QComputeCommand

QComponent to issue work for the compute shader on GPU. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QComputeCommand

Synopsis

Properties

Methods

Slots

Signals

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

A 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. QDispatchCompute node needs to be present in the FrameGraph to actually issue the commands.

Note

If the rendering policy is set to OnDemand and there are no changes to the scene, the ComputeCommand will not be invoked repeatedly. The Always render policy must be set for the ComputeCommand to be repeatedly invoked if there are no other changes to the scene that triggers rendering a new frame.

class RunType

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property runTypeᅟ: Qt3DRender.QComputeCommand.RunType

Specifies whether the compute command should be performed every frame or manually triggered.

If set to Continuous, Compute command is executed everyframe. This is the default.

If set to Manual CompouteCommand is executed for a given number of frames and then the component disables itself.

Access functions:
property workGroupXᅟ: int

Specifies X workgroup size.

Access functions:
property workGroupYᅟ: int

Specifies Y workgroup size.

Access functions:
property workGroupZᅟ: int

Specifies Z workgroup size.

Access functions:
__init__([parent=None])
Parameters:

parentQNode

The constructor creates a new QComputeCommand instance with the specified parent.

runType()
Return type:

RunType

See also

setRunType()

Getter of property runTypeᅟ .

runTypeChanged()

Notification signal of property runTypeᅟ .

setRunType(runType)
Parameters:

runTypeRunType

See also

runType()

Setter of property runTypeᅟ .

setWorkGroupX(workGroupX)
Parameters:

workGroupX – int

Sets the workgroup for the first dimension to workGroupX.

See also

workGroupX()

Setter of property workGroupXᅟ .

setWorkGroupY(workGroupY)
Parameters:

workGroupY – int

Sets the workgroup for the second dimension to workGroupY.

See also

workGroupY()

Setter of property workGroupYᅟ .

setWorkGroupZ(workGroupZ)
Parameters:

workGroupZ – int

Sets the workgroup for the third dimension to workGroupZ.

See also

workGroupZ()

Setter of property workGroupZᅟ .

trigger([frameCount=1])
Parameters:

frameCount – int

When the run type is set to Manual, calling trigger will make the compute command be executed for the next frameCount frames. Upon completion of the execution, the enabled property will be set to false.

trigger(workGroupX, workGroupY, workGroupZ[, frameCount=1])
Parameters:
  • workGroupX – int

  • workGroupY – int

  • workGroupZ – int

  • frameCount – int

When the run type is set to Manual, calling trigger will make the compute command be executed for the next frameCount frames. Upon completion of the execution, the enabled property will be set to false. The size of the workgroup previously set will be overridden with workGroupX, workGroupY, workGroupZ.

workGroupX()
Return type:

int

See also

setWorkGroupX()

Getter of property workGroupXᅟ .

workGroupXChanged()

Notification signal of property workGroupXᅟ .

workGroupY()
Return type:

int

See also

setWorkGroupY()

Getter of property workGroupYᅟ .

workGroupYChanged()

Notification signal of property workGroupYᅟ .

workGroupZ()
Return type:

int

See also

setWorkGroupZ()

Getter of property workGroupZᅟ .

workGroupZChanged()

Notification signal of property workGroupZᅟ .