-
-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGPU bindings #1114
WebGPU bindings #1114
Conversation
Nice! However I think when we discussed this last we decided that work should be done in both BuildTools and SilkTouch to use WebIDL and allow our WebGPU (and eventually WebGL) bindings to work in both Blazor mode (i.e. using Blazor's interop APIs) and native mode (using classical SilkTouch). We came to the conclusion that it wasn't this simple because the "web" in WebGPU becomes a misnomer if we don't have an explicit code path for it. |
I was thinking more emscripten than blazor webidl, since emscripten has code to convert these C imports, i just need to specify a dllimport with the right name |
I have been against relying on emscripten magic, but looking at other .NET projects this seems to frustratingly be the standard route so that sounds fine with me. You'll need to use SilkTouch's P/Invoke override functionality as well as add support for Blazor ( |
Yup the P/Invoke and SearchPathContainer will come in another PR later on, i already have a lot of that done, for the initial merge ittl be a 'wgpu-native' thing only, then i'll make all the bindings i can web-compatible in the main WASM PR |
If CI passes then i think this PR is ready for a first round of review, i went through and made sure all the struct/function names make sense |
Since initial round of review, some generation problems have cropped up relating to enums being misinterpreted as ints in some structs, namely problems like WriteMask in ColorTargetState, which is incorrectly generated as a uint, rather than a ColorWriteMask, id like to get these fixed before this is taken for another review |
Should be ready for another review (but id like to pause on actually merging until the bindings regeneration is in) |
src/Windowing/Extensions/Silk.NET.Windowing.Extensions.WebGPU/WebGPUWindow.cs
Outdated
Show resolved
Hide resolved
src/Windowing/Extensions/Silk.NET.Windowing.Extensions.WebGPU/WebGPUWindow.cs
Outdated
Show resolved
Hide resolved
src/Windowing/Extensions/Silk.NET.Windowing.Extensions.WebGPU/WebGPUWindow.cs
Outdated
Show resolved
Hide resolved
src/Windowing/Extensions/Silk.NET.Windowing.Extensions.WebGPU/WebGPUWindow.cs
Outdated
Show resolved
Hide resolved
src/Windowing/Extensions/Silk.NET.Windowing.Extensions.WebGPU/WebGPUWindow.cs
Outdated
Show resolved
Hide resolved
documentation/proposals/(Superseded) Proposal - Enhanced Input Events.md
Show resolved
Hide resolved
… shader, plus error handling
Now, we dont actually support WASM yet, but this code is here for that time (soon hopefully!)
Co-authored-by: Dylan Perks <11160611+Perksey@users.noreply.github.com>
…ke how it doesnt save automatically)
Co-authored-by: Dylan Perks <11160611+Perksey@users.noreply.github.com>
Found problem with BufferMapAsync, its MapMode isnt being registered as an enum, rather a uint, so dont merge until thats fixed |
This has now been fixed! |
Is webgl still on the roadmap? |
|
Summary of the PR
Adds WebGPU bindings, generated from webgpu-headers
Related issues, Discord discussions, or proposals
Closes #1113