Fix angle backend detection, though that should no longer be relevant
This commit is contained in:
parent
8c96e2fd90
commit
7ae3fb6109
@ -93,11 +93,16 @@ function detectBackend(str) {
|
||||
* @returns
|
||||
*/
|
||||
function detectANGLEBackend(): AngleVersion {
|
||||
try {
|
||||
const canvas = document.createElement("canvas");
|
||||
const gl = canvas.getContext("webgl2") ||
|
||||
canvas.getContext("webgl") ||
|
||||
canvas.getContext("experimental-webgl");
|
||||
|
||||
if (!gl) {
|
||||
return AngleVersion.NotAvailable;
|
||||
}
|
||||
|
||||
const ext = (gl as any).getExtension("WEBGL_debug_shaders");
|
||||
|
||||
if (!ext) {
|
||||
@ -126,5 +131,8 @@ function detectANGLEBackend(): AngleVersion {
|
||||
const source = ext.getTranslatedShaderSource(shader);
|
||||
|
||||
return detectBackend(source);
|
||||
} catch (e) {
|
||||
return AngleVersion.NotAvailable;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user