Skip to main content

GPUQueue

The GPUQueue interface of the WebGPU API controls execution of encoded commands on the GPU. Available only in secure contexts.

MDN Reference

Extends​

Methods​

copyExternalImageToTexture()​

Call Signature​

copyExternalImageToTexture(
source,
destination,
copySize
): void;

The copyExternalImageToTexture() method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.

MDN Reference

Parameters​
ParameterType
sourceGPUCopyExternalImageSourceInfo
destinationGPUCopyExternalImageDestInfo
copySizeGPUExtent3D
Returns​

void

Call Signature​

copyExternalImageToTexture(
source,
destination,
copySize
): void;

The copyExternalImageToTexture() method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.

MDN Reference

Parameters​
ParameterType
sourceGPUCopyExternalImageSourceInfo
destinationGPUCopyExternalImageDestInfo
copySizeIterable<number>
Returns​

void


onSubmittedWorkDone()​

onSubmittedWorkDone(): Promise<void>;

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.

MDN Reference

Returns​

Promise<void>


submit()​

Call Signature​

submit(commandBuffers): void;

The submit() method of the GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU.

MDN Reference

Parameters​
ParameterType
commandBuffersGPUCommandBuffer[]
Returns​

void

Call Signature​

submit(commandBuffers): void;

The submit() method of the GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU.

MDN Reference

Parameters​
ParameterType
commandBuffersIterable<GPUCommandBuffer>
Returns​

void


writeBuffer()​

writeBuffer(
buffer,
bufferOffset,
data,
dataOffset?,
size?
): void;

The writeBuffer() method of the GPUQueue interface writes a provided data source into a given GPUBuffer.

MDN Reference

Parameters​

ParameterType
bufferGPUBuffer
bufferOffsetnumber
dataAllowSharedBufferSource
dataOffset?number
size?number

Returns​

void


writeTexture()​

Call Signature​

writeTexture(
destination,
data,
dataLayout,
size
): void;

The writeTexture() method of the GPUQueue interface writes a provided data source into a given GPUTexture.

MDN Reference

Parameters​
ParameterType
destinationGPUTexelCopyTextureInfo
dataAllowSharedBufferSource
dataLayoutGPUTexelCopyBufferLayout
sizeGPUExtent3D
Returns​

void

Call Signature​

writeTexture(
destination,
data,
dataLayout,
size
): void;

The writeTexture() method of the GPUQueue interface writes a provided data source into a given GPUTexture.

MDN Reference

Parameters​
ParameterType
destinationGPUTexelCopyTextureInfo
dataAllowSharedBufferSource
dataLayoutGPUTexelCopyBufferLayout
sizeIterable<number>
Returns​

void

Properties​

label​

label: string;

MDN Reference

Inherited from​

GPUObjectBase.label