WebGPU.rocks Logo

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
    • depthLoadOp: GPULoadOp
    • depthStoreOp: GPUStoreOp
    • depthReadOnly: boolean= 'false'
    • stencilClearValue: GPUStencilValue= 0
    • stencilLoadOp: GPULoadOp
    • stencilStoreOp: GPUStoreOp
    • stencilReadOnly: boolean= 'false'

    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
    • mapState: GPUBufferMapState
    • 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

    GPUExtent3D

    typedef GPUExtent3D = sequence<GPUIntegerCoordinate> | GPUExtent3DDict

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    GPUExtent3DDict

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

    GPUExtent3D

    typedef GPUExtent3D = sequence<GPUIntegerCoordinate> | GPUExtent3DDict

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    GPUExtent3DDict

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

    GPUExtent3D

    typedef GPUExtent3D = sequence<GPUIntegerCoordinate> | GPUExtent3DDict

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    GPUExtent3DDict

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

    GPUBuffer

    • label: USVString
    • size: GPUSize64
    • usage: GPUBufferUsageFlags
    • mapState: GPUBufferMapState
    • 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
    • mapState: GPUBufferMapState
    • 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