# ComputeNode¶

from panda3d.core import ComputeNode

class ComputeNode

Bases: PandaNode

A special node, the sole purpose of which is to invoke a dispatch operation on the assigned compute shader.

Inheritance diagram

__init__(name: str)

Creates a ComputeNode with the given name. Use addDispatch() and also assign a shader using a ShaderAttrib.

addDispatch(num_groups: LVecBase3i)None

Adds a dispatch command with the given number of work groups in the X, Y, and Z dimensions. Any of these values may be set to 1 if the respective dimension should not be used.

addDispatch(num_groups_x: int, num_groups_y: int, num_groups_z: int)None

Adds a dispatch command with the given number of work groups in the X, Y, and Z dimensions. Any of these values may be set to 1 if the respective dimension should not be used.

clearDispatches()None

Removes all dispatch commands.

property dispatches → Sequence[LVecBase3i]
Getter

Returns the group counts of the nth dispatch associated with this object.

Setter

Sets the group counts of the nth dispatch associated with this object.

static getClassType()TypeHandle
getDispatch(i: int)LVecBase3i

Returns the group counts of the nth dispatch associated with this object.

getDispatches()list
getNumDispatches()int

Returns the number of times addDispatch() has been called on this object.

insertDispatch(i: int, num_groups: LVecBase3i)None

Inserts a dispatch command with the given number of work groups in the X, Y, and Z dimensions at the given position in the list of dispatch commands. Any of these values may be set to 1 if the respective dimension should not be used.

removeDispatch(i: int)None

Erases the given dispatch index from the list.

setDispatch(i: int, num_groups: LVecBase3i)None

Sets the group counts of the nth dispatch associated with this object.