Skip to content

org.graphiks.webgpu

Types

AndroidArrayBuffer

An Android-specific implementation of the `ArrayBuffer` interface.

ArrayBuffer

expect sealed interface ArrayBuffer
actual interface ArrayBuffer
actual interface ArrayBuffer
actual interface ArrayBuffer
actual interface ArrayBuffer
=== "common" Represents a buffer of raw binary data, which can be used in various WebGPU operations. Provides a mechanism to work directly with raw memory for performance-critical computations or data manipulation when working with GPU resources. === "android" Represents a platform-specific abstraction for handling raw binary data buffers. === "jvm" Represents a platform-specific abstraction for handling raw binary data buffers. === "native" Represents a platform-specific abstraction over raw binary data stored in an ArrayBuffer. === "web" A platform-independent representation of a fixed-length raw binary data buffer.

FlagEnumeration

interface FlagEnumeration
Represents a generic interface for flag-based enumerations where each enumeration is associated with a unique unsigned long integer value.

GPUAdapter

A GPUAdapter encapsulates an adapter, and describes its capabilities (features and limits).

GPUAdapterInfo

interface GPUAdapterInfo
GPUAdapterInfo exposes various identifying information about an adapter.

GPUAddressMode

=== "common" Selects how texture coordinates outside the normalized range are addressed. === "commonNative" Selects how texture coordinates outside the normalized range are addressed. === "web" Selects how texture coordinates outside the normalized range are addressed.

GPUBindGroup

A GPUBindGroup defines a set of resources to be bound together in a group and how the resources are used in shader stages.

GPUBindGroupDescriptor

Describes the layout and resources used to create a GPUBindGroup.

GPUBindGroupEntry

Associates a binding index with the GPU resource supplied for that binding.

GPUBindGroupLayout

A GPUBindGroupLayout defines the interface between a set of resources bound in a GPUBindGroup and their accessibility in shader stages.

GPUBindGroupLayoutDescriptor

Describes the entries that define a GPUBindGroupLayout.

GPUBindGroupLayoutEntry

Describes one binding's index, shader visibility, and resource-specific layout.

GPUBindingCommandsMixin

GPUBindingCommandsMixin assumes the presence of GPUObjectBase and GPUCommandsMixin members on the same object. It must only be included by interfaces which also include those mixins.

GPUBindingResource

sealed interface GPUBindingResource
A resource accepted by a bind group entry, such as a sampler, texture view, buffer binding, or external texture.

GPUBlendComponent

Describes one color or alpha blend component's operation and factors.

GPUBlendFactor

=== "common" Defines the source or destination factor used to scale color and alpha values during blending. === "commonNative" Defines the source or destination factor used to scale color and alpha values during blending. === "web" Defines the source or destination factor used to scale color and alpha values during blending.

GPUBlendOperation

=== "common" Defines the operation used to combine source and destination blend factors. === "commonNative" Defines the operation used to combine source and destination blend factors. === "web" Defines the operation used to combine source and destination blend factors.

GPUBlendState

interface GPUBlendState
Describes the color and alpha blend components applied to a color target.

GPUBuffer

A GPUBuffer represents a block of memory that can be used in GPU operations. Data is stored in linear layout, meaning that each byte of the allocation can be addressed by its offset from the start of the GPUBuffer, subject to alignment restrictions depending on the operation. Some GPUBuffers can be mapped which makes the block of memory accessible via an ArrayBuffer called its mapping.

GPUBufferBinding

A buffer resource and the byte range exposed to a shader through a bind group.

GPUBufferBindingLayout

Describes the type, dynamic-offset behavior, and minimum size of a buffer binding.

GPUBufferBindingType

=== "common" Selects how a buffer binding is accessed by shaders. === "commonNative" Selects how a buffer binding is accessed by shaders. === "web" Selects how a buffer binding is accessed by shaders.

GPUBufferDescriptor

Describes a GPUBuffer's size, usage, and optional mapped-at-creation state.

GPUBufferDynamicOffset

GPUBufferMapState

=== "common" The mapping state of a GPUBuffer: mapped or unmapped. === "commonNative" The mapping state of a GPUBuffer: mapped or unmapped. === "web" The mapping state of a GPUBuffer: mapped or unmapped.

GPUBufferUsage

GPUColor

interface GPUColor
An RGBA color represented by four components.

GPUColorTargetState

Describes the format, write mask, and optional blending for a fragment color target.

GPUColorWrite

@JvmInline
value class GPUColorWrite

GPUCommandBuffer

A recorded sequence of GPU commands ready for submission to a GPUQueue.

GPUCommandBufferDescriptor

Options used when finishing a GPUCommandEncoder to create a GPUCommandBuffer.

GPUCommandEncoder

Encodes render, compute, and copy commands into a command buffer.

GPUCommandEncoderDescriptor

Options used to create a GPUCommandEncoder.

GPUCommandsMixin

interface GPUCommandsMixin
GPUCommandsMixin defines state common to all interfaces which encode commands. It has no methods.

GPUCompareFunction

=== "common" Selects the comparison operation used by depth and stencil tests. === "commonNative" Selects the comparison operation used by depth and stencil tests. === "web" Selects the comparison operation used by depth and stencil tests.

GPUCompilationInfo

Contains the messages produced while compiling a GPUShaderModule.

GPUCompilationMessage

A GPUCompilationMessage is an informational, warning, or error message generated by the GPUShaderModule compiler. The messages are intended to be human readable to help developers diagnose issues with their shader code. Each message may correspond to a single point or range of the shader source, or may be unassociated with any specific part of the code.

GPUCompilationMessageType

=== "common" Classifies a GPUCompilationMessage as an error, warning, or informational message. === "commonNative" Classifies a GPUCompilationMessage as an error, warning, or informational message. === "web" Classifies a GPUCompilationMessage as an error, warning, or informational message.

GPUComputePassDescriptor

Options for beginning a compute pass, including optional timestamp writes.

GPUComputePassEncoder

Encodes compute dispatches and related commands in a compute pass.

GPUComputePassTimestampWrites

Selects query slots for compute-pass beginning and end timestamps.

GPUComputePipeline

A GPUComputePipeline is a kind of pipeline that controls the compute shader stage, and can be used in GPUComputePassEncoder.

GPUComputePipelineDescriptor

Describes the layout and compute shader stage used to create a GPUComputePipeline.

GPUCullMode

expect enum GPUCullMode : Enum<GPUCullMode> 
actual enum GPUCullMode : Enum<GPUCullMode> 
actual enum GPUCullMode : Enum<GPUCullMode> 
=== "common" Selects whether no polygons, front-facing polygons, or back-facing polygons are culled. === "commonNative" Selects whether no polygons, front-facing polygons, or back-facing polygons are culled. === "web" Selects whether no polygons, front-facing polygons, or back-facing polygons are culled.

GPUDebugCommandsMixin

Adds debug marker and debug group commands to command encoders and pass encoders.

GPUDepthBias

typealias GPUDepthBias = Int

GPUDepthStencilState

Describes depth testing, stencil testing, and depth bias for a render pipeline.

GPUDevice

A GPUDevice encapsulates a device and exposes the functionality of that device.

GPUDeviceDescriptor

GPUDeviceDescriptor describes a device request.

GPUDeviceLostInfo

Information resolved by GPUDevice.lost when the device is lost, including the reason and diagnostic message.

GPUDeviceLostReason

=== "common" Indicates why a GPUDevice was lost. === "commonNative" Indicates why a GPUDevice was lost. === "web" Indicates why a GPUDevice was lost.

GPUError

sealed interface GPUError
GPUError is the base interface for all errors surfaced from popErrorScope() and the uncapturederror event.

GPUErrorFilter

=== "common" Selects the error category captured by a GPUDevice error scope. === "commonNative" Selects the error category captured by a GPUDevice error scope. === "web" Selects the error category captured by a GPUDevice error scope.

GPUExtent3D

interface GPUExtent3D
A three-dimensional extent represented by width, height, and depth or array-layer count.

GPUFeatureLevel

=== "common" Selects the minimum capabilities and the default feature level of devices requested from an adapter. === "commonNative" Selects the minimum capabilities and the default feature level of devices requested from an adapter. === "web" Selects the minimum capabilities and the default feature level of devices requested from an adapter.

GPUFeatureName

=== "common" Each GPUFeatureName identifies a set of functionality which, if available, allows additional usages of WebGPU that would have otherwise been invalid. === "commonNative" Each GPUFeatureName identifies a set of functionality which, if available, allows additional usages of WebGPU that would have otherwise been invalid. === "web" Each GPUFeatureName identifies a set of functionality which, if available, allows additional usages of WebGPU that would have otherwise been invalid.

GPUFilterMode

=== "common" Selects the filtering behavior used for minification and magnification sampling. === "commonNative" Selects the filtering behavior used for minification and magnification sampling. === "web" Selects the filtering behavior used for minification and magnification sampling.

GPUFlagsConstant

typealias GPUFlagsConstant = UInt

GPUFragmentState

Describes the fragment shader stage and its color targets.

GPUFrontFace

=== "common" Selects whether clockwise or counter-clockwise polygons are treated as front-facing. === "commonNative" Selects whether clockwise or counter-clockwise polygons are treated as front-facing. === "web" Selects whether clockwise or counter-clockwise polygons are treated as front-facing.

GPUIndex32

typealias GPUIndex32 = UInt

GPUIndexFormat

=== "common" The index format determines both the data type of index values in a buffer and, when used with strip primitive topologies ("line-strip" or "triangle-strip") also specifies the primitive restart value. The primitive restart value indicates which index value indicates that a new primitive should be started rather than continuing to construct the triangle strip with the prior indexed vertices. === "commonNative" The index format determines both the data type of index values in a buffer and, when used with strip primitive topologies ("line-strip" or "triangle-strip") also specifies the primitive restart value. The primitive restart value indicates which index value indicates that a new primitive should be started rather than continuing to construct the triangle strip with the prior indexed vertices. === "web" The index format determines both the data type of index values in a buffer and, when used with strip primitive topologies ("line-strip" or "triangle-strip") also specifies the primitive restart value. The primitive restart value indicates which index value indicates that a new primitive should be started rather than continuing to construct the triangle strip with the prior indexed vertices.

GPUIntegerCoordinate

GPUIntegerCoordinateOut

GPUInternalError

GPUInternalError is a subtype of GPUError which indicates than an operation failed for a system or implementation-specific reason even when all validation requirements have been satisfied. For example, the operation may exceed the capabilities of the implementation in a way not easily captured by the supported limits. The same operation may succeed on other devices or under difference circumstances.

GPULoadOp

expect enum GPULoadOp : Enum<GPULoadOp> 
actual enum GPULoadOp : Enum<GPULoadOp> 
actual enum GPULoadOp : Enum<GPULoadOp> 
=== "common" Selects whether a render pass clears an attachment or loads its existing contents. === "commonNative" Selects whether a render pass clears an attachment or loads its existing contents. === "web" Selects whether a render pass clears an attachment or loads its existing contents.

GPUMapMode

@JvmInline
value class GPUMapMode

GPUMipmapFilterMode

=== "common" Selects how samples are filtered between mip levels. === "commonNative" Selects how samples are filtered between mip levels. === "web" Selects how samples are filtered between mip levels.

GPUMultisampleState

Describes sample count, sample mask, and alpha-to-coverage behavior.

GPUObjectBase

interface GPUObjectBase
Common properties included by WebGPU objects. Its label can identify the object in diagnostics and developer tools.

GPUObjectDescriptorBase

Common label field shared by descriptors that create WebGPU objects.

GPUOrigin2D

interface GPUOrigin2D
A two-dimensional origin represented by x and y coordinates.

GPUOrigin3D

interface GPUOrigin3D
A three-dimensional origin represented by x, y, and z coordinates.

GPUOutOfMemoryError

GPUOutOfMemoryError is a subtype of GPUError which indicates that there was not enough free memory to complete the requested operation. The operation may succeed if attempted again with a lower memory requirement (like using smaller texture dimensions), or if memory used by other resources is released first.

GPUPipelineBase

interface GPUPipelineBase
Common base for GPU pipelines, including access to bind group layouts.

GPUPipelineConstantValue

GPUPipelineDescriptorBase

Common label field shared by render and compute pipeline descriptors.

GPUPipelineLayout

A GPUPipelineLayout defines the mapping between resources of all GPUBindGroup objects set up during command encoding in setBindGroup(), and the shaders of the pipeline set by GPURenderCommandsMixin.setPipeline or GPUComputePassEncoder.setPipeline.

GPUPipelineLayoutDescriptor

Lists the GPUBindGroupLayouts used by a pipeline.

GPUPowerPreference

=== "common" Hints whether adapter selection should favor lower power use or higher performance. === "commonNative" Hints whether adapter selection should favor lower power use or higher performance. === "web" Hints whether adapter selection should favor lower power use or higher performance.

GPUPrimitiveState

Describes primitive topology, strip format, front face, and culling for a render pipeline.

GPUPrimitiveTopology

=== "common" Selects how vertex data is assembled into points, lines, or triangles. === "commonNative" Selects how vertex data is assembled into points, lines, or triangles. === "web" Selects how vertex data is assembled into points, lines, or triangles.

GPUProgrammableStage

A GPUProgrammableStage describes the entry point in the user-provided GPUShaderModule that controls one of the programmable stages of a pipeline. Entry point names follow the rules defined in WGSL identifier comparison.

GPUQuerySet

Stores the results of a configured kind and count of GPU queries.

GPUQuerySetDescriptor

Describes the query type and number of queries in a GPUQuerySet.

GPUQueryType

=== "common" Selects the kind of result recorded by a GPUQuerySet. === "commonNative" Selects the kind of result recorded by a GPUQuerySet. === "web" Selects the kind of result recorded by a GPUQuerySet.

GPUQueue

interface GPUQueue : GPUObjectBase
Submits command buffers and schedules writes and copies for execution by the GPUDevice.

GPUQueueDescriptor

GPUQueueDescriptor describes a queue request.

GPURenderBundle

A reusable sequence of render commands created by a GPUDevice.

GPURenderBundleDescriptor

Options used when finishing a GPURenderBundleEncoder to create a GPURenderBundle.

GPURenderBundleEncoder

GPURenderBundleEncoderDescriptor

Options used to create a GPURenderBundleEncoder.

GPURenderCommandsMixin

GPURenderCommandsMixin defines rendering commands common to GPURenderPassEncoder and GPURenderBundleEncoder.

GPURenderPassColorAttachment

Describes a color attachment and its load, store, and resolve operations for a render pass.

GPURenderPassDepthStencilAttachment

Describes the depth and stencil operations for a render pass attachment.

GPURenderPassDescriptor

Describes the color, depth/stencil, and optional timestamp attachments for a render pass.

GPURenderPassEncoder

When executing encoded render pass commands as part of a GPUCommandBuffer, an internal RenderState object is used to track the current state required for rendering.

GPURenderPassLayout

Describes the attachment formats and sample count used by a render pass or render bundle.

GPURenderPassTimestampWrites

Selects query slots for render-pass beginning, end, and optional per-stage timestamps.

GPURenderPipeline

A GPURenderPipeline is a kind of pipeline that controls the vertex and fragment shader stages, and can be used in GPURenderPassEncoder as well as GPURenderBundleEncoder.

GPURenderPipelineDescriptor

Describes the layout and programmable stages and fixed-function state of a GPURenderPipeline.

GPURequestAdapterOptions

Options that constrain which GPU adapter is selected.

GPURequiredLimits

GPUSampleMask

typealias GPUSampleMask = UInt

GPUSampler

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

GPUSamplerBindingLayout

Describes the sampler binding type expected by a shader.

GPUSamplerBindingType

=== "common" Selects the sampling operations supported by a sampler binding. === "commonNative" Selects the sampling operations supported by a sampler binding. === "web" Selects the sampling operations supported by a sampler binding.

GPUSamplerDescriptor

Describes the address modes, filtering modes, and level-of-detail limits for a GPUSampler.

GPUShaderModule

Contains shader code compiled for use in GPU pipelines.

GPUShaderModuleCompilationHint

A hint associating a shader entry point with the pipeline layout expected to use it.

GPUShaderModuleDescriptor

Describes the shader code and compilation options used to create a GPUShaderModule.

GPUShaderStage

GPUSignedOffset32

typealias GPUSignedOffset32 = Int

GPUSize32

typealias GPUSize32 = UInt

GPUSize32Out

typealias GPUSize32Out = UInt

GPUSize64

typealias GPUSize64 = ULong

GPUSize64Out

typealias GPUSize64Out = ULong

GPUStencilFaceState

Describes stencil comparison and the operations applied to a stencil face.

GPUStencilOperation

=== "common" Selects the operation applied to stencil values when a stencil test succeeds or fails. === "commonNative" Selects the operation applied to stencil values when a stencil test succeeds or fails. === "web" Selects the operation applied to stencil values when a stencil test succeeds or fails.

GPUStencilValue

typealias GPUStencilValue = UInt

GPUStorageTextureAccess

=== "common" Selects how a storage texture binding may be accessed by shaders. === "commonNative" Selects how a storage texture binding may be accessed by shaders. === "web" Selects how a storage texture binding may be accessed by shaders.

GPUStorageTextureBindingLayout

Describes the access mode, format, and view dimension of a storage texture binding.

GPUStoreOp

expect enum GPUStoreOp : Enum<GPUStoreOp> 
actual enum GPUStoreOp : Enum<GPUStoreOp> 
actual enum GPUStoreOp : Enum<GPUStoreOp> 
=== "common" Selects whether a render pass stores or discards an attachment's contents when the pass ends. === "commonNative" Selects whether a render pass stores or discards an attachment's contents when the pass ends. === "web" Selects whether a render pass stores or discards an attachment's contents when the pass ends.

GPUSupportedFeatures

GPUSupportedLimits

GPUSupportedLimits exposes an adapter or device’s supported limits. See GPUAdapter.limits and GPUDevice.limits.

GPUTexelCopyBufferInfo

"GPUTexelCopyBufferInfo" describes the "info" (GPUBuffer and GPUTexelCopyBufferLayout) about a "buffer" source or destination of a "texel copy" operation. Together with the copySize, it describes the footprint of a region of texels in a GPUBuffer.

GPUTexelCopyBufferLayout

"GPUTexelCopyBufferLayout" describes the "layout" of texels in a "buffer" of bytes (GPUBuffer or AllowSharedBufferSource) in a "texel copy" operation.

GPUTexelCopyTextureInfo

"GPUTexelCopyTextureInfo" describes the "info" (GPUTexture, etc.) about a "texture" source or destination of a "texel copy" operation. Together with the copySize, it describes a sub-region of a texture (spanning one or more contiguous texture subresources at the same mip-map level).

GPUTexture

A texture is made up of 1d, 2d, or 3d arrays of data which can contain multiple values per-element to represent things like colors. Textures can be read and written in many ways, depending on the GPUTextureUsage they are created with. For example, textures can be sampled, read, and written from render and compute pipeline shaders, and they can be written by render pass outputs. Internally, textures are often stored in GPU memory with a layout optimized for multidimensional access rather than linear access.

GPUTextureAspect

=== "common" Selects which aspect of a texture is addressed, such as color, depth, stencil, or all aspects. === "commonNative" Selects which aspect of a texture is addressed, such as color, depth, stencil, or all aspects. === "web" Selects which aspect of a texture is addressed, such as color, depth, stencil, or all aspects.

GPUTextureBindingLayout

Describes the sample type, view dimension, and multisampling of a texture binding.

GPUTextureDescriptor

Describes a GPUTexture's size, format, usage, and optional view formats.

GPUTextureDimension

=== "common" Selects the dimensionality of a GPUTexture: 1D, 2D, or 3D. === "commonNative" Selects the dimensionality of a GPUTexture: 1D, 2D, or 3D. === "web" Selects the dimensionality of a GPUTexture: 1D, 2D, or 3D.

GPUTextureFormat

=== "common" Selects the texel representation and sampling or attachment capabilities of a GPUTexture. === "commonNative" Selects the texel representation and sampling or attachment capabilities of a GPUTexture. === "web" Selects the texel representation and sampling or attachment capabilities of a GPUTexture.

GPUTextureOrGPUTextureView

sealed interface GPUTextureOrGPUTextureView
A value that is either a GPUTexture or a GPUTextureView.

GPUTextureSampleType

=== "common" Selects the value type produced when sampling a texture binding. === "commonNative" Selects the value type produced when sampling a texture binding. === "web" Selects the value type produced when sampling a texture binding.

GPUTextureSwizzle

data class GPUTextureSwizzle(
    val red: GPUTextureSwizzleSource = GPUTextureSwizzleSource.Red, 
    val green: GPUTextureSwizzleSource = GPUTextureSwizzleSource.Green, 
    val blue: GPUTextureSwizzleSource = GPUTextureSwizzleSource.Blue, 
    val alpha: GPUTextureSwizzleSource = GPUTextureSwizzleSource.Alpha
)
Maps each output channel to a component of the texture view.

GPUTextureSwizzleSource

A source component used to construct one output channel of a texture view.

GPUTextureUsage

GPUTextureView

A GPUTextureView is a view onto some subset of the texture subresources defined by a particular GPUTexture.

GPUTextureViewDescriptor

Describes the format, dimension, mip levels, array layers, and aspect of a GPUTextureView.

GPUTextureViewDimension

=== "common" Selects the dimensionality and array form of a GPUTextureView. === "commonNative" Selects the dimensionality and array form of a GPUTextureView. === "web" Selects the dimensionality and array form of a GPUTextureView.

GPUUncapturedErrorCallback

Callback invoked when a GPUDevice reports an error that is not captured by an error scope.

GPUValidationError

GPUValidationError is a subtype of GPUError which indicates that an operation did not satisfy all validation requirements. Validation errors are always indicative of an application error, and is expected to fail the same way across all devices assuming the same [features] and [limits] are in use.

GPUVertexAttribute

Describes one vertex attribute's format and byte offset in a vertex buffer.

GPUVertexBufferLayout

Describes the stride, step mode, and attributes of a vertex buffer.

GPUVertexFormat

=== "common" Selects the scalar type, component count, and layout of a vertex attribute. === "commonNative" Selects the scalar type, component count, and layout of a vertex attribute. === "web" Selects the scalar type, component count, and layout of a vertex attribute.

GPUVertexState

Describes the vertex shader stage and vertex buffer layouts for a render pipeline.

GPUVertexStepMode

=== "common" Selects whether a vertex buffer advances once per vertex or once per instance. === "commonNative" Selects whether a vertex buffer advances once per vertex or once per instance. === "web" Selects whether a vertex buffer advances once per vertex or once per instance.

JvmArrayBuffer

A JVM-specific implementation of the `ArrayBuffer` interface.

OpaquePointerArrayBuffer

Represents a native array buffer backed by an opaque C pointer, providing direct access to unmanaged memory for efficient interop with native C libraries.

WebArrayBuffer

A Kotlin/JS value class that serves as a wrapper for the JavaScript `ArrayBuffer`.

Functions

toFlagInt

Converts a set of `FlagEnumeration` instances into a single integer representing the combined bitwise value.

toFlagULong

Converts a Set of FlagEnumeration elements into a ULong bitmask, combining their values using bitwise OR operations.