WebGPUBackend
Generated TypeScript API reference for the public mcut SDK.
mcut SDK / compositor/src / WebGPUBackend
Class: WebGPUBackend
Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:78
Implements
Properties
height
readonly height: number;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:81
Implementation of
kind
readonly kind: "webgpu" = 'webgpu';Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:79
Implementation of
width
readonly width: number;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:80
Implementation of
Methods
acquireRaster()
acquireRaster(): Canvas2D;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:284
The frame-space canvas2d context for raster content. Acquiring it marks the raster surface dirty so the backend composites it in z-order; renderers that only need it for text measurement still go through here (text rasterizes anyway).
Returns
Implementation of
beginFrame()
beginFrame(backgroundColor): void;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:233
Parameters
backgroundColor
string
Returns
void
Implementation of
dispose()
dispose(): void;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:322
Free GPU resources. The backend is unusable afterwards.
Returns
void
drawImageQuad()
drawImageQuad(quad, chrome): void;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:297
Composite a media quad with chrome — the GPU fast path. Backends without
one (or layers a backend cannot run, e.g. raw css filters on WebGPU)
draw it through the raster context instead.
Parameters
quad
chrome
Returns
void
Implementation of
endFrame()
endFrame(): void;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:251
Returns
void
Implementation of
popRasterScope()
popRasterScope(): void;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:293
Returns
void
Implementation of
pushRasterScope()
pushRasterScope(): void;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:289
While a raster scope is open, every draw — including image quads — lands on the raster context, so canvas2d state (clips, alpha, transforms) set by the caller applies. Transition mixes and motion-blur accumulation need this. Scopes nest.
Returns
void
Implementation of
registerLut3D()
registerLut3D(
lutId,
size,
data): void;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:198
Register a 3D LUT for lut3d effects: data is size³ RGB triples
(0..1, red fastest), flattened to a (size² × size) 2D texture.
Parameters
lutId
string
size
number
data
Float32Array
Returns
void
create()
static create(options): Promise<WebGPUBackend>;Defined in: packages/compositor/src/webgpu/webgpu-backend.ts:114
Parameters
options
Returns
Promise<WebGPUBackend>