GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
scripts/web-probe/page.html (772B)
1 <!doctype html>
2 <meta charset="utf-8">
3 <title>cce-ui WebGPU probe</title>
4 <style>html,body{margin:0;background:#000}canvas{display:block;width:1280px;height:800px}</style>
5 <canvas id="c" width="1280" height="800"></canvas>
6 <script type="module">
7 import init, { probe } from './probe_web.js';
8 window.runProbe = async () => {
9 await init();
10 const names = await (await fetch('fonts.json')).json();
11 const fonts = [];
12 for (const n of names) fonts.push(new Uint8Array(await (await fetch('fonts/' + n)).arrayBuffer()));
13 const rgba = await probe(document.getElementById('c'), fonts);
14 let s = '';
15 for (let i = 0; i < rgba.length; i += 0x8000) s += String.fromCharCode.apply(null, rgba.subarray(i, i + 0x8000));
16 return btoa(s);
17 };
18 window.probeReady = true;
19 </script>