Skip to content

Commit

Permalink
Fix regressions (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Sep 1, 2024
1 parent 0934114 commit 1481bb9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
6 changes: 3 additions & 3 deletions apps/paper/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-wgpu (0.1.3):
- react-native-wgpu (0.1.5):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1545,7 +1545,7 @@ SPEC CHECKSUMS:
React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326
react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a
react-native-skia: 8da84ea9410504bf27f0db229539a43f6caabb6a
react-native-wgpu: 220ca988d2907efab8b1111f81682d9af957a98d
react-native-wgpu: a7cafd1960f61fa2fca1ddd478553f0950052f0a
React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1
React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0
React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994
Expand Down Expand Up @@ -1573,7 +1573,7 @@ SPEC CHECKSUMS:
RNReanimated: abb16e70ea4fbd72c667946caa3abd0f962897f6
RNScreens: aa943ad421c3ced3ef5a47ede02b0cbfc43a012e
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: 2f71ecf38d934aecb366e686278102a51679c308
Yoga: ae3c32c514802d30f687a04a6a35b348506d411f

PODFILE CHECKSUM: 6a64c4e2f4165ecd7371d7daca36d1c129d3e06d

Expand Down
4 changes: 2 additions & 2 deletions packages/webgpu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-wgpu",
"version": "0.1.4",
"version": "0.1.5",
"description": "React Native WebGPU",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -34,7 +34,7 @@
"lint": "eslint . --ext .ts,.tsx --max-warnings 0 --cache --fix",
"prepare": "bob build",
"build-dawn": "ts-node scripts/build/dawn.ts",
"clean-dawn": "rimraf ./libs && rimraf ../externals/dawn/out",
"clean-dawn": "rimraf ./libs && rimraf ../../externals/dawn/out",
"clang-format": "yarn clang-format-ios && yarn clang-format-android && yarn clang-format-common",
"clang-format-ios": "find ios/ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/webgpu/react-native-wgpu.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Pod::Spec.new do |s|
'libs/ios/libwebgpu_dawn.xcframework',
]

s.visionos.vendored_frameworks = [
'libs/ios/libwebgpu_dawn_visionos.xcframework',
]

s.pod_target_xcconfig = {
'HEADER_SEARCH_PATHS' => '$(PODS_TARGET_SRCROOT)/cpp',
}
Expand Down
6 changes: 5 additions & 1 deletion packages/webgpu/scripts/build/dawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ const ios = {
"xcodebuild -create-xcframework " +
`-library ${projectRoot}/libs/ios/${lib}.a ` +
`-library ${projectRoot}/libs/ios/arm64_iphoneos/${lib}.a ` +
` -output ${projectRoot}/libs/ios/${lib}.xcframework `,
);
$(
"xcodebuild -create-xcframework " +
`-library ${projectRoot}/libs/ios/${lib}_visionos.a ` +
`-library ${projectRoot}/libs/ios/arm64_xros/${lib}.a ` +
` -output ${projectRoot}/libs/ios/${lib}.xcframework `,
` -output ${projectRoot}/libs/ios/${lib}_visionos.xcframework `,
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/webgpu/scripts/build/ios.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ list(APPEND _supported_platforms
"TVOS" "TVOSCOMBINED" "SIMULATOR_TVOS" "SIMULATORARM64_TVOS"
"WATCHOS" "WATCHOSCOMBINED" "SIMULATOR_WATCHOS" "SIMULATORARM64_WATCHOS"
"MAC" "MAC_ARM64" "MAC_UNIVERSAL"
"VISIONOS" "SIMULATOR_VISIONOS" "VISIONOSCOMBINED", "SIMULATOR64_VISIONOS"
"VISIONOS" "SIMULATOR_VISIONOS" "VISIONOSCOMBINED" "SIMULATOR64_VISIONOS"
"MAC_CATALYST" "MAC_CATALYST_ARM64")

# Cache what generator is used
Expand Down
13 changes: 8 additions & 5 deletions packages/webgpu/src/__tests__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,15 @@ class ReferenceTestingClient implements TestingClient {
if (!this.page) {
throw new Error("RemoteSurface not initialized");
}
const fTexturePath = path.join(__dirname, "../../example/src/assets/f.png");
const fTexturePath = path.join(
__dirname,
"../../../../apps/paper/src/assets/f.png",
);
const fTextureData = fs.readFileSync(fTexturePath);
const fTextureBase64 = `data:image/png;base64,${fTextureData.toString("base64")}`;
const source = `(async function Main(){
var global = window;
const r = () => {${fs.readFileSync(path.join(__dirname, "../../node_modules/wgpu-matrix/dist/3.x/wgpu-matrix.js"), "utf8")} };
const r = () => {${fs.readFileSync(path.join(__dirname, "../../../../node_modules/wgpu-matrix/dist/3.x/wgpu-matrix.js"), "utf8")} };
r();
const { mat4, vec3, mat3 } = window.wgpuMatrix;
const { device, adapter, gpu, cubeVertexArray, triangleVertWGSL, redFragWGSL, di3D, saturn, moon } = window;
Expand Down Expand Up @@ -231,13 +234,13 @@ class ReferenceTestingClient implements TestingClient {
.catch((e) => console.log(e));
await page.waitForNetworkIdle();
const di3D = decodeImage(
path.join(__dirname, "../../example/src/assets/Di-3d.png"),
path.join(__dirname, "../../../../apps/paper/src/assets/Di-3d.png"),
);
const moon = decodeImage(
path.join(__dirname, "../../example/src/assets/moon.png"),
path.join(__dirname, "../../../../apps/paper/src/assets/moon.png"),
);
const saturn = decodeImage(
path.join(__dirname, "../../example/src/assets/saturn.png"),
path.join(__dirname, "../../../../apps/paper/src/assets/saturn.png"),
);
await page.evaluate(
`
Expand Down

0 comments on commit 1481bb9

Please sign in to comment.