From 36bd3329b336dcd6debdb32c99f73e0fdd540df2 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 4 Mar 2023 01:25:43 +0900 Subject: [PATCH] internal/graphicsdriver/metal: bug fix: compile error --- .../graphicsdriver/metal/mtl/example_darwin_test.go | 12 ++++++------ internal/graphicsdriver/metal/mtl/mtl_darwin_test.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/graphicsdriver/metal/mtl/example_darwin_test.go b/internal/graphicsdriver/metal/mtl/example_darwin_test.go index 91ee2bd55..581855cf7 100644 --- a/internal/graphicsdriver/metal/mtl/example_darwin_test.go +++ b/internal/graphicsdriver/metal/mtl/example_darwin_test.go @@ -39,9 +39,9 @@ func init() { } func Example_listDevices() { - device, ok := mtl.CreateSystemDefaultDevice() - if !ok { - log.Fatalln("Metal is not supported") + device, err := mtl.CreateSystemDefaultDevice() + if err != nil { + log.Fatal(err) } printJSON("preferred system default Metal device = ", device) @@ -86,9 +86,9 @@ func printJSON(label string, v any) { } func Example_renderTriangle() { - device, ok := mtl.CreateSystemDefaultDevice() - if !ok { - log.Fatalln("Metal is not supported") + device, err := mtl.CreateSystemDefaultDevice() + if err != nil { + log.Fatal(err) } // Create a render pipeline state. diff --git a/internal/graphicsdriver/metal/mtl/mtl_darwin_test.go b/internal/graphicsdriver/metal/mtl/mtl_darwin_test.go index 0d8449ec5..4abc65c09 100644 --- a/internal/graphicsdriver/metal/mtl/mtl_darwin_test.go +++ b/internal/graphicsdriver/metal/mtl/mtl_darwin_test.go @@ -30,9 +30,9 @@ import ( ) func Disabled_TestRenderTriangle(t *testing.T) { - device, ok := mtl.CreateSystemDefaultDevice() - if !ok { - t.Fatal("Metal is not supported") + device, err := mtl.CreateSystemDefaultDevice() + if err != nil { + t.Fatal(err) } // Create a render pipeline state.