{"id":16898466,"url":"https://github.com/kainino0x/webgpu-cross-platform-demo","last_synced_at":"2025-07-23T16:02:32.869Z","repository":{"id":45589640,"uuid":"206909295","full_name":"kainino0x/webgpu-cross-platform-demo","owner":"kainino0x","description":"Cross-platform (Web/native) demo of WebGPU using C++, CMake, Dawn, and Emscripten with Dawn's \"emdawnwebgpu\" bindings.","archived":false,"fork":false,"pushed_at":"2025-06-17T21:22:59.000Z","size":14451,"stargazers_count":81,"open_issues_count":3,"forks_count":8,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-07-14T19:22:54.275Z","etag":null,"topics":["dawn","demo","emdawnwebgpu","example","sample","webgpu"],"latest_commit_sha":null,"homepage":"https://kai.graphics/webgpu-cross-platform-demo/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kainino0x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-07T03:18:58.000Z","updated_at":"2025-06-19T16:50:21.000Z","dependencies_parsed_at":"2025-01-17T12:12:09.276Z","dependency_job_id":"ab283bd8-b98c-4d12-9ca4-24704c67a5ff","html_url":"https://github.com/kainino0x/webgpu-cross-platform-demo","commit_stats":{"total_commits":40,"total_committers":4,"mean_commits":10.0,"dds":"0.15000000000000002","last_synced_commit":"9c8c1d0574d37d99c59933a95decb3ba86e71c7e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kainino0x/webgpu-cross-platform-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainino0x%2Fwebgpu-cross-platform-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainino0x%2Fwebgpu-cross-platform-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainino0x%2Fwebgpu-cross-platform-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainino0x%2Fwebgpu-cross-platform-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kainino0x","download_url":"https://codeload.github.com/kainino0x/webgpu-cross-platform-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainino0x%2Fwebgpu-cross-platform-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266708096,"owners_count":23971933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dawn","demo","emdawnwebgpu","example","sample","webgpu"],"created_at":"2024-10-13T17:43:25.085Z","updated_at":"2025-07-23T16:02:32.831Z","avatar_url":"https://github.com/kainino0x.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a small test app that uses WebGPU's\n[`webgpu.h` header](https://github.com/webgpu-native/webgpu-headers/blob/main/webgpu.h)\nas a platform-agnostic hardware abstraction layer.\nIt uses a C++ layer over `webgpu.h`, called `webgpu_cpp.h`.\n\nOn native platforms, this project can be built against\n[Dawn](https://dawn.googlesource.com/dawn/), Chromium's native WebGPU implementation.\n\nOn the Web, this project can be built against Emscripten, using Dawn's \"emdawnwebgpu\"\nimplementation of `webgpu.h` on top of the browser's own WebGPU JavaScript API.\n\nIt currently hasn't been set up to build against\n[wgpu-native](https://github.com/gfx-rs/wgpu-native)'s `webgpu.h` implementation,\nbut that is a goal.\n\n**Check the [issues](https://github.com/kainino0x/webgpu-cross-platform-demo/issues) tab for known issues.**\n\n**Please note the `webgpu.h` API (implemented by Dawn/wgpu-native/Emscripten) and `webgpu_cpp.h` bindings (from Dawn) are not yet stabilized.**\n\n## Open pre-installed VSCode in Browser\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/kainino0x/webgpu-cross-platform-demo)\n\n## Building\n\nInstructions are for Linux/Mac; Windows builds should work, but you need to\nadjust the command syntax accordingly.\n\nThis setup step is always required for native builds.\nFor web builds, it is only strictly needed if you need to rebuild `emdawnwebgpu_pkg` (but\nwithout it, you'll need to build manually with your own emsdk, because `build_all.sh` uses Dawn's).\n\n### Web build\n\nThe web build has been mainly tested with Chrome Canary on Mac, but it should\nwork on any conformant browser and supported platform.\n\nOnce you have an [Emscripten SDK](https://emscripten.org/docs/tools_reference/emsdk.html), you can\nsimply build it using `emcmake`. This will use the snapshot of `emdawnwebgpu` in this repository.\nYou can also get newer releases of `emdawnwebgpu` from \u003chttps://github.com/google/dawn/releases\u003e.\n\n```sh\nmkdir out/web\ncd out/web\npath/to/emcmake cmake ../.. -DDEMO_USE_ASYNCIFY=1  # Add other flags here as desired\nmake -j4\n```\n\nFor development of emdawnwebgpu, there's a script that will build a bunch of\ndifferent variants. To use this, set up the Dawn dependency, which regenerates\n`emdawnwebgpu_pkg`, and then run this script (which uses Dawn's copy of emsdk):\n\n```sh\n./setup_build.sh --checkout=1\n./build_web_many_configs.sh --parallel=0\n```\n\n### Native build\n\nBuild has been tested on Linux/Mac/Win10 (though may be broken on some platforms).\n\n```sh\nmkdir -p out/native\ncd out/native\n\n# Using Make:\ncmake ../..  # Add -DCMAKE_BUILD_TYPE=Release, -DDEMO_USE_GLFW=OFF, etc. here as desired\nmake clean\nmake -j4 all\n\n# Or, to use Ninja instead of Make:\ncmake -GNinja ../..  # Add flags here as desired\nninja\n```\n\nNote: If you want to have window displayed, make sure to have glfw available.\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to config glfw package on each platform?\u003c/summary\u003e\n\n  - Linux\n    ```sh\n    apt-get install libglfw3-dev\n    ```\n  - macOS\n    ```sh\n    brew install glfw\n    ```\n  - Win\n    - Manually\n        - Download glfw source package and windows pre-compiled binaries from [here](https://www.glfw.org/download)\n        - Unzip (e.g. version 3.3.8) `glfw-3.3.8.zip` to `C:/Program Files (x86)/glfw/`\n        - Unzip (e.g. version 3.3.8) `glfw-3.3.8.bin.WIN64.zip` and put `lib-vc2022` to `C:/Program Files (x86)/glfw/lib-vc2022` (assume you are using Visual Studio 2022 to build)\n        - You are done. `cmake/modules/Findglfw3.cmake` is used to find them (You can edit the path it uses)\n    - vcpkg\n        - Here is a fork that uses vcpkg to manage glfw: [link](https://github.com/bitsauce/webgpu-cross-platform-demo)\n\u003c/details\u003e\n\n\nAlternatively, you can disable using glfw and window display by\n\n```sh\ncmake ../.. -DDEMO_USE_GLFW=OFF\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkainino0x%2Fwebgpu-cross-platform-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkainino0x%2Fwebgpu-cross-platform-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkainino0x%2Fwebgpu-cross-platform-demo/lists"}