Skip to content

TextureViewDescriptor

data class TextureViewDescriptor(
    val format: GPUTextureFormat? = null, 
    val dimension: GPUTextureViewDimension? = null, 
    val usage: GPUTextureUsage = GPUTextureUsage.None, 
    val aspect: GPUTextureAspect = GPUTextureAspect.All, 
    val baseMipLevel: GPUIntegerCoordinate, 
    val mipLevelCount: GPUIntegerCoordinate? = null, 
    val baseArrayLayer: GPUIntegerCoordinate, 
    val arrayLayerCount: GPUIntegerCoordinate? = null, 
    val swizzle: GPUTextureSwizzle = GPUTextureSwizzle(), 
    val label: String = ""
) : GPUTextureViewDescriptor
Describes the format, dimension, mip levels, array layers, and aspect of a GPUTextureView.

Constructors

TextureViewDescriptor

constructor(
    format: GPUTextureFormat? = null, 
    dimension: GPUTextureViewDimension? = null, 
    usage: GPUTextureUsage = GPUTextureUsage.None, 
    aspect: GPUTextureAspect = GPUTextureAspect.All, 
    baseMipLevel: GPUIntegerCoordinate, 
    mipLevelCount: GPUIntegerCoordinate? = null, 
    baseArrayLayer: GPUIntegerCoordinate, 
    arrayLayerCount: GPUIntegerCoordinate? = null, 
    swizzle: GPUTextureSwizzle = GPUTextureSwizzle(), 
    label: String = ""
)

Properties

arrayLayerCount

open override val arrayLayerCount: GPUIntegerCoordinate?
How many array layers, starting with baseArrayLayer, are accessible to the texture view.

aspect

open override val aspect: GPUTextureAspect
Which aspect(s) of the texture are accessible to the texture view.

baseArrayLayer

open override val baseArrayLayer: GPUIntegerCoordinate
The index of the first array layer accessible to the texture view.

baseMipLevel

open override val baseMipLevel: GPUIntegerCoordinate
The first (most detailed) mipmap level accessible to the texture view.

dimension

open override val dimension: GPUTextureViewDimension?
The dimension to view the texture as. See [GPUTextureViewDescriptor.dimension in the WebGPU specification](https://www.w3.org/TR/webgpu/#dom-gputextureviewdescriptor-dimension).

format

open override val format: GPUTextureFormat?
The format of the texture view. Must be either the format of the texture or one of the viewFormats specified during its creation.

label

open override val label: String

mipLevelCount

open override val mipLevelCount: GPUIntegerCoordinate?
How many mipmap levels, starting with baseMipLevel, are accessible to the texture view.

swizzle

open override val swizzle: GPUTextureSwizzle
A string of length four, with each character mapping to the texture view’s red/green/blue/alpha channels, respectively. "r": Take its value from the red channel of the texture.

usage

open override val usage: GPUTextureUsage
The allowed usage(s) for the texture view. Must be a subset of the usage flags of the texture. If 0, defaults to the full set of usage flags of the texture. Note: If the view’s format doesn’t support all of the texture’s usages, the default will fail, and the view’s usage must be specified explicitly.