Giter VIP home page Giter VIP logo

Comments (8)

gedw99 avatar gedw99 commented on May 28, 2024 1

i reopened it. Hope you do not mind..

from go-webgpu.

gedw99 avatar gedw99 commented on May 28, 2024 1

I dont know how to do the Cocoa handles. am mostly pure golang developer
I know that in the GIOUI code base they recently had work done for Platform Views, which is slightly related.
https://todo.sr.ht/~eliasnaur/gio/428

wish i could be more help.

from go-webgpu.

gedw99 avatar gedw99 commented on May 28, 2024

The triangle example works on Mac still... so might be gio related.


apple@x-MacBook-Pro-2 triangle % go build .
apple@x-MacBook-Pro-2 triangle % ls
main.go				surface_android.go		surface_wayland_linux.go	surface_x11_linux.go
shader.wgsl			surface_darwin.go		surface_windows.go		triangle
apple@x-MacBook-Pro-2 triangle % ./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

from go-webgpu.

gedw99 avatar gedw99 commented on May 28, 2024

sorry i just noticed that darwin is not implemented yet: https://github.com/rajveermalviya/go-webgpu/blob/main/examples/gio-windowing/surface_darwin.go#L11

from go-webgpu.

gedw99 avatar gedw99 commented on May 28, 2024

i just pulled latest.

Now for gio-windowing example i get:
./main.go:70:34: undefined: getSurfaceDescriptor

Much less errors.

from go-webgpu.

rajveermalviya avatar rajveermalviya commented on May 28, 2024

yep, it's because gio-windowing example currently lacks support for darwin. I mainly have it in just to showcase android support.
you should instead be able to run glfw-based examples (triangle, cube, boids) on darwin.

would really appreciate if someone with a mac is willing to shoot a PR.
I haven't looked into how gio exposes Cocoa handles, doubt it would be much different than how glfw does it.

https://github.com/rajveermalviya/go-webgpu/blob/507e0ba4017222a6fd9200cb7c62bd78970f98d0/examples/triangle/surface_darwin.go

from go-webgpu.

rajveermalviya avatar rajveermalviya commented on May 28, 2024

while implementing it (see #199) it seems this is not possible with Gio's current api.

Gio's current api prevents using it as a standalone windowing library (atleast for macos & i assume ios too),
because the metal layer provided by ViewEvent cannot be resized
from a separate goroutine (non main thread).

we can merge #199 as is, but that would not be good idea as resizing the window will fail.

from go-webgpu.

gedw99 avatar gedw99 commented on May 28, 2024

the latest GIO should help and you can also use it as standalone.

https://github.com/gioui/gio-example/blob/main/glfw is a simple example doing it which might help ?

from go-webgpu.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.