Skip to content

Commit

Permalink
Enable safemode for < 4 cores
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Jan 3, 2024
1 parent a309c7c commit 478dea0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/ui/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" }) ||
Expand Down

0 comments on commit 478dea0

Please sign in to comment.