internal/graphicsdriver/metal: add comments

This commit is contained in:
Hajime Hoshi 2023-03-13 22:21:55 +09:00
parent e93bcd9e55
commit 3bcac70d1c

View File

@ -97,6 +97,8 @@ func NewGraphics() (graphicsdriver.Graphics, error) {
g := &Graphics{}
if runtime.GOOS != "ios" {
// Initializing a Metal device and a layer must be done in the main thread on macOS.
// Note that this assumes NewGraphics is called on the main thread on desktops.
if err := g.view.initialize(systemDefaultDevice); err != nil {
return nil, err
}