document.getElementById('status').textContent = `READY`
}
+ const selfChecked = {
+ webgpu: false,
+ webgl: false,
+ wasm: false,
+ cpu: false
+ }
+
const logger = new Logger()
const glSize = (canvas => {
* @param {string} api
*/
async function selfCheck (api) {
- document.getElementById('status').textContent = `RUNNING SELF-CHECK`
+ if (selfChecked[api]) return
+ document.getElementById('status').textContent = `RUNNING SELF-CHECK: ${api.toUpperCase()}`
logger.log(`%cNanoPow`, 'color:green', 'Checking validation against known values')
const options = { api, debug: true }
// Generate once on load to compile shaders and initialize buffers
expect.push(isValid)
}
- if (!expect.every(result => result)) {
+ if (expect.every(result => result)) {
+ selfChecked[api] = true
+ } else {
document.getElementById('status').textContent = `FAILED TO VALIDATE KNOWN VALUES, CHECK CONSOLE`
throw new Error(`Validation is not working`)
}