Selva Compute API Reference - v1.1.2
    Preparing search index...

    Interface GPUTextureViewDescriptor

    interface GPUTextureViewDescriptor {
        arrayLayerCount?: number;
        aspect?: GPUTextureAspect;
        baseArrayLayer?: number;
        baseMipLevel?: number;
        dimension?: GPUTextureViewDimension;
        format?: GPUTextureFormat;
        label?: string;
        mipLevelCount?: number;
        swizzle?: string;
        usage?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    arrayLayerCount?: number

    How many array layers, starting with GPUTextureViewDescriptor#baseArrayLayer, are accessible to the texture view.

    Which aspect(s) of the texture are accessible to the texture view.

    baseArrayLayer?: number

    The index of the first array layer accessible to the texture view.

    baseMipLevel?: number

    The first (most detailed) mipmap level accessible to the texture view.

    The dimension to view the texture as.

    The format of the texture view. Must be either the GPUTextureDescriptor#format of the texture or one of the GPUTextureDescriptor#viewFormats specified during its creation.

    label?: string

    The initial value of GPUObjectBase.label.

    mipLevelCount?: number

    How many mipmap levels, starting with GPUTextureViewDescriptor#baseMipLevel, are accessible to the texture view.

    swizzle?: string

    A string of length four, with each character mapping to the texture view's red/green/blue/alpha channels, respectively. When accessed by a shader, the red/green/blue/alpha channels are replaced by the value corresponding to the component specified in swizzle[0], swizzle[1], swizzle[2], and swizzle[3], respectively:

    • "r": Take its value from the red channel of the texture.
    • "g": Take its value from the green channel of the texture.
    • "b": Take its value from the blue channel of the texture.
    • "a": Take its value from the alpha channel of the texture.
    • "0": Force its value to 0.
    • "1": Force its value to 1. Requires the GPUFeatureName "texture-component-swizzle" feature to be enabled.
    usage?: number

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