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
16 changes: 0 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
!packages/webgpu/scripts/build
# Yarn
.package/.yarn/*
.yarn/*
!.yarn/patches
!.yarn/plugins
Expand Down Expand Up @@ -59,23 +57,9 @@ buck-out/

# Build
dist
package/lib
.vscode
*.tgz


# Externals
packages/webgpu/libs
# Dawn headers used to be copied here; the directory only holds the
# vendored Dawn sources under common/ now (see scripts/check-dawn.ts).
packages/webgpu/cpp/dawn/*
!packages/webgpu/cpp/dawn/common/
packages/webgpu/cpp/webgpu/
packages/webgpu/lib
!packages/webgpu/scripts/build
artifacts/


# Cocoapods
#
apps/example/**/Pods
Expand Down
8 changes: 2 additions & 6 deletions packages/webgpu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"clang-format-ios": "find apple/ -iname \"*.h\" -o -iname \"*.mm\" -o -iname \"*.cpp\" | xargs clang-format -i",
"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 .",
"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=android/.cxx --exclude=cpp/dawn --exclude=libs --exclude=android/build --exclude=node_modules --recursive .",
"check-dawn": "tsx scripts/check-dawn.ts"
},
"keywords": [
Expand Down Expand Up @@ -80,9 +80,7 @@
"@types/seedrandom": "^3.0.8",
"@types/ws": "^8.5.10",
"@webgpu/types": "0.1.65",
"baseline-browser-mapping": "^2.9.14",
"clang-format": "^1.8.0",
"del-cli": "^5.1.0",
"eslint": "9.35.0",
"eslint-config-react-native-wcandillon": "5.0.1",
"eslint-plugin-import": "2.32.0",
Expand All @@ -99,7 +97,6 @@
"react-native-reanimated": "4.6.0",
"react-native-web": "^0.21.2",
"react-native-worklets": "0.12.2",
"rimraf": "^5.0.7",
"seedrandom": "^3.0.5",
"semantic-release": "^25.0.9",
"semantic-release-yarn": "^3.0.2",
Expand All @@ -108,8 +105,7 @@
"typescript": "^5.2.2",
"webgpu": "0.4.0",
"wgpu-matrix": "^3.0.2",
"ws": "^8.18.0",
"yargs": "^17.7.2"
"ws": "^8.18.0"
},
"dependencies": {
"react-native-webgpu-dawn": "157.1.0"
Expand Down
23 changes: 22 additions & 1 deletion packages/webgpu/scripts/check-dawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Runs from `yarn check-dawn`, in CI right after `yarn install`.

import { existsSync, readFileSync } from "fs";
import { existsSync, readFileSync, readdirSync } from "fs";
import { dirname, join } from "path";

const dawnPackageJson =
Expand Down Expand Up @@ -49,6 +49,27 @@ const dawnWorkarounds = [
];

const root = join(__dirname, "..");

// Until #507 the build copied Dawn's headers into cpp/webgpu and cpp/dawn.
// Both come before the package's include directory on every include path
// (podspec HEADER_SEARCH_PATHS, android/CMakeLists.txt), so a copy left over
// from that build silently shadows the headers the binaries were built from.
// cpp/dawn/common is vendored on purpose (see the entry above).
const staleHeaderDirs = [
"cpp/webgpu",
...(existsSync(join(root, "cpp/dawn"))
? readdirSync(join(root, "cpp/dawn"))
.filter((entry) => entry !== "common" && !entry.startsWith("."))
.map((entry) => `cpp/dawn/${entry}`)
: []),
].filter((dir) => existsSync(join(root, dir)));
if (staleHeaderDirs.length > 0) {
console.error(
`❌ Stale Dawn header copies shadow react-native-webgpu-dawn's include directory: ${staleHeaderDirs.join(", ")}. Delete them; Dawn's headers come from the package since #507.`,
);
process.exit(1);
}

let failed = false;
for (const workaround of dawnWorkarounds) {
const present = workaround.files.filter((file) => {
Expand Down
Loading
Loading