async function initWebGPU() { if (!navigator.gpu) { document.body.innerHTML = "

Your browser does not support WebGPU.

"; return; } const canvas = document.getElementById("webgpu-canvas"); const adapter = await navigator.gpu.requestAdapter(); const device = await adapter.requestDevice(); const context = canvas.getContext("webgpu"); context.configure({ device: device, format: navigator.gpu.getPreferredCanvasFormat(), alphaMode: "opaque", }); console.log("WebGPU initialized successfully!"); } initWebGPU();