tDevice({
    requiredFeatures: [
      ...(hasBGRA8UnormStorage ? ['bgra8unorm-storage'] : []),
    ],
  });
  if (!device) {
    fail('need a browser that supports WebGPU');
    return;
  }

  // Get a WebGPU context from the canvas and configure it
  const canvas = document.querySelector('canvas');
  const context = canvas.getContext('webgpu');
  const presentationFormat = hasBGRA8UnormStorage
    ? navigator.gpu.getPreferredCanvasFormat()
    : 'rgba8unorm';
  context.configure({
    device,
    format: