Renderer · interface
ComputeDefinition
Explained in Hello world.
interface ComputeDefinitionimport type { ComputeDefinition } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
labelreadonly | string | For diagnostics, and for the label the backend gives the encoder and the pass. |
Methods
initoptional
init?(device: ComputeDevice): voidBuild pipelines and buffers. Called once, when the definition is registered.
| Parameter | Type | Description |
|---|---|---|
device | ComputeDevice |
dispatch
dispatch(ctx: ComputeContext): voidSet a pipeline, set bind groups, and call dispatchWorkgroups.
| Parameter | Type | Description |
|---|---|---|
ctx | ComputeContext |
More
The workgroup count is yours and does not cross the surface, exactly as a contributed
pass issues its own draw calls. The count comes from data the definition owns — a light
count, a cluster count — so a renderer-side (x, y, z) would be one fact in two places, and
the renderer's copy would be the one nobody updated.
Allocates nothing. This is a per-frame path and the house rule about them binds a contributor exactly as it binds the renderer.
disposeoptional
dispose?(device: ComputeDevice): voidRelease what init built. Called on unregisterCompute and when the renderer is disposed.
| Parameter | Type | Description |
|---|---|---|
device | ComputeDevice |