ensureMinigpuModuleLoaded function

Future<void> ensureMinigpuModuleLoaded()

Load (or adopt) the minigpu wasm module once. Safe to await repeatedly. Throws on fetch/instantiation failure — callers surface that as "no GPU on this platform" rather than a silent hang.

Implementation

Future<void> ensureMinigpuModuleLoaded() {
  if (isMinigpuModuleLoaded) return Future<void>.value();
  return _loading ??= _load();
}