Starter project for cross platform WebGPU development in C++

Overview

WebGPU C++ Starter Project

A starter code for cross-platform (i.e., web & native) C++ WebGPU projects.

Building for Web with Emscripten

You can build the project using Emscripten's CMake wrapper. The VulkanSDK is required to provide glslc to compile shaders to SPV. This path should be to the specific version of Vulkan you have installed, e.g., -DVULKAN_SDK=/VulkanSDK/. On macOS you must also specify the macOS subdirectory after the version. The Vulkan requirement may be removed in the future if SPV support is removed from WebGPU and replaced with WGSL.

mkdir emcmake-build
emcmake cmake .. -DVULKAN_SDK=
cmake --build .

You can then run a webserver in the build directory and view the application in a browser that supports WebGPU.

python3 -m http.server
# navigate to localhost:8000 to see the triangle!

Building for Native with Dawn

The application uses Dawn to provide an implementation of WebGPU for native platforms. Carl Woffenden has a good guide about building Dawn which you can follow to build Dawn. Note: right now this builds against Dawn at tag: origin/chromium/4505.

You can then build a native application with CMake, passing the location where you build Dawn and the VulkanSDK (required to compile shaders to SPV). SDL2 is also required to provide cross-platform windowing support, on Windows you can install it via vcpkg and specify -DCMAKE_TOOLCHAIN_FILE to find the installation.

mkdir cmake-build
cmake .. -DVULKAN_SDK= `
         -DDawn_DIR= `
         -DCMAKE_TOOLCHAIN_FILE=
cmake --build .

If on Windows copy over the dll's in Dawn's build directory, and you can then run the native app. On Mac or Linux, the dylibs/sos just need to be in the path of the executable.

Then on Windows you can run:

.//wgpu-starter.exe

Or on Mac/Linux:

./wgpu-starter
Issues
  • Could NOT find Dawn

    Could NOT find Dawn

    [build] CMake Error at /usr/local/Cellar/cmake/3.22.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): [build] Could NOT find Dawn (missing: DAWN_NATIVE_LIBRARY DAWN_PLATFORM_LIBRARY [build] DAWN_PROC_LIBRARY) [build] Call Stack (most recent call first): [build] /usr/local/Cellar/cmake/3.22.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) [build] cmake/FindDawn.cmake:51 (find_package_handle_standard_args) [build] CMakeLists.txt:28 (find_package)

    opened by raegnar 3
Owner
Will Usher
Will Usher
Pitchfork is a Set of C++ Project Conventions

Pitchfork Pitchfork is a set of conventions for native C and C++ projects. The most prominent being the project layout conventions. The layout specifi

null 678 Jun 17, 2022
[WIP] Demo of a minimal but functional Dawn-based WebGPU client and server

dawn client-server example The goal of this demo is to create a minimal but functional Dawn-based WebGPU client and server with the following traits:

Rasmus 15 Nov 20, 2021
Dawn a WebGPU implementation

Dawn is an open-source and cross-platform implementation of the work-in-progress WebGPU standard.

Hexops 9 Apr 9, 2022
U++ is a C++ cross-platform rapid application development framework focused on programmer's productivity. It includes a set of libraries (GUI, SQL, Network etc.), and integrated development environment (TheIDE).

Ultimate++ Ultimate++ is a C++ cross-platform rapid application development framework focused on programmers productivity. It includes a set of librar

Ultimate++ 454 Jun 25, 2022
A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs.

webview for golang and c/c++ A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. The goal of the project is to

polevpn 12 Jun 7, 2022
Arduino sample code to help you get started using the Soracom IoT Starter Kit!

Soracom IoT Starter Kit The Soracom IoT Starter Kit includes everything you need to build your first connected device. It includes an Arduino MKR GSM

Soracom Labs 13 Feb 22, 2022
This repository contains notes and starter code for Bit manipulation and mathematics session for DSA bootcamp organized by Codeflows.

Bitmanipulation_maths This repository contains notes and starter code for Bit manipulation and mathematics session for DSA bootcamp organized by Codef

Joe 7 Jun 15, 2022
multispectral monitoring of a sourdough starter; esp32 eink module, scd30 co2 sensor, vl6180 distance sensor

EINK STARTER MONITOR See full blogpost here Tracks height of starter with a VL6180 i2c distance sensor, and CO2/temperature/humidity with an SCD30. A

AKA 15 Feb 16, 2022
OpenGL®-Starter is a template for your upcoming OpenGL Projects which has been compiled to run the most basic Hello World OpenGL Program from LearnOpenGL.com.

OpenGL®-Starter OpenGL®-Starter is a template for your upcoming OpenGL Projects which has been compiled to run the most basic Hello World OpenGL Progr

Kushagra 8 May 27, 2022
A CMake starter template using CPM

Cmake Starter About A lightweight Cmake project meant for a binary application (not a shared library), tests with catch2 are configured, CPM is the pa

Matt Williams 1 Mar 24, 2022
jai programming language starter kit (minimal modules)

jai starter kit modules jai programming language starter kit (minimal modules) Modules List sk_Window : minimal window creation and input module. sk_B

null 4 Jan 20, 2022
jai programming language starter kit (minimal modules)

jai starter kit modules jai programming language starter kit (minimal modules) Modules List sk_Window : minimal window creation and input module. sk_B

null 4 Jan 20, 2022
✖🌱 A DirectX 12 starter repo that you could use to get the ball rolling.

DirectX 12 Seed A DirectX 12 repo you can use to get started with your own renderer. Setup First install: Git CMake Visual Studio Then type the follow

Alain Galvan 60 May 10, 2022
Purely native C++ cross-platform GUI framework for Android and iOS development. https://www.boden.io

BODEN CROSS-PLATFORM FRAMEWORK Build purely native cross-platform experiences with Boden Website ⬡ Getting Started ⬡ API Reference ⬡ Guides ⬡ Twitter

Ashampoo Systems GmbH & Co KG 1.5k Jun 26, 2022
Cross-platform malware development library for anti-analysis techniques

The Anti-Analysis Menagerie Cross-platform malware development library for anti-analysis techniques. Design Goals Provide a rich and convenient interf

Alan 19 Jun 23, 2022
Cocos2d-x is a suite of open-source, cross-platform, game-development tools used by millions of developers all over the world.

Cocos2d-x is a suite of open-source, cross-platform, game-development tools used by millions of developers all over the world.

cocos2d 16.2k Jun 20, 2022
🎮 Cross platform development kit for Z80 and SM83 based consoles.

cdk ?? Cross platform development kit for Z80 and SM83 based consoles. Platform We planned to support the following consoles: Nintendo Game Boy Ninten

Micro Console 4 Jan 10, 2022
cdk is a minimal cross-platform c language development kit.

Overview cdk is a minimal cross-platform c language development kit. Requirement Based on c11 standard. Compile create a build directory under the cdk

Red 18 Jun 10, 2022
Mastering-Cpp-Game-Development - Code files for Mastering C++ Game Development, published by Packt

Mastering C++ Game Development This is the code repository for Mastering C++ Game Development, published by Packt. It contains all the supporting proj

Packt 62 May 26, 2022
Microsoft 2.4k Jun 27, 2022
The Leap Motion cross-format, cross-platform declarative serialization library

Introduction to LeapSerial LeapSerial is a cross-format, declarative, serialization and deserialization library written and maintained by Leap Motion.

Leap Motion (Ultraleap) 15 Jan 17, 2022
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Alex Dixon 273 Jun 10, 2022
The C++ Network Library Project -- cross-platform, standards compliant networking library.

C++ Network Library Modern C++ network programming libraries. Join us on Slack: http://slack.cpp-netlib.org/ Subscribe to the mailing list: https://gr

C++ Network Library 1.9k Jun 10, 2022
Android studio native project template using cross platform raylib graphics library.

rayturbo Android studio native project template using cross platform raylib graphics library. https://www.raylib.com/ This project use Android Studio

Ciapas Linux 10 Mar 5, 2022
A simple, cross-platform, and continuously integrated C++14 project template

Project Name A simple, cross-platform, and continuously integrated C++14 project template. Making cross platform C++ projects is widely known to be a

Arnav Borborah 64 May 1, 2022
Template for reliable, cross-platform C++ project setup using cmake.

The C++ CMake Project Template cmake-init is a sophisticated copy & paste template for modern C and C++ projects. The main goals include support of al

CG Internals 771 Jun 21, 2022
Arduino-compatible development platform whose primary function is a clock

MakeTime Arduino-compatible development platform whose primary function is a clock Description MakeTime is a clock that uses a ring of 24 RGB LEDs to

null 3 Oct 11, 2021
Repository for the taproot-based rewrite of our 2021 development platform

taproot-mdev2021 This is a blank project fully configured for use of Taproot. It is designed to be a starting point for your own RoboMaster software p

TAMU Robomasters 26 Jun 18, 2022