An object that encodes GPU operations.

A CommandEncoder can record RenderPass, ComputePass, and transfer operations between driver-managed resources like Buffer and Texture.

When finished recording, call CommandEncoder.finish to obtain a CommandBuffer which may be submitted for execution.

Methods

@:has_untypedbeginComputePass():ComputePass

Begins recording of a compute pass.

This function returns a ComputePass object which records a single compute pass.

@:has_untypedbeginRenderPass(renderPassDescriptor:RenderPassDescriptor):RenderPass

Begins recording of a render pass.

This function returns a RenderPass object which records a single render pass.

Throws:

UseAfterDestroyException

If the TextureView in renderPassDescriptor were destroyed.

@:has_untypedcopyBufferToBuffer(source:Buffer, sourceOffset:Int, destination:Buffer, destinationOffset:Int, copySize:Int):Void

Copy data from one buffer to another.

Throws:

UseAfterDestroyException

If either source or destination were already destroyed.

@:has_untypedcopyBufferToTexture(source:BufferCopyView, destination:TextureCopyView, copySize:Extent3D):Void

Copy data from a buffer to a texture.

Throws:

UseAfterDestroyException

If either the Buffer from source or the Texture from destination were already destroyed.

@:has_untypedcopyTextureToBuffer(source:TextureCopyView, destination:BufferCopyView, copySize:Extent3D):Void

Copy data from a texture to a buffer.

Throws:

UseAfterDestroyException

If either the Texture from source or the Buffer from destination were already destroyed.

@:has_untypedcopyTextureToTexture(source:TextureCopyView, destination:TextureCopyView, copySize:Extent3D):Void

Copy data from one texture to another.

Throws:

UseAfterDestroyException

If the Texture from either source or destination were already destroyed.

@:has_untypedfinish():CommandBuffer

Finishes recording and returns a CommandBuffer that can be submitted for execution.