mirror of
https://github.com/wassname/keras-js.git
synced 2026-09-10 12:15:12 +08:00
add exception for WebGL not supported
This commit is contained in:
Vendored
+14
-14
File diff suppressed because one or more lines are too long
@@ -1,4 +1,8 @@
|
||||
const canvas = document.createElement('canvas')
|
||||
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl')
|
||||
|
||||
if(!gl) {
|
||||
throw new Error('Unable to initialize WebGL. Your browser may not support it.')
|
||||
}
|
||||
|
||||
export const MAX_TEXTURE_SIZE = gl.getParameter(gl.MAX_TEXTURE_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user