Skip to content
Permalink
Browse files

play with Metal API to get system default device name

  • Loading branch information...
dmitshur committed Jun 6, 2018
1 parent e1a3153 commit 44eb072cda6386ce8e427f30d167f331de8cf14b
Showing with 21 additions and 0 deletions.
  1. +13 −0 245/main.go
  2. +1 −0 245/main.h
  3. +7 −0 245/main.m
@@ -0,0 +1,13 @@
// Play with Metal API to get system default device name.
package main

/*
#cgo darwin CFLAGS: -x objective-c
#cgo darwin LDFLAGS: -framework Foundation -framework Metal
#include "main.h"
*/
import "C"

func main() {
C.run()
}
@@ -0,0 +1 @@
void run();
@@ -0,0 +1,7 @@
#import <Foundation/NSObjCRuntime.h>
#import <Metal/Metal.h>

void run() {
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
NSLog(@"%@", [device name]);
}

0 comments on commit 44eb072

Please sign in to comment.
You can’t perform that action at this time.