]> git.codecow.com Git - nano-pow.git/commitdiff
Improve dynamic API selection on test page load.
authorChris Duncan <chris@codecow.com>
Thu, 21 May 2026 18:23:26 +0000 (11:23 -0700)
committerChris Duncan <chris@codecow.com>
Thu, 21 May 2026 18:23:26 +0000 (11:23 -0700)
test/index.html

index b2e2f03a690312ad6ecedd528fe77a9731a690f4..26abadf6d0148d620a1df6c0dfac2e225c622531 100644 (file)
@@ -284,7 +284,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
                }
 
                document.getElementById('api_webgpu').disabled = navigator?.gpu == null
-               document.getElementById('api_webgl').selected = navigator?.gpu == null
+               document.getElementById('api_webgpu').selected = navigator?.gpu != null
+               document.getElementById('api_webgl').disabled = glSize == null
+               document.getElementById('api_webgl').selected = navigator?.gpu == null && glSize != null
+               document.getElementById('api_wasm').selected = navigator?.gpu == null && glSize == null
                document.getElementById('btnStartTest').addEventListener('click', startTest)
                document.getElementById('btnStartScore').addEventListener('click', startScore)
                document.getElementById('effort').value = Math.max(1, Math.floor(navigator.hardwareConcurrency) / 2)
@@ -328,7 +331,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                <select id="api">
                        <option id="api_webgpu">WebGPU</option>
                        <option id="api_webgl">WebGL</option>
-                       <option>WASM</option>
+                       <option id="api_wasm">WASM</option>
                        <option>CPU</option>
                </select>
        </span>