const adapter = await navigator.gpu.requestAdapter()
throw new Error("WebGPU cannot be initialized - Adapter not found")
const device = await adapter.requestDevice()
throw new Error("WebGPU cannot be initialized - Device has been lost")
const canvas = document.querySelector("canvas")
const context = canvas!.getContext("webgpu")
throw new Error("WebGPU cannot be initialized - Canvas does not support WebGPU")
const format = navigator.gpu.getPreferredCanvasFormat()
context.configure({ device, format })
const commandEncoder = device.createCommandEncoder()
const renderPass = commandEncoder.beginRenderPass({
view: context.getCurrentTexture().createView(),
clearValue: { r: 0.749, g: 0.925, b: 1.0, a: 1 },
device.queue.submit([commandEncoder.finish()])