Interface SPDPassConfig

interface SPDPassConfig {
    filter?: string;
    halfPrecision?: boolean;
    numMips?: number;
    offset?: [number, number];
    size?: [number, number];
    target?: GPUTexture;
}

Properties

filter?: string

The name of the filter to use for downsampling the given texture. Should be one of the filters registered with WebGPUSinglePassDownsampler. Defaults to SPDFilters.Average.

halfPrecision?: boolean

If set to true, will try to use half-precision floats (f16) for this combination of texture format and filters. Falls back to full precision, if half precision is requested but not supported by the device (feature 'shader-f16' not enabled). Falls back to full precision, if the texture format is not a float format. Defaults to false.

numMips?: number

The number of mipmaps to generate. Defaults to target.mipLevelCount.

offset?: [number, number]

The upper left corner of the image region mipmaps should be generated for. Defaults to [0,0].

size?: [number, number]

The size of the image reagion mipmaps should be generated for. Default to [texture.width - 1 - offset[0], texture.height - 1 - offset[1]].

target?: GPUTexture

The target texture the generated mipmaps are written to. Its usage must include GPUTextureUsage.STORAGE_BINDING. Its format must support GPUStorageTextureAccess:"write-only". Its size must be big enough to store the first mip level generated for the input texture. It must support generating a GPUTextureView with GPUTextureViewDimension:"2d-array". Defaults to the given input texture.