resource property

  1. @override
dynamic resource
override

The resource data.

Implementation

@override
gpu.DeviceBuffer? get resource {
  var resource = super.resource;
  final sizeInBytes = _vertices.lengthInBytes + _indices.lengthInBytes;
  if (resource?.sizeInBytes != sizeInBytes) {
    // Store the device buffer in the resource parent.
    resource = super.resource = gpu.gpuContext.createDeviceBuffer(
      gpu.StorageMode.hostVisible,
      sizeInBytes,
    );

    resource
      ?..overwrite(_vertices.asByteData())
      ..overwrite(
        _indices.asByteData(),
        destinationOffsetInBytes: _vertices.lengthInBytes,
      );
  }
  return resource;
}
  1. @protected
void resource=(dynamic resource)
inherited

Implementation

@protected
set resource(R resource) => _resource = resource;