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() {
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.

View File

@ -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.