GPUDevice

  • GPUAdapter.requestDevice(descriptor: GPUDeviceDescriptor): Promise<GPUDevice>

    GPUDeviceDescriptor

    • label: USVString
    • requiredFeatures: sequence<GPUFeatureName>= []
    • requiredLimits: record<DOMString, GPUSize64>= { … }
    • defaultQueue: GPUQueueDescriptor= { … }

    GPUFeatureName

    'depth-clip-control', 'depth32float-stencil8', 'texture-compression-bc', 'texture-compression-etc2', 'texture-compression-astc', 'timestamp-query', 'indirect-first-instance', 'shader-f16', 'bgra8unorm-storage', 'rg11b10ufloat-renderable'

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUQueueDescriptor

    • label: USVString
  • label: USVString
  • queue: GPUQueue
  • lost: Promise<GPUDeviceLostInfo>
  • onuncapturederror: EventHandler
  • destroy(): void
  • createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer

    GPUBufferDescriptor

    • label: USVString
    • size: GPUSize64required
    • usage: GPUBufferUsageFlagsrequired
    • mappedAtCreation: boolean

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUBufferUsageFlags

  • createTexture(descriptor: GPUTextureDescriptor): GPUTexture

    GPUTextureDescriptor

    • label: USVString
    • size: GPUExtent3Drequired
    • mipLevelCount: GPUIntegerCoordinate= 1
    • sampleCount: GPUSize32= 1
    • dimension: GPUTextureDimension= '2d'
    • format: GPUTextureFormatrequired
    • usage: GPUTextureUsageFlagsrequired
    • viewFormats: sequence<GPUTextureFormat>= []

    GPUExtent3D

    typedef GPUExtent3D = sequence<GPUIntegerCoordinate> | GPUExtent3DDict

    GPUIntegerCoordinate

    typedef GPUIntegerCoordinate = unsigned long

    GPUExtent3DDict

    • width: GPUIntegerCoordinaterequired
    • height: GPUIntegerCoordinate= 1
    • depthOrArrayLayers: GPUIntegerCoordinate= 1

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUTextureDimension

    '1d', '2d', '3d'

    GPUTextureFormat

    'r8unorm', 'r8snorm', 'r8uint', 'r8sint', 'r16uint', 'r16sint', 'r16float', 'rg8unorm', 'rg8snorm', 'rg8uint', 'rg8sint', 'r32uint', 'r32sint', 'r32float', 'rg16uint', 'rg16sint', 'rg16float', 'rgba8unorm', 'rgba8unorm-srgb', 'rgba8snorm', 'rgba8uint', 'rgba8sint', 'bgra8unorm', 'bgra8unorm-srgb', 'rgb9e5ufloat', 'rgb10a2unorm', 'rg11b10ufloat', 'rg32uint', 'rg32sint', 'rg32float', 'rgba16uint', 'rgba16sint', 'rgba16float', 'rgba32uint', 'rgba32sint', 'rgba32float', 'stencil8', 'depth16unorm', 'depth24plus', 'depth24plus-stencil8', 'depth32float', 'depth32float-stencil8', 'bc1-rgba-unorm', 'bc1-rgba-unorm-srgb', 'bc2-rgba-unorm', 'bc2-rgba-unorm-srgb', 'bc3-rgba-unorm', 'bc3-rgba-unorm-srgb', 'bc4-r-unorm', 'bc4-r-snorm', 'bc5-rg-unorm', 'bc5-rg-snorm', 'bc6h-rgb-ufloat', 'bc6h-rgb-float', 'bc7-rgba-unorm', 'bc7-rgba-unorm-srgb', 'etc2-rgb8unorm', 'etc2-rgb8unorm-srgb', 'etc2-rgb8a1unorm', 'etc2-rgb8a1unorm-srgb', 'etc2-rgba8unorm', 'etc2-rgba8unorm-srgb', 'eac-r11unorm', 'eac-r11snorm', 'eac-rg11unorm', 'eac-rg11snorm', 'astc-4x4-unorm', 'astc-4x4-unorm-srgb', 'astc-5x4-unorm', 'astc-5x4-unorm-srgb', 'astc-5x5-unorm', 'astc-5x5-unorm-srgb', 'astc-6x5-unorm', 'astc-6x5-unorm-srgb', 'astc-6x6-unorm', 'astc-6x6-unorm-srgb', 'astc-8x5-unorm', 'astc-8x5-unorm-srgb', 'astc-8x6-unorm', 'astc-8x6-unorm-srgb', 'astc-8x8-unorm', 'astc-8x8-unorm-srgb', 'astc-10x5-unorm', 'astc-10x5-unorm-srgb', 'astc-10x6-unorm', 'astc-10x6-unorm-srgb', 'astc-10x8-unorm', 'astc-10x8-unorm-srgb', 'astc-10x10-unorm', 'astc-10x10-unorm-srgb', 'astc-12x10-unorm', 'astc-12x10-unorm-srgb', 'astc-12x12-unorm', 'astc-12x12-unorm-srgb'

    GPUTextureUsageFlags

  • createSampler(descriptor: GPUSamplerDescriptor): GPUSampler

    GPUSamplerDescriptor

    • label: USVString
    • addressModeU: GPUAddressMode= 'clamp-to-edge'
    • addressModeV: GPUAddressMode= 'clamp-to-edge'
    • addressModeW: GPUAddressMode= 'clamp-to-edge'
    • magFilter: GPUFilterMode= 'nearest'
    • minFilter: GPUFilterMode= 'nearest'
    • mipmapFilter: GPUMipmapFilterMode= 'nearest'
    • lodMinClamp: float= 0
    • lodMaxClamp: float= 32
    • compare: GPUCompareFunction
    • maxAnisotropy: unsigned short= 1

    GPUAddressMode

    'clamp-to-edge', 'repeat', 'mirror-repeat'

    GPUFilterMode

    'nearest', 'linear'

    GPUMipmapFilterMode

    'nearest', 'linear'

    GPUCompareFunction

    'never', 'less', 'equal', 'less-equal', 'greater', 'not-equal', 'greater-equal', 'always'
  • importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture

    GPUExternalTextureDescriptor

    • label: USVString
    • source: HTMLVideoElementrequired
    • colorSpace: PredefinedColorSpace= 'srgb'
  • createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout

    GPUBindGroupLayoutDescriptor

    • label: USVString
    • entries: sequence<GPUBindGroupLayoutEntry>required

    GPUBindGroupLayoutEntry

    • binding: GPUIndex32required
    • visibility: GPUShaderStageFlagsrequired
    • buffer: GPUBufferBindingLayout
    • sampler: GPUSamplerBindingLayout
    • texture: GPUTextureBindingLayout
    • storageTexture: GPUStorageTextureBindingLayout
    • externalTexture: GPUExternalTextureBindingLayout

    GPUIndex32

    typedef GPUIndex32 = unsigned long

    GPUShaderStageFlags

    GPUBufferBindingLayout

    • type: GPUBufferBindingType= 'uniform'
    • hasDynamicOffset: boolean
    • minBindingSize: GPUSize64= 0

    GPUBufferBindingType

    'uniform', 'storage', 'read-only-storage'

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUSamplerBindingLayout

    • type: GPUSamplerBindingType= 'filtering'

    GPUSamplerBindingType

    'filtering', 'non-filtering', 'comparison'

    GPUTextureBindingLayout

    • sampleType: GPUTextureSampleType= 'float'
    • viewDimension: GPUTextureViewDimension= '2d'
    • multisampled: boolean

    GPUTextureSampleType

    'float', 'unfilterable-float', 'depth', 'sint', 'uint'

    GPUTextureViewDimension

    '1d', '2d', '2d-array', 'cube', 'cube-array', '3d'

    GPUStorageTextureBindingLayout

    • access: GPUStorageTextureAccess= 'write-only'
    • format: GPUTextureFormatrequired
    • viewDimension: GPUTextureViewDimension= '2d'

    GPUStorageTextureAccess

    'write-only'

    GPUTextureFormat

    'r8unorm', 'r8snorm', 'r8uint', 'r8sint', 'r16uint', 'r16sint', 'r16float', 'rg8unorm', 'rg8snorm', 'rg8uint', 'rg8sint', 'r32uint', 'r32sint', 'r32float', 'rg16uint', 'rg16sint', 'rg16float', 'rgba8unorm', 'rgba8unorm-srgb', 'rgba8snorm', 'rgba8uint', 'rgba8sint', 'bgra8unorm', 'bgra8unorm-srgb', 'rgb9e5ufloat', 'rgb10a2unorm', 'rg11b10ufloat', 'rg32uint', 'rg32sint', 'rg32float', 'rgba16uint', 'rgba16sint', 'rgba16float', 'rgba32uint', 'rgba32sint', 'rgba32float', 'stencil8', 'depth16unorm', 'depth24plus', 'depth24plus-stencil8', 'depth32float', 'depth32float-stencil8', 'bc1-rgba-unorm', 'bc1-rgba-unorm-srgb', 'bc2-rgba-unorm', 'bc2-rgba-unorm-srgb', 'bc3-rgba-unorm', 'bc3-rgba-unorm-srgb', 'bc4-r-unorm', 'bc4-r-snorm', 'bc5-rg-unorm', 'bc5-rg-snorm', 'bc6h-rgb-ufloat', 'bc6h-rgb-float', 'bc7-rgba-unorm', 'bc7-rgba-unorm-srgb', 'etc2-rgb8unorm', 'etc2-rgb8unorm-srgb', 'etc2-rgb8a1unorm', 'etc2-rgb8a1unorm-srgb', 'etc2-rgba8unorm', 'etc2-rgba8unorm-srgb', 'eac-r11unorm', 'eac-r11snorm', 'eac-rg11unorm', 'eac-rg11snorm', 'astc-4x4-unorm', 'astc-4x4-unorm-srgb', 'astc-5x4-unorm', 'astc-5x4-unorm-srgb', 'astc-5x5-unorm', 'astc-5x5-unorm-srgb', 'astc-6x5-unorm', 'astc-6x5-unorm-srgb', 'astc-6x6-unorm', 'astc-6x6-unorm-srgb', 'astc-8x5-unorm', 'astc-8x5-unorm-srgb', 'astc-8x6-unorm', 'astc-8x6-unorm-srgb', 'astc-8x8-unorm', 'astc-8x8-unorm-srgb', 'astc-10x5-unorm', 'astc-10x5-unorm-srgb', 'astc-10x6-unorm', 'astc-10x6-unorm-srgb', 'astc-10x8-unorm', 'astc-10x8-unorm-srgb', 'astc-10x10-unorm', 'astc-10x10-unorm-srgb', 'astc-12x10-unorm', 'astc-12x10-unorm-srgb', 'astc-12x12-unorm', 'astc-12x12-unorm-srgb'

    GPUExternalTextureBindingLayout

  • createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout

    GPUPipelineLayoutDescriptor

    GPUBindGroupLayout

    • label: USVString
  • createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup

    GPUBindGroupDescriptor

    • label: USVString
    • layout: GPUBindGroupLayoutrequired
    • entries: sequence<GPUBindGroupEntry>required

    GPUBindGroupEntry

    • binding: GPUIndex32required
    • resource: GPUBindingResourcerequired

    GPUIndex32

    typedef GPUIndex32 = unsigned long

    GPUBindingResource

    typedef GPUBindingResource = GPUSampler | GPUTextureView | GPUBufferBinding | GPUExternalTexture

    GPUSampler

    • label: USVString

    GPUTextureView

    • label: USVString

    GPUBufferBinding

    • buffer: GPUBufferrequired
    • offset: GPUSize64= 0
    • size: GPUSize64

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUExternalTexture

    • label: USVString
    • expired: boolean
  • createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule

    GPUShaderModuleDescriptor

    • label: USVString
    • code: USVStringrequired
    • sourceMap: object
    • hints: record<USVString, GPUShaderModuleCompilationHint>

    GPUShaderModuleCompilationHint

    GPUPipelineLayout

    • label: USVString

    GPUAutoLayoutMode

    'auto'
  • createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline

    GPUComputePipelineDescriptor

    • label: USVString
    • layout: GPUPipelineLayout | GPUAutoLayoutModerequired
    • compute: GPUProgrammableStagerequired

    GPUPipelineLayout

    • label: USVString

    GPUAutoLayoutMode

    'auto'

    GPUProgrammableStage

    • module: GPUShaderModulerequired
    • entryPoint: USVStringrequired
    • constants: record<USVString, GPUPipelineConstantValue>

    GPUPipelineConstantValue

    typedef GPUPipelineConstantValue = double
  • createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline

    GPURenderPipelineDescriptor

    • label: USVString
    • layout: GPUPipelineLayout | GPUAutoLayoutModerequired
    • vertex: GPUVertexStaterequired
    • primitive: GPUPrimitiveState= { … }
    • depthStencil: GPUDepthStencilState
    • multisample: GPUMultisampleState= { … }
    • fragment: GPUFragmentState

    GPUPipelineLayout

    • label: USVString

    GPUAutoLayoutMode

    'auto'

    GPUVertexState

    • module: GPUShaderModulerequired
    • entryPoint: USVStringrequired
    • constants: record<USVString, GPUPipelineConstantValue>
    • buffers: sequence<GPUVertexBufferLayout>= []

    GPUPipelineConstantValue

    typedef GPUPipelineConstantValue = double

    GPUVertexBufferLayout

    • arrayStride: GPUSize64required
    • stepMode: GPUVertexStepMode= 'vertex'
    • attributes: sequence<GPUVertexAttribute>required

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUVertexStepMode

    'vertex', 'instance'

    GPUVertexAttribute

    • format: GPUVertexFormatrequired
    • offset: GPUSize64required
    • shaderLocation: GPUIndex32required

    GPUVertexFormat

    'uint8x2', 'uint8x4', 'sint8x2', 'sint8x4', 'unorm8x2', 'unorm8x4', 'snorm8x2', 'snorm8x4', 'uint16x2', 'uint16x4', 'sint16x2', 'sint16x4', 'unorm16x2', 'unorm16x4', 'snorm16x2', 'snorm16x4', 'float16x2', 'float16x4', 'float32', 'float32x2', 'float32x3', 'float32x4', 'uint32', 'uint32x2', 'uint32x3', 'uint32x4', 'sint32', 'sint32x2', 'sint32x3', 'sint32x4'

    GPUIndex32

    typedef GPUIndex32 = unsigned long

    GPUPrimitiveState

    • topology: GPUPrimitiveTopology= 'triangle-list'
    • stripIndexFormat: GPUIndexFormat
    • frontFace: GPUFrontFace= 'ccw'
    • cullMode: GPUCullMode= 'none'
    • unclippedDepth: boolean

    GPUPrimitiveTopology

    'point-list', 'line-list', 'line-strip', 'triangle-list', 'triangle-strip'

    GPUIndexFormat

    'uint16', 'uint32'

    GPUFrontFace

    'ccw', 'cw'

    GPUCullMode

    'none', 'front', 'back'

    GPUDepthStencilState

    • format: GPUTextureFormatrequired
    • depthWriteEnabled: boolean
    • depthCompare: GPUCompareFunction= 'always'
    • stencilFront: GPUStencilFaceState= { … }
    • stencilBack: GPUStencilFaceState= { … }
    • stencilReadMask: GPUStencilValue= 0xFFFFFFFF
    • stencilWriteMask: GPUStencilValue= 0xFFFFFFFF
    • depthBias: GPUDepthBias= 0
    • depthBiasSlopeScale: float= 0
    • depthBiasClamp: float= 0

    GPUTextureFormat

    'r8unorm', 'r8snorm', 'r8uint', 'r8sint', 'r16uint', 'r16sint', 'r16float', 'rg8unorm', 'rg8snorm', 'rg8uint', 'rg8sint', 'r32uint', 'r32sint', 'r32float', 'rg16uint', 'rg16sint', 'rg16float', 'rgba8unorm', 'rgba8unorm-srgb', 'rgba8snorm', 'rgba8uint', 'rgba8sint', 'bgra8unorm', 'bgra8unorm-srgb', 'rgb9e5ufloat', 'rgb10a2unorm', 'rg11b10ufloat', 'rg32uint', 'rg32sint', 'rg32float', 'rgba16uint', 'rgba16sint', 'rgba16float', 'rgba32uint', 'rgba32sint', 'rgba32float', 'stencil8', 'depth16unorm', 'depth24plus', 'depth24plus-stencil8', 'depth32float', 'depth32float-stencil8', 'bc1-rgba-unorm', 'bc1-rgba-unorm-srgb', 'bc2-rgba-unorm', 'bc2-rgba-unorm-srgb', 'bc3-rgba-unorm', 'bc3-rgba-unorm-srgb', 'bc4-r-unorm', 'bc4-r-snorm', 'bc5-rg-unorm', 'bc5-rg-snorm', 'bc6h-rgb-ufloat', 'bc6h-rgb-float', 'bc7-rgba-unorm', 'bc7-rgba-unorm-srgb', 'etc2-rgb8unorm', 'etc2-rgb8unorm-srgb', 'etc2-rgb8a1unorm', 'etc2-rgb8a1unorm-srgb', 'etc2-rgba8unorm', 'etc2-rgba8unorm-srgb', 'eac-r11unorm', 'eac-r11snorm', 'eac-rg11unorm', 'eac-rg11snorm', 'astc-4x4-unorm', 'astc-4x4-unorm-srgb', 'astc-5x4-unorm', 'astc-5x4-unorm-srgb', 'astc-5x5-unorm', 'astc-5x5-unorm-srgb', 'astc-6x5-unorm', 'astc-6x5-unorm-srgb', 'astc-6x6-unorm', 'astc-6x6-unorm-srgb', 'astc-8x5-unorm', 'astc-8x5-unorm-srgb', 'astc-8x6-unorm', 'astc-8x6-unorm-srgb', 'astc-8x8-unorm', 'astc-8x8-unorm-srgb', 'astc-10x5-unorm', 'astc-10x5-unorm-srgb', 'astc-10x6-unorm', 'astc-10x6-unorm-srgb', 'astc-10x8-unorm', 'astc-10x8-unorm-srgb', 'astc-10x10-unorm', 'astc-10x10-unorm-srgb', 'astc-12x10-unorm', 'astc-12x10-unorm-srgb', 'astc-12x12-unorm', 'astc-12x12-unorm-srgb'

    GPUCompareFunction

    'never', 'less', 'equal', 'less-equal', 'greater', 'not-equal', 'greater-equal', 'always'

    GPUStencilFaceState

    • compare: GPUCompareFunction= 'always'
    • failOp: GPUStencilOperation= 'keep'
    • depthFailOp: GPUStencilOperation= 'keep'
    • passOp: GPUStencilOperation= 'keep'

    GPUStencilOperation

    'keep', 'zero', 'replace', 'invert', 'increment-clamp', 'decrement-clamp', 'increment-wrap', 'decrement-wrap'

    GPUStencilValue

    typedef GPUStencilValue = unsigned long

    GPUDepthBias

    typedef GPUDepthBias = long

    GPUMultisampleState

    • count: GPUSize32= 1
    • mask: GPUSampleMask= 0xFFFFFFFF
    • alphaToCoverageEnabled: boolean

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUSampleMask

    typedef GPUSampleMask = unsigned long

    GPUFragmentState

    • module: GPUShaderModulerequired
    • entryPoint: USVStringrequired
    • constants: record<USVString, GPUPipelineConstantValue>
    • targets: sequence<GPUColorTargetState>required

    GPUColorTargetState

    • format: GPUTextureFormatrequired
    • blend: GPUBlendState
    • writeMask: GPUColorWriteFlags= 0xF

    GPUBlendState

    • color: GPUBlendComponentrequired
    • alpha: GPUBlendComponentrequired

    GPUBlendComponent

    • operation: GPUBlendOperation= 'add'
    • srcFactor: GPUBlendFactor= 'one'
    • dstFactor: GPUBlendFactor= 'zero'

    GPUBlendOperation

    'add', 'subtract', 'reverse-subtract', 'min', 'max'

    GPUBlendFactor

    'zero', 'one', 'src', 'one-minus-src', 'src-alpha', 'one-minus-src-alpha', 'dst', 'one-minus-dst', 'dst-alpha', 'one-minus-dst-alpha', 'src-alpha-saturated', 'constant', 'one-minus-constant'

    GPUColorWriteFlags

  • createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise<GPUComputePipeline>

    GPUComputePipelineDescriptor

    • label: USVString
    • layout: GPUPipelineLayout | GPUAutoLayoutModerequired
    • compute: GPUProgrammableStagerequired

    GPUPipelineLayout

    • label: USVString

    GPUAutoLayoutMode

    'auto'

    GPUProgrammableStage

    • module: GPUShaderModulerequired
    • entryPoint: USVStringrequired
    • constants: record<USVString, GPUPipelineConstantValue>

    GPUPipelineConstantValue

    typedef GPUPipelineConstantValue = double
  • createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>

    GPURenderPipelineDescriptor

    • label: USVString
    • layout: GPUPipelineLayout | GPUAutoLayoutModerequired
    • vertex: GPUVertexStaterequired
    • primitive: GPUPrimitiveState= { … }
    • depthStencil: GPUDepthStencilState
    • multisample: GPUMultisampleState= { … }
    • fragment: GPUFragmentState

    GPUPipelineLayout

    • label: USVString

    GPUAutoLayoutMode

    'auto'

    GPUVertexState

    • module: GPUShaderModulerequired
    • entryPoint: USVStringrequired
    • constants: record<USVString, GPUPipelineConstantValue>
    • buffers: sequence<GPUVertexBufferLayout>= []

    GPUPipelineConstantValue

    typedef GPUPipelineConstantValue = double

    GPUVertexBufferLayout

    • arrayStride: GPUSize64required
    • stepMode: GPUVertexStepMode= 'vertex'
    • attributes: sequence<GPUVertexAttribute>required

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUVertexStepMode

    'vertex', 'instance'

    GPUVertexAttribute

    • format: GPUVertexFormatrequired
    • offset: GPUSize64required
    • shaderLocation: GPUIndex32required

    GPUVertexFormat

    'uint8x2', 'uint8x4', 'sint8x2', 'sint8x4', 'unorm8x2', 'unorm8x4', 'snorm8x2', 'snorm8x4', 'uint16x2', 'uint16x4', 'sint16x2', 'sint16x4', 'unorm16x2', 'unorm16x4', 'snorm16x2', 'snorm16x4', 'float16x2', 'float16x4', 'float32', 'float32x2', 'float32x3', 'float32x4', 'uint32', 'uint32x2', 'uint32x3', 'uint32x4', 'sint32', 'sint32x2', 'sint32x3', 'sint32x4'

    GPUIndex32

    typedef GPUIndex32 = unsigned long

    GPUPrimitiveState

    • topology: GPUPrimitiveTopology= 'triangle-list'
    • stripIndexFormat: GPUIndexFormat
    • frontFace: GPUFrontFace= 'ccw'
    • cullMode: GPUCullMode= 'none'
    • unclippedDepth: boolean

    GPUPrimitiveTopology

    'point-list', 'line-list', 'line-strip', 'triangle-list', 'triangle-strip'

    GPUIndexFormat

    'uint16', 'uint32'

    GPUFrontFace

    'ccw', 'cw'

    GPUCullMode

    'none', 'front', 'back'

    GPUDepthStencilState

    • format: GPUTextureFormatrequired
    • depthWriteEnabled: boolean
    • depthCompare: GPUCompareFunction= 'always'
    • stencilFront: GPUStencilFaceState= { … }
    • stencilBack: GPUStencilFaceState= { … }
    • stencilReadMask: GPUStencilValue= 0xFFFFFFFF
    • stencilWriteMask: GPUStencilValue= 0xFFFFFFFF
    • depthBias: GPUDepthBias= 0
    • depthBiasSlopeScale: float= 0
    • depthBiasClamp: float= 0

    GPUTextureFormat

    'r8unorm', 'r8snorm', 'r8uint', 'r8sint', 'r16uint', 'r16sint', 'r16float', 'rg8unorm', 'rg8snorm', 'rg8uint', 'rg8sint', 'r32uint', 'r32sint', 'r32float', 'rg16uint', 'rg16sint', 'rg16float', 'rgba8unorm', 'rgba8unorm-srgb', 'rgba8snorm', 'rgba8uint', 'rgba8sint', 'bgra8unorm', 'bgra8unorm-srgb', 'rgb9e5ufloat', 'rgb10a2unorm', 'rg11b10ufloat', 'rg32uint', 'rg32sint', 'rg32float', 'rgba16uint', 'rgba16sint', 'rgba16float', 'rgba32uint', 'rgba32sint', 'rgba32float', 'stencil8', 'depth16unorm', 'depth24plus', 'depth24plus-stencil8', 'depth32float', 'depth32float-stencil8', 'bc1-rgba-unorm', 'bc1-rgba-unorm-srgb', 'bc2-rgba-unorm', 'bc2-rgba-unorm-srgb', 'bc3-rgba-unorm', 'bc3-rgba-unorm-srgb', 'bc4-r-unorm', 'bc4-r-snorm', 'bc5-rg-unorm', 'bc5-rg-snorm', 'bc6h-rgb-ufloat', 'bc6h-rgb-float', 'bc7-rgba-unorm', 'bc7-rgba-unorm-srgb', 'etc2-rgb8unorm', 'etc2-rgb8unorm-srgb', 'etc2-rgb8a1unorm', 'etc2-rgb8a1unorm-srgb', 'etc2-rgba8unorm', 'etc2-rgba8unorm-srgb', 'eac-r11unorm', 'eac-r11snorm', 'eac-rg11unorm', 'eac-rg11snorm', 'astc-4x4-unorm', 'astc-4x4-unorm-srgb', 'astc-5x4-unorm', 'astc-5x4-unorm-srgb', 'astc-5x5-unorm', 'astc-5x5-unorm-srgb', 'astc-6x5-unorm', 'astc-6x5-unorm-srgb', 'astc-6x6-unorm', 'astc-6x6-unorm-srgb', 'astc-8x5-unorm', 'astc-8x5-unorm-srgb', 'astc-8x6-unorm', 'astc-8x6-unorm-srgb', 'astc-8x8-unorm', 'astc-8x8-unorm-srgb', 'astc-10x5-unorm', 'astc-10x5-unorm-srgb', 'astc-10x6-unorm', 'astc-10x6-unorm-srgb', 'astc-10x8-unorm', 'astc-10x8-unorm-srgb', 'astc-10x10-unorm', 'astc-10x10-unorm-srgb', 'astc-12x10-unorm', 'astc-12x10-unorm-srgb', 'astc-12x12-unorm', 'astc-12x12-unorm-srgb'

    GPUCompareFunction

    'never', 'less', 'equal', 'less-equal', 'greater', 'not-equal', 'greater-equal', 'always'

    GPUStencilFaceState

    • compare: GPUCompareFunction= 'always'
    • failOp: GPUStencilOperation= 'keep'
    • depthFailOp: GPUStencilOperation= 'keep'
    • passOp: GPUStencilOperation= 'keep'

    GPUStencilOperation

    'keep', 'zero', 'replace', 'invert', 'increment-clamp', 'decrement-clamp', 'increment-wrap', 'decrement-wrap'

    GPUStencilValue

    typedef GPUStencilValue = unsigned long

    GPUDepthBias

    typedef GPUDepthBias = long

    GPUMultisampleState

    • count: GPUSize32= 1
    • mask: GPUSampleMask= 0xFFFFFFFF
    • alphaToCoverageEnabled: boolean

    GPUSize32

    typedef GPUSize32 = unsigned long

    GPUSampleMask

    typedef GPUSampleMask = unsigned long

    GPUFragmentState

    • module: GPUShaderModulerequired
    • entryPoint: USVStringrequired
    • constants: record<USVString, GPUPipelineConstantValue>
    • targets: sequence<GPUColorTargetState>required

    GPUColorTargetState

    • format: GPUTextureFormatrequired
    • blend: GPUBlendState
    • writeMask: GPUColorWriteFlags= 0xF

    GPUBlendState

    • color: GPUBlendComponentrequired
    • alpha: GPUBlendComponentrequired

    GPUBlendComponent

    • operation: GPUBlendOperation= 'add'
    • srcFactor: GPUBlendFactor= 'one'
    • dstFactor: GPUBlendFactor= 'zero'

    GPUBlendOperation

    'add', 'subtract', 'reverse-subtract', 'min', 'max'

    GPUBlendFactor

    'zero', 'one', 'src', 'one-minus-src', 'src-alpha', 'one-minus-src-alpha', 'dst', 'one-minus-dst', 'dst-alpha', 'one-minus-dst-alpha', 'src-alpha-saturated', 'constant', 'one-minus-constant'

    GPUColorWriteFlags

  • createCommandEncoder(descriptor: GPUCommandEncoderDescriptor): GPUCommandEncoder

    GPUCommandEncoderDescriptor

    • label: USVString
  • createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder

    GPURenderBundleEncoderDescriptor

    • label: USVString
    • colorFormats: sequence<GPUTextureFormat>required
    • depthStencilFormat: GPUTextureFormat
    • sampleCount: GPUSize32= 1
    • depthReadOnly: boolean
    • stencilReadOnly: boolean

    GPUTextureFormat

    'r8unorm', 'r8snorm', 'r8uint', 'r8sint', 'r16uint', 'r16sint', 'r16float', 'rg8unorm', 'rg8snorm', 'rg8uint', 'rg8sint', 'r32uint', 'r32sint', 'r32float', 'rg16uint', 'rg16sint', 'rg16float', 'rgba8unorm', 'rgba8unorm-srgb', 'rgba8snorm', 'rgba8uint', 'rgba8sint', 'bgra8unorm', 'bgra8unorm-srgb', 'rgb9e5ufloat', 'rgb10a2unorm', 'rg11b10ufloat', 'rg32uint', 'rg32sint', 'rg32float', 'rgba16uint', 'rgba16sint', 'rgba16float', 'rgba32uint', 'rgba32sint', 'rgba32float', 'stencil8', 'depth16unorm', 'depth24plus', 'depth24plus-stencil8', 'depth32float', 'depth32float-stencil8', 'bc1-rgba-unorm', 'bc1-rgba-unorm-srgb', 'bc2-rgba-unorm', 'bc2-rgba-unorm-srgb', 'bc3-rgba-unorm', 'bc3-rgba-unorm-srgb', 'bc4-r-unorm', 'bc4-r-snorm', 'bc5-rg-unorm', 'bc5-rg-snorm', 'bc6h-rgb-ufloat', 'bc6h-rgb-float', 'bc7-rgba-unorm', 'bc7-rgba-unorm-srgb', 'etc2-rgb8unorm', 'etc2-rgb8unorm-srgb', 'etc2-rgb8a1unorm', 'etc2-rgb8a1unorm-srgb', 'etc2-rgba8unorm', 'etc2-rgba8unorm-srgb', 'eac-r11unorm', 'eac-r11snorm', 'eac-rg11unorm', 'eac-rg11snorm', 'astc-4x4-unorm', 'astc-4x4-unorm-srgb', 'astc-5x4-unorm', 'astc-5x4-unorm-srgb', 'astc-5x5-unorm', 'astc-5x5-unorm-srgb', 'astc-6x5-unorm', 'astc-6x5-unorm-srgb', 'astc-6x6-unorm', 'astc-6x6-unorm-srgb', 'astc-8x5-unorm', 'astc-8x5-unorm-srgb', 'astc-8x6-unorm', 'astc-8x6-unorm-srgb', 'astc-8x8-unorm', 'astc-8x8-unorm-srgb', 'astc-10x5-unorm', 'astc-10x5-unorm-srgb', 'astc-10x6-unorm', 'astc-10x6-unorm-srgb', 'astc-10x8-unorm', 'astc-10x8-unorm-srgb', 'astc-10x10-unorm', 'astc-10x10-unorm-srgb', 'astc-12x10-unorm', 'astc-12x10-unorm-srgb', 'astc-12x12-unorm', 'astc-12x12-unorm-srgb'

    GPUSize32

    typedef GPUSize32 = unsigned long
  • createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet

    GPUQuerySetDescriptor

    • label: USVString
    • type: GPUQueryTyperequired
    • count: GPUSize32required

    GPUQueryType

    'occlusion', 'timestamp'

    GPUSize32

    typedef GPUSize32 = unsigned long
  • pushErrorScope(filter: GPUErrorFilter): void

    GPUErrorFilter

    'out-of-memory', 'validation'
  • popErrorScope(): Promise<GPUError>