third_party_spirv-tools/tools/sva/tests/index.html
dan sinclair 605c2e3c0e
Add WebGPU SPIR-V Assembler in JavaScript. (#2876)
This CL adds a simple JavaScript library which will assemble SPIR-V
Assembly compatable with WebGPU.
2019-09-18 18:11:10 -04:00

24 lines
493 B
HTML

<!doctype html>
<html>
<head>
<meta charset='utf-8'>
</head>
<body>
<pre id='code'><code></code></pre>
<script type="module">
let c = document.getElementById('code');
import SVA from "/build/sva.js";
let assembly = SVA.assemble("OpCapability Shader");
if (typeof assembly === "string") {
c.innerText = assembly;
} else {
c.innerText = Array.from(assembly)
.map(b => b.toString(16).padStart(8, "0")).join(" ");
}
</script>
</body>
</html>