From 78a83614ad416f001d207625f050d40868f75246 Mon Sep 17 00:00:00 2001 From: Elie Michel Date: Sat, 2 Mar 2024 11:44:24 +0100 Subject: [PATCH 1/2] Add details to readme --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index a4bce1c2..833190fd 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,31 @@ Implementations of this header include: - [Dawn](https://dawn.googlesource.com/dawn), Chromium's C++ WebGPU implementation library - [wgpu-native](https://github.com/gfx-rs/wgpu-native), Firefox's Rust WebGPU implementation library - [Emscripten](https://github.com/emscripten-core/emscripten/blob/main/src/library_webgpu.js) translates [webgpu.h](./webgpu.h) calls to JavaScript WebGPU calls when compiling to WASM + +## Details + +Here are some details about the structure of this repository. + +### Main files + + - `webgpu.h` is the one and only header file that defines the WebGPU C API. Only this needs to be integrated in a C project that links against a WebGPU implementation. + + - `webgpu.yml` is the main machine-readable source of truth for the C API and its documentation (in [YAML](https://yaml.org/) format). It is used to generate the official `webgpu.h` header present in this repository, (will be used) to generate the official documentation, and may be used by any other third party to designe tools and wrappers around WebGPU. + + - `schema.json` is the [JSON schema](https://json-schema.org/) that formally specifies the structure of `webgpu.yml`. + +### Generator + + - `Makefile` defines the rules to automatically generate `webgpu.h` from `webgpu.yml` and check the result. + + - `gen/` and the `go.*` files are the source code of the generator called by the `Makefile`. + + - `tests/compile` is used to check that the generated C header is indeed valid C/C++ code. + +### Workflows + + - `.github/workflows` defines the automated processes that run upon new commits/PR, to check that changes in `webgpu.yml` and `webgpu.h` are consistent. + +## Contributing + +**Important** When submitting a change, one must modify both the `webgpu.yml` and `webgpu.h` files in a consistent way. One should first edit `webgpu.yml` (the source of truth), then run `make gen` to update `webgpu.h` and finally commit both changes together. From ef7d1d368fce32850350ccc18aa31b322798d97a Mon Sep 17 00:00:00 2001 From: Elie Michel Date: Mon, 4 Mar 2024 21:51:48 +0100 Subject: [PATCH 2/2] Update README.md Co-authored-by: Rajesh Malviya --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 833190fd..a72ce73a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Here are some details about the structure of this repository. - `webgpu.h` is the one and only header file that defines the WebGPU C API. Only this needs to be integrated in a C project that links against a WebGPU implementation. - - `webgpu.yml` is the main machine-readable source of truth for the C API and its documentation (in [YAML](https://yaml.org/) format). It is used to generate the official `webgpu.h` header present in this repository, (will be used) to generate the official documentation, and may be used by any other third party to designe tools and wrappers around WebGPU. + - `webgpu.yml` is the main machine-readable source of truth for the C API and its documentation (in [YAML](https://yaml.org/) format). It is used to generate the official `webgpu.h` header present in this repository, (will be used) to generate the official documentation, and may be used by any other third party to design tools and wrappers around WebGPU-Native. - `schema.json` is the [JSON schema](https://json-schema.org/) that formally specifies the structure of `webgpu.yml`.