From 85111593162e1abb70bb48a8348529467d038b60 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 9 Dec 2020 10:21:23 +0900 Subject: [PATCH] uidriver/glfw: Bug fix: OpenGL was adopted unexpectedly on macOS Big Sur Fixes #1429 --- internal/uidriver/glfw/graphics_darwin.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/uidriver/glfw/graphics_darwin.go b/internal/uidriver/glfw/graphics_darwin.go index 9184822fb..65a65666d 100644 --- a/internal/uidriver/glfw/graphics_darwin.go +++ b/internal/uidriver/glfw/graphics_darwin.go @@ -21,6 +21,11 @@ package glfw // // #import // +// static int getMacOSMajorVersion() { +// NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; +// return (int)version.majorVersion; +// } +// // static int getMacOSMinorVersion() { // NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; // return (int)version.minorVersion; @@ -41,9 +46,10 @@ func supportsMetal() bool { if _, err := mtl.CreateSystemDefaultDevice(); err != nil { return false } + // On macOS 10.11 El Capitan, there is a rendering issue on Metal (#781). // Use the OpenGL in macOS 10.11 or older. - if C.getMacOSMinorVersion() <= 11 { + if C.getMacOSMajorVersion() <= 10 && C.getMacOSMinorVersion() <= 11 { return false } return true