disable humangl backend if webgl 1.0 is detected

pull/356/head
Vladimir Mandic 2021-11-08 11:35:35 -05:00
parent 37f62f47fa
commit 50eff29056
2 changed files with 9 additions and 3 deletions

View File

@ -9,13 +9,13 @@
## Changelog
### **HEAD -> main** 2021/11/08 mandic00@live.com
### **2.5.1** 2021/11/08 mandic00@live.com
- new human.compare api
- added links to release notes
### **origin/main** 2021/11/06 mandic00@live.com
- new frame change detection algorithm
- add histogram equalization
- implement wasm missing ops

View File

@ -61,6 +61,12 @@ export async function register(instance): Promise<void> {
}
try {
config.gl = config.canvas?.getContext('webgl2', config.webGLattr) as WebGL2RenderingContext;
const glv2 = config.gl.getParameter(config.gl.VERSION).includes('2.0');
if (!glv2) {
log('override: using fallback webgl backend as webgl 2.0 is not detected');
instance.config.backend = 'webgl';
return;
}
if (config.canvas) {
config.canvas.addEventListener('webglcontextlost', async (e) => {
log('error: humangl:', e.type);