From 478dea0dd973d69b23e286df71641d4ea59c803b Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Wed, 3 Jan 2024 18:22:09 +0100 Subject: [PATCH] Enable safemode for < 4 cores --- src/js/ui/UI.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/ui/UI.js b/src/js/ui/UI.js index 72fc0ec..f78a199 100644 --- a/src/js/ui/UI.js +++ b/src/js/ui/UI.js @@ -29,6 +29,8 @@ export default class UI { try { if (typeof this.safeMode !== "undefined") return this.safeMode; if (!window.WebGLRenderingContext) return this.setSafeMode(true); + const nCores = navigator.hardwareConcurrency; + if (typeof nCores !== "undefined" && nCores > 0 && nCores < 4) return this.setSafeMode(true); const canvas = document.createElement("canvas"); const gl = canvas.getContext("webgl", { powerPreference: "high-performance" }) ||