Package-level declarations

Types

Link copied to clipboard
expect class Adapter : AutoCloseable

The GPUAdapter interface of the WebGPU API represents a GPU adapter. From this you can request a Device, adapter info, features, and limits.

actual class Adapter : AutoCloseable
actual class Adapter : AutoCloseable
actual class Adapter : AutoCloseable
Link copied to clipboard
expect enum AdapterType : Enum<AdapterType>
actual enum AdapterType : Enum<AdapterType>
actual enum AdapterType : Enum<AdapterType>
Link copied to clipboard
expect enum AddressMode : Enum<AddressMode>
actual enum AddressMode : Enum<AddressMode>
actual enum AddressMode : Enum<AddressMode>
Link copied to clipboard
expect enum BackendType : Enum<BackendType>
actual enum BackendType : Enum<BackendType>
actual enum BackendType : Enum<BackendType>
Link copied to clipboard
expect class BindGroup : AutoCloseable
actual class BindGroup : AutoCloseable
actual class BindGroup : AutoCloseable
actual class BindGroup : AutoCloseable
Link copied to clipboard
data class BindGroupDescriptor(val layout: BindGroupLayout, val entries: List<BindGroupDescriptor.BindGroupEntry>, val label: String? = null)
Link copied to clipboard
Link copied to clipboard
data class BindGroupLayoutDescriptor(val entries: List<BindGroupLayoutDescriptor.Entry>, val label: String? = null)
Link copied to clipboard
expect enum BlendFactor : Enum<BlendFactor>
actual enum BlendFactor : Enum<BlendFactor>
actual enum BlendFactor : Enum<BlendFactor>
Link copied to clipboard
Link copied to clipboard
expect class Buffer : AutoCloseable
actual class Buffer : AutoCloseable
actual class Buffer : AutoCloseable
actual class Buffer : AutoCloseable
Link copied to clipboard
Link copied to clipboard
data class BufferDescriptor(val size: GPUSize64, val usage: Set<BufferUsage>, val mappedAtCreation: Boolean = false, val label: String? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class Color(val red: Double, val green: Double, val blue: Double, val alpha: Double)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class CommandEncoderDescriptor(val label: String? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class ComputePassDescriptor(val label: String? = null, val timestampWrites: ComputePassDescriptor.ComputePassTimestampWrites? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class ComputePipelineDescriptor(val compute: ComputePipelineDescriptor.ProgrammableStage, val layout: PipelineLayout? = null, val label: String? = null)
Link copied to clipboard
expect enum CullMode : Enum<CullMode>
actual enum CullMode : Enum<CullMode>
actual enum CullMode : Enum<CullMode>
Link copied to clipboard
expect class Device : AutoCloseable
actual class Device : AutoCloseable
actual class Device : AutoCloseable
actual class Device : AutoCloseable
Link copied to clipboard
data class DeviceDescriptor(val label: String? = null, val requiredFeatures: Set<FeatureName> = setOf(), val requiredLimits: Map<String, GPUSize64> = mapOf(), val defaultQueue: QueueDescriptor = QueueDescriptor())
Link copied to clipboard
Link copied to clipboard
expect sealed interface DrawableHolder
actual interface DrawableHolder
actual interface DrawableHolder
actual interface DrawableHolder
Link copied to clipboard
Link copied to clipboard
expect enum ErrorFilter : Enum<ErrorFilter>
actual enum ErrorFilter : Enum<ErrorFilter>
actual enum ErrorFilter : Enum<ErrorFilter>
Link copied to clipboard
expect enum ErrorType : Enum<ErrorType>
actual enum ErrorType : Enum<ErrorType>
actual enum ErrorType : Enum<ErrorType>
Link copied to clipboard
expect enum FeatureName : Enum<FeatureName>
actual enum FeatureName : Enum<FeatureName>
actual enum FeatureName : Enum<FeatureName>
Link copied to clipboard
expect enum FilterMode : Enum<FilterMode>
actual enum FilterMode : Enum<FilterMode>
actual enum FilterMode : Enum<FilterMode>
Link copied to clipboard
expect enum FrontFace : Enum<FrontFace>
actual enum FrontFace : Enum<FrontFace>
actual enum FrontFace : Enum<FrontFace>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias GPUDepthBias = Int
Link copied to clipboard
Link copied to clipboard
typealias GPUIndex32 = UInt
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias GPUMapModeFlags = Int
Link copied to clipboard
Link copied to clipboard
typealias GPUSampleMask = UInt
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias GPUSize32 = UInt
Link copied to clipboard
typealias GPUSize32Out = UInt
Link copied to clipboard
typealias GPUSize64 = ULong
Link copied to clipboard
typealias GPUStencilValue = UInt
Link copied to clipboard
Link copied to clipboard
data class ImageCopyBuffer(val buffer: Buffer, val offset: GPUSize64, val bytesPerRow: GPUSize32, val rowsPerImage: GPUSize32)
Link copied to clipboard
data class ImageCopyExternalImage(val source: DrawableHolder, val origin: GPUIntegerCoordinates = 0u to 0u, val flipY: Boolean = false)
Link copied to clipboard
data class ImageCopyTexture(val texture: Texture, val mipLevel: GPUIntegerCoordinate, val origin: Origin3D = Origin3D(0u, 0u), val aspect: TextureAspect = TextureAspect.All)
Link copied to clipboard
data class ImageCopyTextureTagged(val colorSpace: PredefinedColorSpace = PredefinedColorSpace.srgb, val premultipliedAlpha: Boolean = false, val texture: Texture, val mipLevel: GPUIntegerCoordinate, val origin: Origin3D = Origin3D(), val aspect: TextureAspect = TextureAspect.All)
Link copied to clipboard
expect enum IndexFormat : Enum<IndexFormat>
actual enum IndexFormat : Enum<IndexFormat>
actual enum IndexFormat : Enum<IndexFormat>
Link copied to clipboard
data class Limits(val maxTextureDimension1D: UInt, val maxTextureDimension2D: UInt, val maxTextureDimension3D: UInt, val maxTextureArrayLayers: UInt, val maxBindGroups: UInt, val maxBindGroupsPlusVertexBuffers: UInt, val maxBindingsPerBindGroup: UInt, val maxDynamicUniformBuffersPerPipelineLayout: UInt, val maxDynamicStorageBuffersPerPipelineLayout: UInt, val maxSampledTexturesPerShaderStage: UInt, val maxSamplersPerShaderStage: UInt, val maxStorageBuffersPerShaderStage: UInt, val maxStorageTexturesPerShaderStage: UInt, val maxUniformBuffersPerShaderStage: UInt, val maxUniformBufferBindingSize: ULong, val maxStorageBufferBindingSize: ULong, val minUniformBufferOffsetAlignment: UInt, val minStorageBufferOffsetAlignment: UInt, val maxVertexBuffers: UInt, val maxBufferSize: ULong, val maxVertexAttributes: UInt, val maxVertexBufferArrayStride: UInt, val maxInterStageShaderVariables: UInt, val maxColorAttachments: UInt, val maxColorAttachmentBytesPerSample: UInt, val maxComputeWorkgroupStorageSize: UInt, val maxComputeInvocationsPerWorkgroup: UInt, val maxComputeWorkgroupSizeX: UInt, val maxComputeWorkgroupSizeY: UInt, val maxComputeWorkgroupSizeZ: UInt, val maxComputeWorkgroupsPerDimension: UInt)
Link copied to clipboard
expect enum LoadOp : Enum<LoadOp>
actual enum LoadOp : Enum<LoadOp>
actual enum LoadOp : Enum<LoadOp>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class NativeSurface(handler: WGPUSurface) : AutoCloseable
Link copied to clipboard
external object navigator
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class PipelineLayoutDescriptor(val bindGroupLayouts: List<BindGroupLayout> = listOf(), val label: String? = null)
Link copied to clipboard
Link copied to clipboard
expect enum PresentMode : Enum<PresentMode>
actual enum PresentMode : Enum<PresentMode>
actual enum PresentMode : Enum<PresentMode>
Link copied to clipboard
Link copied to clipboard
expect class QuerySet
actual class QuerySet
actual class QuerySet
actual class QuerySet
Link copied to clipboard
data class QuerySetDescriptor(val label: String? = null, val type: QueryType, val count: GPUSize32)
Link copied to clipboard
expect enum QueryType : Enum<QueryType>
actual enum QueryType : Enum<QueryType>
actual enum QueryType : Enum<QueryType>
Link copied to clipboard
expect class Queue
actual class Queue
actual class Queue
actual class Queue
Link copied to clipboard
data class QueueDescriptor(val label: String? = null)
Link copied to clipboard
Link copied to clipboard
expect class RenderBundle
actual class RenderBundle
actual class RenderBundle
actual class RenderBundle
Link copied to clipboard
class RenderBundleDescriptor(val label: String? = null)
Link copied to clipboard
Link copied to clipboard
data class RenderBundleEncoderDescriptor(val label: String? = null, val colorFormats: List<TextureFormat>, val depthStencilFormat: TextureFormat, val sampleCount: GPUSize32, val depthReadOnly: Boolean = false, val stencilReadOnly: Boolean = false)
Link copied to clipboard
data class RenderPassDescriptor(val colorAttachments: List<RenderPassDescriptor.ColorAttachment> = listOf(), val depthStencilAttachment: RenderPassDescriptor.DepthStencilAttachment? = null, val occlusionQuerySet: QuerySet? = null, val timestampWrites: RenderPassTimestampWrites? = null, val maxDrawCount: GPUSize64, val label: String? = null)
Link copied to clipboard
expect class RenderPassEncoder
actual class RenderPassEncoder
actual class RenderPassEncoder
actual class RenderPassEncoder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class RenderPipelineDescriptor(val vertex: RenderPipelineDescriptor.VertexState, val label: String? = null, val layout: PipelineLayout? = null, val primitive: RenderPipelineDescriptor.PrimitiveState = PrimitiveState(), val depthStencil: RenderPipelineDescriptor.DepthStencilState? = null, val fragment: RenderPipelineDescriptor.FragmentState? = null, val multisample: RenderPipelineDescriptor.MultisampleState = MultisampleState())
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect class Sampler : AutoCloseable

A GPUSampler encodes transformations and filtering information that can be used in a shader to interpret texture resource data.

actual class Sampler : AutoCloseable
actual class Sampler : AutoCloseable
actual class Sampler : AutoCloseable
Link copied to clipboard
Link copied to clipboard
data class SamplerDescriptor(val addressModeU: AddressMode = AddressMode.ClampToEdge, val addressModeV: AddressMode = AddressMode.ClampToEdge, val addressModeW: AddressMode = AddressMode.ClampToEdge, val magFilter: FilterMode = FilterMode.Nearest, val minFilter: FilterMode = FilterMode.Nearest, val mipmapFilter: MipmapFilterMode = MipmapFilterMode.Nearest, val lodMinClamp: Float = 0.0f, val lodMaxClamp: Float = 32.0f, val compare: CompareFunction? = null, val maxAnisotropy: UShort, val label: String? = null)

A GPUSamplerDescriptor specifies the options to use to create a GPUSampler.

Link copied to clipboard
Link copied to clipboard
data class ShaderModuleDescriptor(val code: String, val label: String? = null, val sourceMap: Any? = null, val compilationHints: List<ShaderModuleDescriptor.CompilationHint> = listOf())
Link copied to clipboard
Link copied to clipboard
data class Size3D(val width: UInt, val height: UInt, val depthOrArrayLayers: UInt)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect enum StoreOp : Enum<StoreOp>
actual enum StoreOp : Enum<StoreOp>
actual enum StoreOp : Enum<StoreOp>
Link copied to clipboard
expect enum SType : Enum<SType>
actual enum SType : Enum<SType>
actual enum SType : Enum<SType>
Link copied to clipboard
data class SupportedLimits(val maxTextureDimension1D: UInt, val maxTextureDimension2D: UInt, val maxTextureDimension3D: UInt, val maxTextureArrayLayers: UInt, val maxBindGroups: UInt, val maxBindGroupsPlusVertexBuffers: UInt, val maxBindingsPerBindGroup: UInt, val maxDynamicUniformBuffersPerPipelineLayout: UInt, val maxDynamicStorageBuffersPerPipelineLayout: UInt, val maxSampledTexturesPerShaderStage: UInt, val maxSamplersPerShaderStage: UInt, val maxStorageBuffersPerShaderStage: UInt, val maxStorageTexturesPerShaderStage: UInt, val maxUniformBuffersPerShaderStage: UInt, val maxUniformBufferBindingSize: ULong, val maxStorageBufferBindingSize: ULong, val minUniformBufferOffsetAlignment: UInt, val minStorageBufferOffsetAlignment: UInt, val maxVertexBuffers: UInt, val maxBufferSize: ULong, val maxVertexAttributes: UInt, val maxVertexBufferArrayStride: UInt, val maxInterStageShaderVariables: UInt, val maxColorAttachments: UInt, val maxColorAttachmentBytesPerSample: UInt, val maxComputeWorkgroupStorageSize: UInt, val maxComputeInvocationsPerWorkgroup: UInt, val maxComputeWorkgroupSizeX: UInt, val maxComputeWorkgroupSizeY: UInt, val maxComputeWorkgroupSizeZ: UInt, val maxComputeWorkgroupsPerDimension: UInt)

The GPUSupportedLimits interface of the WebGPU API describes the limits supported by a Adapter.

Link copied to clipboard
data class SurfaceConfiguration(val device: Device, val format: TextureFormat, val usage: Set<TextureUsage> = setOf(TextureUsage.RenderAttachment), val viewFormats: Set<TextureFormat> = setOf(), val colorSpace: PredefinedColorSpace = PredefinedColorSpace.srgb, val alphaMode: CompositeAlphaMode = CompositeAlphaMode.Opaque, val presentMode: PresentMode = PresentMode.Fifo)
Link copied to clipboard
data class SurfaceTexture(val texture: Texture, val status: SurfaceTextureStatus)
Link copied to clipboard
expect class Texture : AutoCloseable
actual class Texture : AutoCloseable
actual class Texture : AutoCloseable
actual class Texture : AutoCloseable
Link copied to clipboard
Link copied to clipboard
data class TextureDataLayout(val offset: GPUSize64, val bytesPerRow: GPUSize32? = null, val rowsPerImage: GPUSize32? = null)
Link copied to clipboard
data class TextureDescriptor(val size: Size3D, val format: TextureFormat, val usage: Set<TextureUsage>, val mipLevelCount: GPUIntegerCoordinate, val sampleCount: GPUSize32, val dimension: TextureDimension = TextureDimension.TwoD, val viewFormats: List<TextureFormat> = listOf(), val label: String? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect class TextureView : AutoCloseable
actual class TextureView : AutoCloseable
actual class TextureView : AutoCloseable
actual class TextureView : AutoCloseable
Link copied to clipboard
data class TextureViewDescriptor(val label: String? = null, val format: TextureFormat? = null, val dimension: TextureViewDimension? = null, val aspect: TextureAspect = TextureAspect.All, val baseMipLevel: GPUIntegerCoordinate, val mipLevelCount: GPUIntegerCoordinate, val baseArrayLayer: GPUIntegerCoordinate, val arrayLayerCount: GPUIntegerCoordinate)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class WGPU(handler: WGPUInstance) : AutoCloseable
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
getCanvasSurface
Link copied to clipboard
Link copied to clipboard
infix fun Int.or(other: TextureUsage): Int
requestAdapter
Link copied to clipboard
suspend fun requestAdapter(options: GPURequestAdapterOptions? = null): Adapter?
suspend fun requestAdapter(options: GPURequestAdapterOptions? = null): Adapter?
Link copied to clipboard