GPUSamplerDescriptor.comparison constructor

GPUSamplerDescriptor.comparison({
  1. String addressModeU,
  2. String addressModeV,
  3. String addressModeW,
  4. String magFilter,
  5. String minFilter,
  6. String mipmapFilter,
  7. String compare,
  8. String label,
})

A shadow-map sampler, which is a different kind of object here.

compare is absent or it is a comparison sampler, and there is no third state. Writing compare: null is the same TypeError that GPUColorTargetState documents — an absent dictionary member and an explicit null are different things — and a comparison sampler can only be bound to a sampler_comparison binding, so the two are not interchangeable at the call site either. Two constructors, so the choice is made where the shadow map is set up rather than discovered in a browser.

Implementation

external factory GPUSamplerDescriptor.comparison({
  String addressModeU,
  String addressModeV,
  String addressModeW,
  String magFilter,
  String minFilter,
  String mipmapFilter,
  String compare,
  String label,
});