defaultSampling property

TextureSampling get defaultSampling

The sampling a data texture of this format gets when none is given: TextureSampling.data, with nearest filtering for the 32-bit float formats. Linear filtering of those needs device support (missing on older iOS GPUs and on WebGL2 without OES_texture_float_linear), where it samples black or fails, so it is opt in.

Implementation

TextureSampling get defaultSampling => _is32BitFloat
    ? const TextureSampling(
        mipmaps: false,
        minFilter: gpu.MinMagFilter.nearest,
        magFilter: gpu.MinMagFilter.nearest,
        addressMode: gpu.SamplerAddressMode.clampToEdge,
      )
    : TextureSampling.data;