-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html.in
31 lines (28 loc) · 913 Bytes
/
index.html.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html>
<head>
<title>WebGPU Starter</title>
</head>
<body>
<!-- The canvas to display our renderer output on -->
<canvas id="webgpu-canvas" width="640" height="480" oncontextmenu="return false;"></canvas>
<script>
var Module;
(async () => {
if (!navigator.gpu) {
alert("WebGPU is not supported/enabled in your browser");
return;
}
Module = {};
// Get a GPU device to render with
var adapter = await navigator.gpu.requestAdapter();
var device = await adapter.requestDevice();
Module.preinitializedWebGPUDevice = device;
var appjs = document.createElement("script");
appjs.async = true;
appjs.src = "@[email protected]"
document.body.appendChild(appjs);
})();
</script>
</body>
</html>