mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-23 07:20:28 +00:00
605c2e3c0e
This CL adds a simple JavaScript library which will assemble SPIR-V Assembly compatable with WebGPU.
24 lines
493 B
HTML
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>
|