bindStorageBuffer method

  1. @override
bool bindStorageBuffer(
  1. ShaderHandle shader,
  2. String name,
  3. StorageBuffer buffer, {
  4. int offsetInBytes = 0,
  5. int? sizeInBytes,
})
override

Binds buffer (a range of it, as ComputeEncoder.bindStorageBuffer does) to the storage binding name of a render stage — DeviceFeature.renderStageStorage. False when the stage declares no such binding.

StageBindings carries no storage declarations yet (a later minor may add them as a binding kind). A backend that reflects its stages answers from that reflection; one that does not answers true, for the reason bindUniformBlock gives, or from what its own stages say they read.

Implementation

@override
bool bindStorageBuffer(
  ShaderHandle shader,
  String name,
  StorageBuffer buffer, {
  int offsetInBytes = 0,
  int? sizeInBytes,
}) {
  debugCheckLive(buffer, 'bindStorageBuffer');
  _gated(DeviceFeature.renderStageStorage, 'bindStorageBuffer', (
    shader: shader,
    name: name,
    buffer: buffer,
    offsetInBytes: offsetInBytes,
    sizeInBytes: sizeInBytes,
  ));
  return true;
}