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

    • view: GPUTextureViewrequired
    • depthSlice: GPUIntegerCoordinate
    • resolveTarget: GPUTextureView
    • clearValue: GPUColor
    • loadOp: GPULoadOprequired
    • storeOp: GPUStoreOprequired

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    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

    • querySet: GPUQuerySetrequired
    • beginningOfPassWriteIndex: GPUSize32
    • endOfPassWriteIndex: GPUSize32

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUSize64

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

    GPUComputePassDescriptor

    • label: USVString= ''
    • timestampWrites: GPUComputePassTimestampWrites

    GPUComputePassTimestampWrites

    • querySet: GPUQuerySetrequired
    • beginningOfPassWriteIndex: GPUSize32
    • endOfPassWriteIndex: GPUSize32

    GPUSize32

    typedef GPUSize32 = unsigned long
  • copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64): void

    GPUBuffer

    • label: USVString
    • size: GPUSize64Out
    • usage: GPUFlagsConstant
    • 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: GPUSize64Out
    • usage: GPUFlagsConstant
    • 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
  • resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): void

    GPUQuerySet

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

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUBuffer

    • label: USVString
    • size: GPUSize64Out
    • usage: GPUFlagsConstant
    • 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= ''