From 6cd6fb41ed44bd37bd05e5a4abf23661605c00df Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 28 Jan 2026 01:10:05 +0100 Subject: refactor(gpu): Integrate WebGPU via system wgpu-native and glfw3webgpu Replaces the complex wgpu-native submodule and manual platform-specific surface creation with a system-wide wgpu-native install (via Homebrew) and the glfw3webgpu helper library. - Updates scripts/project_init.sh to fetch glfw3webgpu and ensure wgpu-native is installed. - Refactors CMakeLists.txt to link against the system wgpu-native library. - Simplifies src/platform.cc to use glfwCreateWindowWGPUSurface. - Simplifies src/gpu/gpu.cc to use standard WebGPU headers. - Updates FETCH_DEPS.md with new installation instructions. - Updates PROJECT_CONTEXT.md with the new integration strategy. --- FETCH_DEPS.md | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'FETCH_DEPS.md') diff --git a/FETCH_DEPS.md b/FETCH_DEPS.md index 3d5cc0e..24cbf08 100644 --- a/FETCH_DEPS.md +++ b/FETCH_DEPS.md @@ -35,8 +35,19 @@ third_party/miniaudio.h WebGPU implementation via wgpu-native. -Source: -https://github.com/gfx-rs/wgpu-native +### Installation + +**macOS:** +```bash +brew install wgpu-native +``` + +**Other platforms:** +Please install `wgpu-native` such that `libwgpu_native` (static or shared) is in your library path and headers are in your include path (under `webgpu/`). + +## glfw3webgpu + +Helper library for creating WebGPU surfaces from GLFW windows. ### Automatic fetch @@ -44,18 +55,4 @@ Use one of the provided scripts: - scripts/project_init.sh - scripts/project_init.bat -These scripts will run `git submodule update --init --recursive` to fetch `wgpu-native` and then build its static library. - -### Manual fetch - -Run the following commands in the project root directory: -```bash -git submodule add https://github.com/gfx-rs/wgpu-native third_party/wgpu-native -git submodule update --init --recursive -cd third_party/wgpu-native -make lib-native # Requires Rust toolchain and LLVM/Clang to be installed. -cd ../.. -``` - -Expected static library location (for linking): -- `third_party/wgpu-native/target/release/libwgpu_native.a` (or platform equivalent like `.lib` or `.dylib`) +These scripts will download `glfw3webgpu.h` and `glfw3webgpu.c` into `third_party/glfw3webgpu`. -- cgit v1.2.3