I need a way to set Google Chrome with some flags to test WebGL version 2 performance
with metal. Instead of set flags to be used all the time. I made AppleScriptObjC to open Google Chrome with custom flags. Apple have method to do this from NSWorkspace class and configuration from NSWorkspaceOpenConfiguration class.
If you like to know the performance of your GPU and WebGL
https://webglsamples.org/aquarium/aquarium.html
The default Google Chrome for macOS do not use metal api. But Google have implemented metal api for Angel (Graphic Engine) for Blink (Web Browser Engine). And after this is done performance on Apple Silicon with Google Chrome is higher FPS.
use framework "AppKit"
use framework "Foundation"
use scripting additions
(**
* [chrome://flags]
* - Choose ANGLE graphics backend
**
* [chrome://version]
*
**
* Reference: https://developer.chrome.com/docs/web-platform/chrome-flags/
*)
set appPath to POSIX path of (path to applications folder) & "Google Chrome.app"
set appURL to current application's |NSURL|'s fileURLWithPath:appPath
set workspace to current application's NSWorkspace's sharedWorkspace()
set theConfiguration to current application's NSWorkspaceOpenConfiguration's configuration()
theConfiguration's setArguments:{¬
"--enable-webgl-draft-extensions", ¬
"--use-angle=metal"}
workspace's openApplicationAtURL:appURL configuration:theConfiguration completionHandler:(missing value)
And if you like to do performance test to compare with Safari you need to set WebGL via Metal and WebGL 2.0 from experimental feature from Develop menu in Safari.
To check if you parameters is used for Google Chrome you could do.
chrome://version
It will not be showing as: chrome://flags