Giter Club home page Giter Club logo

Comments (3)

slimsag avatar slimsag commented on September 25, 2024

By default Dawn bounces all C API calls through a vtable which acts as a swappable interface implementation for e.g. testing.

To initialize the interface, there must be a call to dawnProcSetProcs setting it to the return value of dawn::native::GetProcs(). Otherwise, you can directly call the result of function pointers dawn::native::GetProcs() returns and skip the vtable entirely - which is what Mach does: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/hexops/mach%24+machDawnGetProcTable&patternType=keyword&sm=0

There is some more info on it here: https://machengine.org/pkg/mach-gpu-dawn/#important-building-webgpu-api-symbols

However, I must warn you that the Mach project is moving away from Dawn/WebGPU in favor of our own graphics abstraction sysgpu. As a result, the mach-gpu-dawn project is likely to be removed soon.

My advice would be one of two options:

  1. You could work with me on how to make e.g. Mach core more generally accessible to Java applications through JNI, this probably requires some planning and will take more effort, but would be a better solution long term depending on your use cases.
  2. You can find a different way to get webgpu through Java

Hope that helps!

from mach.

SuperIceCN avatar SuperIceCN commented on September 25, 2024

First of all, thank you for your help!

I just tried calling directly and it didn't crashed the JVM though the status of the response is not success while in an executable file it works. Anyway, I am considering switching to using sysgpu, which I guess that it will be much more easier to debug. My only concern is if sysgpu can achieve a relatively stable state in the coming months, at least in the parts related to compute shaders? (According to the commit records, there has been no progress for four months.) If so, I'm willing to make at least sysgpu accessible to Java&Kotlin applications, since JVM and Android community is in short of a gpu interface that is modern and easy to deploy for a long time.

Thank you for taking the time out of your busy schedule to answer my question.

from mach.

slimsag avatar slimsag commented on September 25, 2024

sysgpu is definitely not stable, it is extremely experimental and likely to change a lot in the coming months. I expect its API and shading language to change dramatically.

from mach.

Related Issues (20)

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.