electronwebglapple-silicon

Electron V5.0.11 not support webgl when running on Apple Silicon


env:

electron: 5.0.11 macos:12.22.1 (apple m1 pro)

I just run the app like eletron-quick-start by "npm run start".

on the renderer process console, I type code like the below.

let can = document.createElement('canvas')
can.getContext('webgl')
// null

The weird thing is the first run is ok. "can.getContext('webgl')" return something.

when getContext returns null, I noticed the extra output of console like the below:

electron-helper: fallback to sw vertex processing because buildpipelinestate failed
electron-helper:failed assertion clearfunction getclearshaderfragmentfunction

I tested the ElectronV11(process.arch:x64) and ElectronV19(process.arch:arm64), Webgl is working fine.


Solution

  • It ended up offering Mac Apple silicon people the app which is built based on Electron above version 16