internal/graphicsdriver/metal: bug fix: a path for CoreGraphics.framework didn't work

Closes #2595
This commit is contained in:
Hajime Hoshi 2023-03-10 23:24:03 +09:00
parent f9f1736a4b
commit 36e2d0ec40
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ type MetalLayer struct {
//
// Reference: https://developer.apple.com/documentation/quartzcore/cametallayer.
func MakeMetalLayer() (MetalLayer, error) {
coreGraphics, err := purego.Dlopen("/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
coreGraphics, err := purego.Dlopen("CoreGraphics.framework/CoreGraphics", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
if err != nil {
return MetalLayer{}, err
}

View File

@ -35,7 +35,7 @@ func init() {
//go:cgo_import_dynamic _ _ "Metal.framework/Metal"
// It is also necessary for CoreGraphics to be linked
_, _ = purego.Dlopen("/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
_, _ = purego.Dlopen("CoreGraphics.framework/CoreGraphics", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
}
func Example_listDevices() {