News for hackers. Stuff that matters.
Re:SDL3 new GPU API merged by westurner on Thursday August 29, 2024 @10:09PM (#41397176)
wgpu supports WebGPU: https://github.com/gfx-rs/wgpu :

> While WebGPU does not support any shading language other than WGSL, we will automatically convert your non-WGSL shaders if you're running on WebGPU.

Re:SDL3 new GPU API merged by dartos on Friday August 30, 2024 @12:07AM (#41397648)
That’s just for the shading language
Re:SDL3 new GPU API merged by flohofwoe on Friday August 30, 2024 @05:05AM (#41398942)
The Rust wgpu project has an alternative C API which is identical (or at least closely matches, I haven't looked in detail at it yet) the official webgpu.h header. For instance all examples in here are written in C:

https://github.com/gfx-rs/wgpu-native/tree/trunk/examples

There's definitely also people using wgpu from Zig via the C bindings.

Re:SDL3 new GPU API merged by westurner on Friday August 30, 2024 @11:45AM (#41401804)
I found:

shlomnissan/sdl-wasm: https://github.com/shlomnissan/sdl-wasm :

> A simple example of compiling C/SDL to WebAssembly and binding it to an HTML5 canvas.

erik-larsen/emscripten-sdl2-ogles2: https://github.com/erik-larsen/emscripten-sdl2-ogles2 :

> C++/SDL2/OpenGLES2 samples running in the browser via Emscripten

IDK how much work there is to migrate these to SDL3?

Are there WASM compilation advantages to SDL3 vs SDL2?