bindSet method
- BindingSet bindingSet, {
- int slot = 0,
Binds every resource in bindingSet for subsequent draws, replacing
whatever set was bound to slot.
This is O(1) regardless of how many resources the set holds, because the set already resolved them against shader reflection when it was created.
Set bindings are applied before individual bindUniform and bindTexture calls, so an individual bind to the same shader binding overrides the set's. Where two bound sets declare the same binding, the higher slot wins. clearBindings empties every slot.
slot must be in [0, maxBindingSets).
Implementation
void bindSet(BindingSet bindingSet, {int slot = 0}) {
if (slot < 0 || slot >= maxBindingSets) {
throw RangeError.range(
slot,
0,
maxBindingSets - 1,
'slot',
'bindSet slot must be in [0, $maxBindingSets)',
);
}
bindingSet._syncReloadEpoch();
_bindSet(bindingSet, slot);
}