Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,7 @@ runs:
run: yarn install --immutable
shell: bash

- name: Download Dawn Binary Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-dawn.yml"
repo: wcandillon/react-native-webgpu
github_token: ${{ inputs.github_token }}
path: artifacts
branch: main
name: dawn-libs

- name: Copy Artifacts to libs folder
- name: Install Dawn
working-directory: packages/webgpu
shell: bash
run: yarn copy-artifacts
run: yarn install-dawn
45 changes: 0 additions & 45 deletions .github/workflows/build-dawn.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ jobs:
- name: Typecheck files
run: yarn tsc

- name: Codegen
working-directory: packages/webgpu
run: yarn codegen

test:
runs-on: macos-latest
steps:
Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,27 +212,25 @@ git submodule update --init

Make sure you have all the tools required for building the Skia libraries (Android Studio, XCode, Ninja, CMake, Android NDK/build tools).

### Building Dawn

```sh
yarn
cd packages/webgpu
yarn build-dawn
```

### Downloading Dawn

There is an alternative way which is to download the prebuilt binaries from GitHub.
You need to have the [Github CLI](https://cli.github.com/) installed:

```sh
$ yarn
$ cd packages/webgpu
$ yarn download-artifacts
$ yarn copy-artifacts
$ yarn install-dawn
```

Alternatively you can also download the prebuilt binaries [here](https://github.com/wcandillon/react-native-webgpu/actions/workflows/build-dawn.yml).
### Building Dawn

Alternatively, you can build Dawn locally.

```sh
yarn
cd packages/webgpu
yarn build-dawn
```

### Upgrading

Expand Down
4 changes: 2 additions & 2 deletions apps/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ PODS:
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- react-native-wgpu (0.2.9):
- react-native-wgpu (0.2.10):
- boost
- DoubleConversion
- fast_float
Expand Down Expand Up @@ -2903,7 +2903,7 @@ SPEC CHECKSUMS:
React-microtasksnativemodule: 75b6604b667d297292345302cc5bfb6b6aeccc1b
react-native-safe-area-context: c6e2edd1c1da07bdce287fa9d9e60c5f7b514616
react-native-skia: 5bf2b2107cd7f2d806fd364f5e16b1c7554ed3cd
react-native-wgpu: 6b98abaead58c53560720db8074bb82b29edd9a8
react-native-wgpu: 9c80c820813ecb17fe331794180a00fb21a33af2
React-NativeModulesApple: 879fbdc5dcff7136abceb7880fe8a2022a1bd7c3
React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d
React-perflogger: 5536d2df3d18fe0920263466f7b46a56351c0510
Expand Down
1 change: 0 additions & 1 deletion packages/webgpu/cpp/rnwgpu/api/GPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "AsyncRunner.h"

#include "dawn/dawn_proc.h"
#include "dawn/native/DawnNative.h"
#include "webgpu/webgpu_cpp.h"

Expand Down
6 changes: 5 additions & 1 deletion packages/webgpu/cpp/rnwgpu/api/GPUCanvasContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
#include <memory>

#ifdef __APPLE__
#include "dawn/native/MetalBackend.h"
namespace dawn::native::metal {

void WaitForCommandsToBeScheduled(WGPUDevice device);

}
#endif

namespace rnwgpu {
Expand Down
4 changes: 2 additions & 2 deletions packages/webgpu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"libs/**",
"*.podspec"
],
"dawn": "chromium/7472",
"scripts": {
"test": "NODE_OPTIONS='--experimental-require-module' jest -i",
"test:ref": "REFERENCE=true NODE_OPTIONS='--experimental-require-module' jest -i",
Expand All @@ -32,8 +33,7 @@
"clang-format-android": "find android/cpp/ -iname \"*.h\" -o -iname \"*.m\" -o -iname \"*.cpp\" | xargs clang-format -i",
"clang-format-common": "find cpp/rnwgpu -iname \"*.h\" -o -iname \"*.m\" -o -iname \"*.cpp\" | xargs clang-format -i",
"cpplint": "cpplint --linelength=230 --filter=-legal/copyright,-whitespace/indent,-whitespace/comments,-whitespace/ending_newline,-build/include_order,-runtime/references,-readability/todo,-whitespace/blank_line,-whitespace/todo,-runtime/int,-build/c++11,-whitespace/parens --exclude=example --exclude=android/.cxx --exclude=cpp/webgpu --exclude=cpp/dawn --exclude=ios --exclude=android/build --exclude=node_modules --recursive .",
"download-artifacts": "tsx scripts/build/download-artifacts.ts && yarn copy-artifacts",
"copy-artifacts": "tsx scripts/build/copy-artifacts.ts",
"install-dawn": "tsx scripts/install-dawn.ts",
"codegen": "tsx scripts/codegen/codegen.ts && yarn clang-format"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/webgpu/scripts/build/dawn-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ export const checkBuildArtifacts = () => {
libs.forEach((lib) => {
checkFileExists(`libs/apple/${lib}.xcframework`);
});
checkFileExists("libs/dawn.json");
//checkFileExists("libs/dawn.json");
};
5 changes: 4 additions & 1 deletion packages/webgpu/scripts/codegen/model/dawn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import _ from "lodash";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import dawn from "../../../libs/dawn.json";

export const mapKeys = <T extends object>(obj: T) =>
Expand Down Expand Up @@ -222,7 +224,8 @@ export const resolveNative = (
if (!hasPropery(object, "methods")) {
return null;
}
return object.methods.find((m) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (object.methods as any).find((m: any) => {
return _.camelCase(m.name.toLowerCase()) === methodName;
});
};
Expand Down
Loading