Class GPUQueue
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The GPUQueue interface of the {{domxref("WebGPU API", "WebGPU API", "", "nocode")}} controls execution of encoded commands on the GPU.
[Value("GPUQueue")]
public class GPUQueue
- Inheritance
-
GPUQueue
- Inherited Members
Remarks
Constructors
GPUQueue()
public GPUQueue()
Methods
CopyExternalImageToTexture(GPUCopyExternalImageSourceInfo, GPUCopyExternalImageDestInfo, Union222)
The copyExternalImageToTexture() method of the
GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.
[Value("copyExternalImageToTexture")]
public GlobalObject.Undefined CopyExternalImageToTexture(GPUCopyExternalImageSourceInfo source, GPUCopyExternalImageDestInfo destination, Union222 copySize)
Parameters
sourceGPUCopyExternalImageSourceInfodestinationGPUCopyExternalImageDestInfocopySizeUnion222
Returns
Remarks
Using this function allows the user agent to determine the most efficient way to copy the data over for each source type.
-The WebGPU API
OnSubmittedWorkDone()
The onSubmittedWorkDone() method of the
GPUQueue interface returns a {{jsxref("Promise")}} that resolves when all the work submitted to the GPU via this GPUQueue at the point the method is called has been processed.
[Value("onSubmittedWorkDone")]
public Task<GlobalObject.Undefined> OnSubmittedWorkDone()
Returns
- Task<GlobalObject.Undefined>
A Promise that resolves with GlobalObject.Undefined.
Remarks
This includes the completion of any MapAsync(ulong, ulong, ulong) calls made on GPUBuffers used in commands submitted to the queue, before onSubmittedWorkDone() is called.
Note: In most cases, you do not need to call onSubmittedWorkDone(). You do not need to call it for mapping a buffer. mapAsync guarantees work submitted to the queue before calling mapAsync happens before the mapAsync returns (see WebGPU spec).
The two use cases for onSubmittedWorkDone
-The WebGPU API
Submit(List<GPUCommandBuffer>)
The submit() method of the
GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU.
[Value("submit")]
public GlobalObject.Undefined Submit(List<GPUCommandBuffer> commandBuffers)
Parameters
commandBuffersList<GPUCommandBuffer>
Returns
Remarks
WriteBuffer(GPUBuffer, ulong, Union225, ulong, ulong)
The writeBuffer() method of the
GPUQueue interface writes a provided data source into a given GPUBuffer.
[Value("writeBuffer")]
public GlobalObject.Undefined WriteBuffer(GPUBuffer buffer, ulong bufferOffset, Union225 data, ulong dataOffset = 0, ulong size = 0)
Parameters
Returns
Remarks
This is a convenience function, which provides an alternative to setting buffer data via buffer mapping and buffer-to-buffer copies. It lets the user agent determine the most efficient way to copy the data over.
-The WebGPU API
WriteTexture(GPUTexelCopyTextureInfo, Union225, GPUTexelCopyBufferLayout, Union222)
The writeTexture() method of the
GPUQueue interface writes a provided data source into a given GPUTexture.
[Value("writeTexture")]
public GlobalObject.Undefined WriteTexture(GPUTexelCopyTextureInfo destination, Union225 data, GPUTexelCopyBufferLayout dataLayout, Union222 size)
Parameters
destinationGPUTexelCopyTextureInfodataUnion225dataLayoutGPUTexelCopyBufferLayoutsizeUnion222
Returns
Remarks
This is a convenience function, which provides an alternative to setting texture data via buffer mapping and buffer-to-texture copies. It lets the user agent determine the most efficient way to copy the data over.
-The WebGPU API