setTexture method
Set a Texture at the given key.
Implementation
void setTexture(String key, Texture texture) {
final binding = switch (_bindings.putIfAbsent(
key,
() => _TextureBinding(_slots[key]!, texture),
)) {
final _TextureBinding binding => binding,
_ => throw StateError('Slot "$key" is a uniform block, not a sampler'),
};
binding.resource = texture;
}