GPUCommandEncoder

  • GPUDevice.createCommandEncoder(descriptor: GPUCommandEncoderDescriptor): GPUCommandEncoder

    GPUCommandEncoderDescriptor

    • label: USVString
  • label: USVString
  • pushDebugGroup(groupLabel: USVString): void
  • popDebugGroup(): void
  • insertDebugMarker(markerLabel: USVString): void
  • beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder

    GPURenderPassDescriptor

    • label: USVString
    • colorAttachments: sequence<GPURenderPassColorAttachment>required
    • depthStencilAttachment: GPURenderPassDepthStencilAttachment
    • occlusionQuerySet: GPUQuerySet
    • timestampWrites: GPURenderPassTimestampWrites= []
    • maxDrawCount: GPUSize64= 50000000

    GPURenderPassColorAttachment

    GPUColor

    typedef GPUColor = sequence<double> | GPUColorDict

    GPUColorDict

    • r: doublerequired
    • g: doublerequired
    • b: doublerequired
    • a: doublerequired

    GPULoadOp

    'load', 'clear'

    GPUStoreOp

    'store', 'discard'

    GPURenderPassDepthStencilAttachment

    • view: GPUTextureViewrequired
    • depthClearValue: float= 0
    • depthLoadOp: GPULoadOp
    • depthStoreOp: GPUStoreOp
    • depthReadOnly: boolean
    • stencilClearValue: GPUStencilValue= 0
    • stencilLoadOp: GPULoadOp
    • stencilStoreOp: GPUStoreOp
    • stencilReadOnly: boolean

    GPUStencilValue

    typedef GPUStencilValue = unsigned long

    GPURenderPassTimestampWrites

    typedef GPURenderPassTimestampWrites = sequence<GPURenderPassTimestampWrite>

    GPURenderPassTimestampWrite

    • querySet: GPUQuerySetrequired
    • queryIndex: GPUSize32required
    • location: GPURenderPassTimestampLocationrequired

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPURenderPassTimestampLocation

    'beginning', 'end'

    GPUSize64

    typedef GPUSize64 = unsigned long long
  • beginComputePass(descriptor: GPUComputePassDescriptor): GPUComputePassEncoder

    GPUComputePassDescriptor

    • label: USVString
    • timestampWrites: GPUComputePassTimestampWrites= []

    GPUComputePassTimestampWrites

    typedef GPUComputePassTimestampWrites = sequence<GPUComputePassTimestampWrite>

    GPUComputePassTimestampWrite

    • querySet: GPUQuerySetrequired
    • queryIndex: GPUSize32required
    • location: GPUComputePassTimestampLocationrequired

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUComputePassTimestampLocation

    'beginning', 'end'
  • copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64): void

    GPUBuffer

    • label: USVString
    • size: GPUSize64
    • usage: GPUBufferUsageFlags
    • mapAsync(mode: GPUMapModeFlags, offset: GPUSize64, size: GPUSize64): Promise<void>
    • getMappedRange(offset: GPUSize64, size: GPUSize64): ArrayBuffer
    • unmap(): void
    • destroy(): void

    GPUSize64

    typedef GPUSize64 = unsigned long long
  • copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void

    GPUImageCopyBuffer

    • offset: GPUSize64= 0
    • bytesPerRow: GPUSize32
    • rowsPerImage: GPUSize32
    • buffer: GPUBufferrequired

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUImageCopyTexture

    • texture: GPUTexturerequired
    • mipLevel: GPUIntegerCoordinate= 0
    • origin: GPUOrigin3D= { … }
    • aspect: GPUTextureAspect= 'all'

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    GPUOrigin3D

    typedef GPUOrigin3D = sequence<GPUIntegerCoordinate> | GPUOrigin3DDict

    GPUOrigin3DDict

    • x: GPUIntegerCoordinate= 0
    • y: GPUIntegerCoordinate= 0
    • z: GPUIntegerCoordinate= 0

    GPUTextureAspect

    'all', 'stencil-only', 'depth-only'

    GPUExtent3D

    typedef GPUExtent3D = sequence<GPUIntegerCoordinate> | GPUExtent3DDict

    GPUExtent3DDict

    • width: GPUIntegerCoordinaterequired
    • height: GPUIntegerCoordinate= 1
    • depthOrArrayLayers: GPUIntegerCoordinate= 1
  • copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D): void

    GPUImageCopyTexture

    • texture: GPUTexturerequired
    • mipLevel: GPUIntegerCoordinate= 0
    • origin: GPUOrigin3D= { … }
    • aspect: GPUTextureAspect= 'all'

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    GPUOrigin3D

    typedef GPUOrigin3D = sequence<GPUIntegerCoordinate> | GPUOrigin3DDict

    GPUOrigin3DDict

    • x: GPUIntegerCoordinate= 0
    • y: GPUIntegerCoordinate= 0
    • z: GPUIntegerCoordinate= 0

    GPUTextureAspect

    'all', 'stencil-only', 'depth-only'

    GPUImageCopyBuffer

    • offset: GPUSize64= 0
    • bytesPerRow: GPUSize32
    • rowsPerImage: GPUSize32
    • buffer: GPUBufferrequired

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUExtent3D

    typedef GPUExtent3D = sequence<GPUIntegerCoordinate> | GPUExtent3DDict

    GPUExtent3DDict

    • width: GPUIntegerCoordinaterequired
    • height: GPUIntegerCoordinate= 1
    • depthOrArrayLayers: GPUIntegerCoordinate= 1
  • copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void

    GPUImageCopyTexture

    • texture: GPUTexturerequired
    • mipLevel: GPUIntegerCoordinate= 0
    • origin: GPUOrigin3D= { … }
    • aspect: GPUTextureAspect= 'all'

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    GPUOrigin3D

    typedef GPUOrigin3D = sequence<GPUIntegerCoordinate> | GPUOrigin3DDict

    GPUOrigin3DDict

    • x: GPUIntegerCoordinate= 0
    • y: GPUIntegerCoordinate= 0
    • z: GPUIntegerCoordinate= 0

    GPUTextureAspect

    'all', 'stencil-only', 'depth-only'

    GPUExtent3D

    typedef GPUExtent3D = sequence<GPUIntegerCoordinate> | GPUExtent3DDict

    GPUExtent3DDict

    • width: GPUIntegerCoordinaterequired
    • height: GPUIntegerCoordinate= 1
    • depthOrArrayLayers: GPUIntegerCoordinate= 1
  • clearBuffer(buffer: GPUBuffer, offset: GPUSize64, size: GPUSize64): void

    GPUBuffer

    • label: USVString
    • size: GPUSize64
    • usage: GPUBufferUsageFlags
    • mapAsync(mode: GPUMapModeFlags, offset: GPUSize64, size: GPUSize64): Promise<void>
    • getMappedRange(offset: GPUSize64, size: GPUSize64): ArrayBuffer
    • unmap(): void
    • destroy(): void

    GPUSize64

    typedef GPUSize64 = unsigned long long
  • writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32): void

    GPUQuerySet

    • label: USVString
    • type: GPUQueryType
    • count: GPUSize32
    • destroy(): void

    GPUSize32

    typedef GPUSize32 = unsigned long
  • resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): void

    GPUQuerySet

    • label: USVString
    • type: GPUQueryType
    • count: GPUSize32
    • destroy(): void

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUBuffer

    • label: USVString
    • size: GPUSize64
    • usage: GPUBufferUsageFlags
    • mapAsync(mode: GPUMapModeFlags, offset: GPUSize64, size: GPUSize64): Promise<void>
    • getMappedRange(offset: GPUSize64, size: GPUSize64): ArrayBuffer
    • unmap(): void
    • destroy(): void

    GPUSize64

    typedef GPUSize64 = unsigned long long
  • finish(descriptor: GPUCommandBufferDescriptor): GPUCommandBuffer

    GPUCommandBufferDescriptor

    • label: USVString