> Development branch documentation · commit 327c05c78d2f528e4f4a679fcc7a77d9aa161f48
> Package versions: @zenfg/webgpu 0.1.0, @zenfg/snapshot 0.1.0, @zenfg/inspector 0.1.0, zenfg 0.1.0, zenfg-snapshot 0.1.0
> Source: https://github.com/uinosoft/zenfg/blob/327c05c78d2f528e4f4a679fcc7a77d9aa161f48/packages/webgpu/src/types.ts#L710

[ZenFG TypeScript API](/zenfg/docs/api/index.md) / [webgpu](/zenfg/docs/api/webgpu/index.md) / [root](/zenfg/docs/api/webgpu/root/index.md) / CopyOperation

# Type Alias: CopyOperation

> **CopyOperation** = \{ `copySize`: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md); `destination`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `destinationAspect?`: `GPUTextureAspect`; `destinationMipLevel?`: `number`; `destinationOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `source`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `sourceAspect?`: `GPUTextureAspect`; `sourceMipLevel?`: `number`; `sourceOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `type`: `"texture-to-texture"`; \} \| \{ `destination`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `destinationOffset?`: `GPUSize64`; `size`: `GPUSize64`; `source`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `sourceOffset?`: `GPUSize64`; `type`: `"buffer-to-buffer"`; \} \| \{ `copySize`: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md); `destination`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `destinationAspect?`: `GPUTextureAspect`; `destinationMipLevel?`: `number`; `destinationOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `source`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `sourceLayout`: `Omit`\<`GPUTexelCopyBufferLayout`, `"buffer"`\>; `type`: `"buffer-to-texture"`; \} \| \{ `copySize`: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md); `destination`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `destinationLayout`: `Omit`\<`GPUTexelCopyBufferLayout`, `"buffer"`\>; `source`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `sourceAspect?`: `GPUTextureAspect`; `sourceMipLevel?`: `number`; `sourceOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `type`: `"texture-to-buffer"`; \}

Defined in: [packages/webgpu/src/types.ts:710](https://github.com/uinosoft/zenfg/blob/327c05c78d2f528e4f4a679fcc7a77d9aa161f48/packages/webgpu/src/types.ts#L710)

**`Beta`**

A declarative WebGPU copy operation recorded by FrameGraph.

Copy ranges must satisfy WebGPU alignment and texture format block rules.
Source and destination handles must belong to the current recording.

## Union Members

### Type Literal

\{ `copySize`: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md); `destination`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `destinationAspect?`: `GPUTextureAspect`; `destinationMipLevel?`: `number`; `destinationOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `source`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `sourceAspect?`: `GPUTextureAspect`; `sourceMipLevel?`: `number`; `sourceOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `type`: `"texture-to-texture"`; \}

#### copySize

> `readonly` **copySize**: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md)

Extent copied between the selected subresources.

#### destination

> `readonly` **destination**: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md)

Destination texture.

#### destinationAspect?

> `readonly` `optional` **destinationAspect?**: `GPUTextureAspect`

Destination aspect; defaults from the destination format.

#### destinationMipLevel?

> `readonly` `optional` **destinationMipLevel?**: `number`

Destination mip level; defaults to `0`.

#### destinationOrigin?

> `readonly` `optional` **destinationOrigin?**: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md)

Destination origin; defaults to zero.

#### source

> `readonly` **source**: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md)

Source texture.

#### sourceAspect?

> `readonly` `optional` **sourceAspect?**: `GPUTextureAspect`

Source aspect; defaults from the source format.

#### sourceMipLevel?

> `readonly` `optional` **sourceMipLevel?**: `number`

Source mip level; defaults to `0`.

#### sourceOrigin?

> `readonly` `optional` **sourceOrigin?**: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md)

Source origin; defaults to zero.

#### type

> `readonly` **type**: `"texture-to-texture"`

Copies texture subresources.

***

### Type Literal

\{ `destination`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `destinationOffset?`: `GPUSize64`; `size`: `GPUSize64`; `source`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `sourceOffset?`: `GPUSize64`; `type`: `"buffer-to-buffer"`; \}

#### destination

> `readonly` **destination**: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md)

Destination buffer.

#### destinationOffset?

> `readonly` `optional` **destinationOffset?**: `GPUSize64`

Destination byte offset; defaults to `0`.

#### size

> `readonly` **size**: `GPUSize64`

Number of bytes copied.

#### source

> `readonly` **source**: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md)

Source buffer.

#### sourceOffset?

> `readonly` `optional` **sourceOffset?**: `GPUSize64`

Source byte offset; defaults to `0`.

#### type

> `readonly` **type**: `"buffer-to-buffer"`

Copies a byte range between buffers.

***

### Type Literal

\{ `copySize`: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md); `destination`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `destinationAspect?`: `GPUTextureAspect`; `destinationMipLevel?`: `number`; `destinationOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `source`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `sourceLayout`: `Omit`\<`GPUTexelCopyBufferLayout`, `"buffer"`\>; `type`: `"buffer-to-texture"`; \}

#### copySize

> `readonly` **copySize**: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md)

Texture extent copied.

#### destination

> `readonly` **destination**: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md)

Destination texture.

#### destinationAspect?

> `readonly` `optional` **destinationAspect?**: `GPUTextureAspect`

Destination aspect; defaults from the destination format.

#### destinationMipLevel?

> `readonly` `optional` **destinationMipLevel?**: `number`

Destination mip level; defaults to `0`.

#### destinationOrigin?

> `readonly` `optional` **destinationOrigin?**: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md)

Destination origin; defaults to zero.

#### source

> `readonly` **source**: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md)

Source buffer.

#### sourceLayout

> `readonly` **sourceLayout**: `Omit`\<`GPUTexelCopyBufferLayout`, `"buffer"`\>

Buffer layout excluding the logical buffer handle.

#### type

> `readonly` **type**: `"buffer-to-texture"`

Copies texel data from a buffer into a texture.

***

### Type Literal

\{ `copySize`: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md); `destination`: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md); `destinationLayout`: `Omit`\<`GPUTexelCopyBufferLayout`, `"buffer"`\>; `source`: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md); `sourceAspect?`: `GPUTextureAspect`; `sourceMipLevel?`: `number`; `sourceOrigin?`: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md); `type`: `"texture-to-buffer"`; \}

#### copySize

> `readonly` **copySize**: [`TextureSize`](/zenfg/docs/api/webgpu/root/type-aliases/TextureSize.md)

Texture extent copied.

#### destination

> `readonly` **destination**: [`BufferHandle`](/zenfg/docs/api/webgpu/root/type-aliases/BufferHandle.md)

Destination buffer.

#### destinationLayout

> `readonly` **destinationLayout**: `Omit`\<`GPUTexelCopyBufferLayout`, `"buffer"`\>

Buffer layout excluding the logical buffer handle.

#### source

> `readonly` **source**: [`TextureHandle`](/zenfg/docs/api/webgpu/root/type-aliases/TextureHandle.md)

Source texture.

#### sourceAspect?

> `readonly` `optional` **sourceAspect?**: `GPUTextureAspect`

Source aspect; defaults from the source format.

#### sourceMipLevel?

> `readonly` `optional` **sourceMipLevel?**: `number`

Source mip level; defaults to `0`.

#### sourceOrigin?

> `readonly` `optional` **sourceOrigin?**: [`TextureOrigin`](/zenfg/docs/api/webgpu/root/type-aliases/TextureOrigin.md)

Source origin; defaults to zero.

#### type

> `readonly` **type**: `"texture-to-buffer"`

Copies texel data from a texture into a buffer.
