Skip to content

Emscripten: replace USE_WEBGPU to emdawnwebgpu in wgpu-backend#76

Merged
kassane merged 5 commits intomainfrom
emdawn-wgpu
Jun 15, 2025
Merged

Emscripten: replace USE_WEBGPU to emdawnwebgpu in wgpu-backend#76
kassane merged 5 commits intomainfrom
emdawn-wgpu

Conversation

@kassane
Copy link
Copy Markdown
Collaborator

@kassane kassane commented Jun 8, 2025

@kassane kassane requested a review from floooh June 8, 2025 18:43
@kassane kassane added the enhancement New feature or request label Jun 8, 2025
@kassane
Copy link
Copy Markdown
Collaborator Author

kassane commented Jun 8, 2025

this commit 5773016 show ✔️ for wgpu examples (-sUSE_WEBGPU=1)

@floooh
Copy link
Copy Markdown
Owner

floooh commented Jun 9, 2025

FYI: I'll start working on the emdawnwebgpu stuff today, this will require changes in the WebGPU backend code both in sokol_app.h and sokol_gfx.h.

@kassane
Copy link
Copy Markdown
Collaborator Author

kassane commented Jun 9, 2025

FYI: I'll start working on the emdawnwebgpu stuff today, this will require changes in the WebGPU backend code both in sokol_app.h and sokol_gfx.h.

Ok. If you need to modify this branch, feel free.
If you need my help with D, just mention me!

@floooh
Copy link
Copy Markdown
Owner

floooh commented Jun 14, 2025

FYI this is how I changed the sokol-zig build process to support emdawnwebgpu.

There needs to be a separate build step which runs the cmdline tool embuilder build emdawnwebgpu which needs to run after the Emscripten SDK setup and before the Sokol C library compilation:

https://github.com/floooh/sokol-zig/pull/120/files#diff-f87bb3596894756629bc39d595fb18d479dc4edf168d93a911cadcb060f10fcc

...I'm not planning to do changes to the D build system, I guess WebGPU usage is currently unlikely, and I don't want to wait with the merge much longer.

@kassane
Copy link
Copy Markdown
Collaborator Author

kassane commented Jun 14, 2025

There needs to be a separate build step which runs the cmdline tool embuilder build emdawnwebgpu which needs to run after the Emscripten SDK setup and before the Sokol C library compilation[...]

Ok. I see your question in wasm-discord group about.

[...]I'm not planning to do changes to the D build system, I guess WebGPU usage is currently unlikely, and I don't want to wait with the merge much longer.

Really? Ok, don't worry.
Dawn replace -sUSE_WEBGPU. However, TBD date to remove deprecated -sUSE_WEBGPU. (in emscripten-core/emscripten#24265)

I also had (like you) trouble building for WebGPU after the backend flag was missing during the last builder transition PR (fixed in 18d0271).
Now, that I have Chromium1 installed, I'll run some tests.

Footnotes

  1. I have only used Firefox for over 15 years! 🦊

@kassane kassane marked this pull request as ready for review June 14, 2025 15:28
@kassane
Copy link
Copy Markdown
Collaborator Author

kassane commented Jun 14, 2025

chromium test
image

@kassane kassane changed the title add emdawnwebgpu backend Emscripten: replace USE_WEBGPU to emdawnwebgpu in wgpu-backend Jun 14, 2025
@floooh
Copy link
Copy Markdown
Owner

floooh commented Jun 15, 2025

The build script changes look good to me.

I now also merged all the upstream MRs.

I guess the easiest way to resolve the conflicts is to run python3 gen_all.py in the sokol repository to overwrite the C headers.

@kassane kassane merged commit 4e8e107 into main Jun 15, 2025
15 checks passed
@kassane kassane deleted the emdawn-wgpu branch June 15, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants