Aller au contenu

Texture

class Texture : GPUTexture
A WebGPU texture wrapper with an explicit ownership contract. Use [`wrapOwned`](-companion/index.md#wrapowned) for a texture this wrapper is responsible for destroying, and [`wrapBorrowed`](-companion/index.md#wrapborrowed) for a texture owned by someone else (a canvas context, an imported handle): closing a borrowed wrapper never destroys the underlying texture.

Types

Companion

object Companion

Properties

depthOrArrayLayers

open override val depthOrArrayLayers: GPUIntegerCoordinateOut

dimension

open override val dimension: GPUTextureDimension

format

open override val format: GPUTextureFormat

handler

val handler: WGPUTexture
Interop escape hatch: the raw WebGPU handle. Calling operations on it directly can invalidate the wrapper's contract (ownership and close-once semantics).

height

open override val height: GPUIntegerCoordinateOut

label

open override var label: String

mipLevelCount

open override val mipLevelCount: GPUIntegerCoordinateOut

sampleCount

open override val sampleCount: GPUSize32Out

usage

open override val usage: GPUTextureUsage

width

open override val width: GPUIntegerCoordinateOut

Functions

close

open override fun close()

createView

open override fun createView(descriptor: GPUTextureViewDescriptor?): GPUTextureView