GPUQueue: onSubmittedWorkDone() method

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The onSubmittedWorkDone() method of the GPUQueue interface returns a Promise that resolves when all the work submitted to the GPU via this GPUQueue at the point the method is called has been processed.

This includes the completion of any mapAsync() calls made on GPUBuffers used in commands submitted to the queue, before onSubmittedWorkDone() is called.

Syntax

js

onSubmittedWorkDone()

Parameters

None.

Return value

A Promise that resolves with Undefined.

Examples

js

device.queue.onSubmittedWorkDone().then(() => {
  console.log("All submitted commands processed.");
});

device.queue.submit([commandEncoder.finish()]);

Specifications

Specification
WebGPU
# dom-gpuqueue-onsubmittedworkdone

Browser compatibility

BCD tables only load in the browser

See also