go-webgpu
go-webgpu copied to clipboard
is darwin or ios possible ?
I always hit "undefined: getSurfaceDescriptor" issue. See below.
``´
➜ gio-windowing git:(main) ✗ go build . go: downloading github.com/rajveermalviya/gio v0.0.0-20220407081512-669757591f4c go: downloading golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d go: downloading gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 go: downloading gioui.org/shader v1.0.6 go: downloading golang.org/x/exp/shiny v0.0.0-20220328175248-053ad81199eb go: downloading github.com/benoitkugler/textlayout v0.0.10 go: downloading golang.org/x/exp v0.0.0-20220328175248-053ad81199eb go: downloading github.com/go-text/typesetting v0.0.0-20220112121102-58fe93c84506 go: downloading github.com/gioui/uax v0.2.1-0.20220325163150-e3d987515a12
github.com/rajveermalviya/go-webgpu/examples/gio-windowing
./main.go:70:34: undefined: getSurfaceDescriptor
➜ gio-windowing git:(main) ✗ cd .. ➜ examples git:(main) ✗ cd triangle ➜ triangle git:(main) ✗ go build . go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220320163800-277f93cfa958
github.com/rajveermalviya/go-webgpu/examples/triangle
./main.go:52:32: undefined: getSurfaceDescriptor
➜ triangle git:(main) ✗ cd .. ➜ examples git:(main) ✗ cd gio-windowing ➜ gio-windowing git:(main) ✗ gogio -arch arm64,arm,amd64 -target android .
https://github.com/rajveermalviya/go-webgpu/blob/main/.github/workflows/ci.yml#L25 prevents CI testing darwin ?
I always hit "undefined: getSurfaceDescriptor" issue. See below.
yeah triangle
& gio-windowing
examples currently don't implement getSurfaceDescriptor
for darwin (like for linux), though it can be easily implemented via SurfaceDescriptorFromMetalLayer, contributions welcome :).
though other examples (compute
& capture
) should be working.
prevents CI testing darwin ?
github actions runner doesn't have gpu & macos doesn't ship cpu based metal api implementation, so yeah
Hey @rajveermalviya
Yeah i saw the _linux.go version. and started to make _darwin version, but I could not work it out even with https://pkg.go.dev/github.com/rajveermalviya/go-webgpu/wgpu#SurfaceDescriptorFromMetalLayer. Sorry but i mostly do basic http stuff in golang.
DO you think you can write that code ?
I can test it at least locally here on my intel mac.
though other examples (
compute
&capture
) should be working.
Yes they did for me thanks.
this might work for CI for Darwin and IOS, so i asked here: https://github.com/nektos/act/discussions/1143
I can test it at least locally here on my intel mac.
I have created a PR #115 which adds support for glfw based triangle
example.
Would appreciate if you can test it.
it works
➜ rajveermalviya git clone [email protected]:rajveermalviya/go-webgpu.git -b darwin-examples
Cloning into 'go-webgpu'...
remote: Enumerating objects: 1513, done.
remote: Counting objects: 100% (139/139), done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 1513 (delta 70), reused 118 (delta 60), pack-reused 1374
Receiving objects: 100% (1513/1513), 914.69 MiB | 7.06 MiB/s, done.
Resolving deltas: 100% (817/817), done.
Updating files: 100% (70/70), done.
➜ rajveermalviya ls
go-webgpu
➜ rajveermalviya cd go-webgpu
➜ go-webgpu git:(darwin-examples) cd examples
➜ examples git:(darwin-examples) cd triangle
➜ triangle git:(darwin-examples) go build .
➜ triangle git:(darwin-examples) ✗ ./triangle
[go-webgpu] [Warn] Surface does not support present mode: Mailbox, falling back to FIFO
[go-webgpu] [Warn] Surface does not support present mode: Mailbox, falling back to FIFO
[go-webgpu] [Warn] Surface does not support present mode: Mailbox, falling back to FIFO
[go-webgpu] [Warn] Surface does not support present mode: Mailbox, falling back to FIFO

i can compile and run gio ios also if need be. If you get the gio window example working then it should work on ios i think. worth trying..
it works
thanks for testing :tada:
i can compile and run gio ios also if need be
it will first require ios builds of wgpu-native static libraries. will surely try too add them
cool. I can't believe you were able to code the darwin triangle without a MacOS to try it on. Impressive dude !!
mostly thanks to zig cc
's magic.
setting correct env for gopls & it provides linting in vscode.
it only goes as far as being able to build for macos on linux. still need a mac to run/test the binary.
thanks - i am def going to check out that link when i have a second... I heard of zig, but never had a reason to look into it deeper.
Still amazing either way.
hey @rajveermalviya
I just noticed there is an IOS lib now.
Hey @rajveermalviya If you need MAC Testing again just let me know.