Bind a canvas element to the runtime.
The HTML canvas/
Clear canvas
Copy raw bytes into buffer ptr.
The raw bytes
The target gpu buffer ptr
The beginning offset
Number of bytes
Create a PackedFunc that runs the given shader via createComputePipeline
The function information already parsed as a record.
The shader data(in WGSL)
The shader
Create a PackedFunc that runs the given shader asynchronously via createComputePipelineAsync
The function information already parsed as a record.
The shader data(in WGSL)
The shader
Dispose context.
Draw image from data in storage buffer.
The GPU ptr
The height of the image.
The width of the image.
Get the device API according to its name *
The name of the API.
The corresponding device api.
Obtain the runtime information in readable format.
Wait for all pending GPU tasks to complete
WebGPU context Manages all the webgpu resources here.