releaseSampler method

  1. @override
void releaseSampler(
  1. SamplerDescriptor sampler
)
override

Gives back what this device made to sample with sampler, if it made anything.

A sampler is a value here, not a handle: a SamplerDescriptor is handed to every bind, and has nothing of its own to dispose. A backend whose API wants an object for it makes one per distinct description and keeps it — WebGPU a GPUSampler, Impeller a SamplerOptions — and this drops that one, so a tool that swept through many anisotropy levels or level clamps does not keep every one for the device's life. The next bind of an equal description makes it again. A draw already encoded keeps what it was bound with.

Does nothing by default, which is the whole of it on a backend that samples by value (WebGL2 sets the texture's parameters at each bind; the software rasteriser reads the description itself).

Implementation

@override
void releaseSampler(SamplerDescriptor sampler) =>
    inner.releaseSampler(sampler);