File tree Expand file tree Collapse file tree 5 files changed +46
-1
lines changed Expand file tree Collapse file tree 5 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 1+ // AUTO-GENERATED CODE, DO NOT MODIFY
2+
3+ package metal
4+
5+ // #import <stdlib.h>
6+ // #import <stdint.h>
7+ // #import <stdbool.h>
8+ // #import "Metal/Metal.h"
9+ // void * CreateSystemDefaultDevice();
10+ import "C"
11+ import (
12+ "github.com/progrium/macdriver/objc"
13+ )
14+
15+ // Returns the device instance Metal selects as the default. [Full Topic]
16+ //
17+ // [Full Topic]: https://developer.apple.com/documentation/metal/1433401-mtlcreatesystemdefaultdevice?language=objc
18+ func CreateSystemDefaultDevice () DeviceWrapper {
19+ rv := C .CreateSystemDefaultDevice ()
20+ // *typing.ProtocolType
21+ return DeviceWrapper {objc .ObjectFrom (rv )}
22+ }
Original file line number Diff line number Diff line change 1+ // AUTO-GENERATED CODE, DO NOT MODIFY
2+
3+ #import " Metal/Metal.h"
4+ void * CreateSystemDefaultDevice () {
5+ return (void *)MTLCreateSystemDefaultDevice (
6+ );
7+ }
Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ type Coordinate2D = SamplePosition
88type Region struct {}
99type Origin struct {}
1010type TextureSwizzleChannels struct {}
11- type Size struct {}
11+ type Size struct {
12+ Width uint
13+ Height uint
14+ Depth uint
15+ }
1216type Viewport struct {}
1317type ScissorRect struct {}
1418type VertexAmplificationViewMapping struct {}
Original file line number Diff line number Diff line change @@ -5,3 +5,12 @@ import "testing"
55func TestMetalValid (t * testing.T ) {
66
77}
8+
9+ func TestCreateSystemDefaultDevice (t * testing.T ) {
10+ d := CreateSystemDefaultDevice ()
11+ t .Log (d .HasSupportsFamily ())
12+ t .Log (d .SupportsFamily (GPUFamily (5001 )))
13+ t .Log ("MaxThreadgroupMemoryLength" , d .MaxThreadgroupMemoryLength ())
14+ t .Log ("MaxBufferLength" , d .MaxBufferLength ())
15+ t .Log ("MaxThreadsPerThreadgroup" , d .MaxThreadsPerThreadgroup ())
16+ }
Original file line number Diff line number Diff line change 1+ // AUTO-GENERATED CODE, DO NOT MODIFY
2+
3+ package metal
You can’t perform that action at this time.
0 commit comments