internal/graphicsdriver/metal/mtl: bug fix: test compile error

This commit is contained in:
Hajime Hoshi 2022-02-11 23:23:22 +09:00
parent 176e984a58
commit 162f62f54e
2 changed files with 9 additions and 9 deletions

View File

@ -29,9 +29,9 @@ import (
) )
func Example_listDevices() { func Example_listDevices() {
device, err := mtl.CreateSystemDefaultDevice() device, ok := mtl.CreateSystemDefaultDevice()
if err != nil { if !ok {
log.Fatalln(err) log.Fatalln("Metal is not supported")
} }
printJSON("preferred system default Metal device = ", device) printJSON("preferred system default Metal device = ", device)
@ -87,9 +87,9 @@ func printJSON(label string, v interface{}) {
} }
func Example_renderTriangle() { func Example_renderTriangle() {
device, err := mtl.CreateSystemDefaultDevice() device, ok := mtl.CreateSystemDefaultDevice()
if err != nil { if !ok {
log.Fatalln(err) log.Fatalln("Metal is not supported")
} }
// Create a render pipeline state. // Create a render pipeline state.

View File

@ -30,9 +30,9 @@ import (
) )
func Disabled_TestRenderTriangle(t *testing.T) { func Disabled_TestRenderTriangle(t *testing.T) {
device, err := mtl.CreateSystemDefaultDevice() device, ok := mtl.CreateSystemDefaultDevice()
if err != nil { if !ok {
t.Fatal(err) t.Fatal("Metal is not supported")
} }
// Create a render pipeline state. // Create a render pipeline state.