Comments (3)
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:
- 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.
- You can find a different way to get webgpu through Java
Hope that helps!
from mach.
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.
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)
- sysgpu: expected type 'sysgpu.sysgpu.main.BackendType', found 'options.build.SysgpuBackend' HOT 2
- panic: api error, error.OutOfDateKHR HOT 2
- Offer terminating a query early HOT 3
- core: sprite example seg faults when closed on windows 11 HOT 1
- Add a format function to vector and matrix structs
- core: `printTitle` doesn't work on windows 11 HOT 2
- proposal: add more 2D collision mechanisms to math.collision HOT 4
- Text: alpha blending of the fonts is not applied correctly in shader
- Text: Leaks memory if no text is being displayed HOT 1
- sysgpu: Vulkan memory allocation for buffers is broken HOT 1
- core: fails to compile on win32 HOT 1
- core: win32 backend requires vsync=.triple or it will stall on 2048th' frame, unsure why HOT 1
- core: nested dispatch requires discarding inferred error set of dispatch
- Please don't throw an error on a newer Zig version HOT 2
- Core: build succeeds on linux but fails at runtime HOT 1
- core: wayland implementation requires a C file to deal with types that translate-c can't handle HOT 1
- sysgpu: vulkan `Segmentation fault` error prevents some examples from running on Wayland
- sysgpu: vram & ram memory leak using vulkan/wayland
- core: keyboard input doesn't work in Wayland
- core: window resizing doesn't really work on Wayland
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mach.