From 162f62f54e5ee38ec93fd7fea02527bfaa384248 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 11 Feb 2022 23:23:22 +0900 Subject: [PATCH] internal/graphicsdriver/metal/mtl: bug fix: test 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 4964b0649..04c46b3a6 100644 --- a/internal/graphicsdriver/metal/mtl/example_darwin_test.go +++ b/internal/graphicsdriver/metal/mtl/example_darwin_test.go @@ -29,9 +29,9 @@ import ( ) func Example_listDevices() { - device, err := mtl.CreateSystemDefaultDevice() - if err != nil { - log.Fatalln(err) + device, ok := mtl.CreateSystemDefaultDevice() + if !ok { + log.Fatalln("Metal is not supported") } printJSON("preferred system default Metal device = ", device) @@ -87,9 +87,9 @@ func printJSON(label string, v interface{}) { } func Example_renderTriangle() { - device, err := mtl.CreateSystemDefaultDevice() - if err != nil { - log.Fatalln(err) + device, ok := mtl.CreateSystemDefaultDevice() + if !ok { + log.Fatalln("Metal is not supported") } // 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 f731ad7a6..3a35a77be 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, err := mtl.CreateSystemDefaultDevice() - if err != nil { - t.Fatal(err) + device, ok := mtl.CreateSystemDefaultDevice() + if !ok { + t.Fatal("Metal is not supported") } // Create a render pipeline state.