mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-30 03:10:06 +00:00
Add vendor:wgpu
This commit is contained in:
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" style="height: 100%;">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>WGPU WASM Triangle</title>
|
||||
</head>
|
||||
<body id="body" style="height: 100%; padding: 0; margin: 0; overflow: hidden;">
|
||||
<canvas id="wgpu-canvas"></canvas>
|
||||
|
||||
<script type="text/javascript" src="runtime.js"></script>
|
||||
<script type="text/javascript" src="wgpu.js"></script>
|
||||
<script type="text/javascript">
|
||||
const mem = new WebAssembly.Memory({ initial: 2000, maximum: 65536, shared: false });
|
||||
const memInterface = new odin.WasmMemoryInterface();
|
||||
memInterface.setMemory(mem);
|
||||
|
||||
const wgpuInterface = new odin.WebGPUInterface(memInterface);
|
||||
|
||||
odin.runWasm("triangle.wasm", null, { wgpu: wgpuInterface.getInterface() }, memInterface, /*intSize=8*/);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user