Skip to content

Fix web build#10

Draft
PZerua wants to merge 1 commit intomainfrom
fix_web_build
Draft

Fix web build#10
PZerua wants to merge 1 commit intomainfrom
fix_web_build

Conversation

@PZerua
Copy link
Contributor

@PZerua PZerua commented Jan 25, 2026

Fix building with Emscripten after the engine's init refactoring and updating to the latest Dawn version.

Building for web was quite convoluted because Dawn mantains its own fork of Emscripten with latest WebGPU API changes, but It has improved quite a lot last year. Now it's just as easy as fetching Dawn's repo and, in our case, adding the target library emdawnwebgpu_c. You can check these changes here: upf-gti/WebGPU-distribution@5709054

This also means we can stop using the old Tint repository (deprecated in 2024) and just use the latest Tint inside Dawn, for improved performance and latest features.

Also updated ImGui to latest commit, allowing us to remove the patch we made for web support.

Currently, apps using wgpuEngine as a library, must add these lines to their CMake to properly create the app's html:

if (EMSCRIPTEN)
    set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html")
endif()

I'm not sure we can do anything about it from the engine side.

Created as a draft until we fix the following issues:

  • Black screen after resizing brower's window.
  • Support for custom shell.html?

@JsMarq96
Copy link
Contributor

JsMarq96 commented Feb 4, 2026

Since we are also "forcing" users to use our own CMakeLists for projects on the engine, I do not see a reason why adding those three lines to the CMake could be an issue.

The custom shell.html could be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants