Engine API Reference - v2.6.1
    Preparing search index...

    Class Compute

    A representation of a compute shader with the associated resources, that can be executed on the GPU. Only supported on WebGPU platform.

    Index

    Constructors

    • Create a compute instance. Note that this is supported on WebGPU only and is a no-op on other platforms.

      Parameters

      • graphicsDevice: GraphicsDevice

        The graphics device.

      • shader: Shader

        The compute shader.

      • Optionalname: string = 'Unnamed'

        The name of the compute instance, used for debugging only.

      Returns Compute

    Properties

    name: string

    The non-unique name of an instance of the class. Defaults to 'Unnamed'.

    Methods

    • Deletes a shader parameter from the compute instance.

      Parameters

      • name: string

        The name of the parameter to delete.

      Returns void

    • Prepare the compute work dispatch.

      Parameters

      • x: number

        X dimension of the grid of work-groups to dispatch.

      • Optionaly: number

        Y dimension of the grid of work-groups to dispatch.

      • Optionalz: number

        Z dimension of the grid of work-groups to dispatch.

      Returns void