react-native-wgpu 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,8 +49,13 @@ template <> struct JSIConverter<std::shared_ptr<ArrayBuffer>> {
49
49
  auto buff = bufferProp.getObject(runtime);
50
50
  auto bytesPerElements =
51
51
  obj.getProperty(runtime, "BYTES_PER_ELEMENT").asNumber();
52
- return createArrayBufferFromJSI(
53
- runtime, buff.getArrayBuffer(runtime),
52
+ auto arrayBuffer = buff.getArrayBuffer(runtime);
53
+ auto byteOffset = static_cast<size_t>(
54
+ obj.getProperty(runtime, "byteOffset").asNumber());
55
+ auto byteLength = static_cast<size_t>(
56
+ obj.getProperty(runtime, "byteLength").asNumber());
57
+ return std::make_shared<ArrayBuffer>(
58
+ arrayBuffer.data(runtime) + byteOffset, byteLength,
54
59
  static_cast<size_t>(bytesPerElements));
55
60
  }
56
61
  }
@@ -20,7 +20,6 @@ const registerWebGPUForReanimated = () => {
20
20
  }
21
21
  isRegistered = true;
22
22
  try {
23
- // eslint-disable-next-line @typescript-eslint/no-var-requires
24
23
  const {
25
24
  registerCustomSerializable
26
25
  } = require("react-native-worklets");
@@ -1 +1 @@
1
- {"version":3,"names":["isRegistered","registerWebGPUForReanimated","registerCustomSerializable","require","name","determine","value","__webgpuIsWebGPUObject","pack","__webgpuBox","unpack","boxed","unbox","exports"],"sourceRoot":"../../../../src","sources":["external/reanimated/registerWebGPUForReanimated.ts"],"mappings":";;;;;;AAAA;;AAMA,IAAIA,YAAY,GAAG,KAAK;;AAExB;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,2BAA2B,GAAGA,CAAA,KAAM;EAC/C,IAAID,YAAY,EAAE;IAChB;EACF;EACAA,YAAY,GAAG,IAAI;EAEnB,IAAI;IACF;IACA,MAAM;MAAEE;IAA2B,CAAC,GAAGC,OAAO,CAAC,uBAAuB,CAAC;IAEvED,0BAA0B,CAAC;MACzBE,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAGC,KAAa,IAAsB;QAC7C,SAAS;;QACT,OAAOC,sBAAsB,CAACD,KAAK,CAAC;MACtC,CAAC;MACDE,IAAI,EAAGF,KAAa,IAAK;QACvB,SAAS;;QACT,OAAOG,WAAW,CAACH,KAAK,CAAC;MAC3B,CAAC;MACDI,MAAM,EAAGC,KAA8B,IAAK;QAC1C,SAAS;;QACT,OAAOA,KAAK,CAACC,KAAK,CAAC,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC;AAACC,OAAA,CAAAZ,2BAAA,GAAAA,2BAAA","ignoreList":[]}
1
+ {"version":3,"names":["isRegistered","registerWebGPUForReanimated","registerCustomSerializable","require","name","determine","value","__webgpuIsWebGPUObject","pack","__webgpuBox","unpack","boxed","unbox","exports"],"sourceRoot":"../../../../src","sources":["external/reanimated/registerWebGPUForReanimated.ts"],"mappings":";;;;;;AAAA;;AAOA,IAAIA,YAAY,GAAG,KAAK;;AAExB;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,2BAA2B,GAAGA,CAAA,KAAM;EAC/C,IAAID,YAAY,EAAE;IAChB;EACF;EACAA,YAAY,GAAG,IAAI;EAEnB,IAAI;IACF,MAAM;MAAEE;IAA2B,CAAC,GAAGC,OAAO,CAAC,uBAAuB,CAAC;IAEvED,0BAA0B,CAAC;MACzBE,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAGC,KAAa,IAAsB;QAC7C,SAAS;;QACT,OAAOC,sBAAsB,CAACD,KAAK,CAAC;MACtC,CAAC;MACDE,IAAI,EAAGF,KAAa,IAAK;QACvB,SAAS;;QACT,OAAOG,WAAW,CAACH,KAAK,CAAC;MAC3B,CAAC;MACDI,MAAM,EAAGC,KAA8B,IAAK;QAC1C,SAAS;;QACT,OAAOA,KAAK,CAACC,KAAK,CAAC,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC;AAACC,OAAA,CAAAZ,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -14,7 +14,6 @@ export const registerWebGPUForReanimated = () => {
14
14
  }
15
15
  isRegistered = true;
16
16
  try {
17
- // eslint-disable-next-line @typescript-eslint/no-var-requires
18
17
  const {
19
18
  registerCustomSerializable
20
19
  } = require("react-native-worklets");
@@ -1 +1 @@
1
- {"version":3,"names":["isRegistered","registerWebGPUForReanimated","registerCustomSerializable","require","name","determine","value","__webgpuIsWebGPUObject","pack","__webgpuBox","unpack","boxed","unbox"],"sourceRoot":"../../../../src","sources":["external/reanimated/registerWebGPUForReanimated.ts"],"mappings":"AAAA;;AAMA,IAAIA,YAAY,GAAG,KAAK;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,GAAGA,CAAA,KAAM;EAC/C,IAAID,YAAY,EAAE;IAChB;EACF;EACAA,YAAY,GAAG,IAAI;EAEnB,IAAI;IACF;IACA,MAAM;MAAEE;IAA2B,CAAC,GAAGC,OAAO,CAAC,uBAAuB,CAAC;IAEvED,0BAA0B,CAAC;MACzBE,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAGC,KAAa,IAAsB;QAC7C,SAAS;;QACT,OAAOC,sBAAsB,CAACD,KAAK,CAAC;MACtC,CAAC;MACDE,IAAI,EAAGF,KAAa,IAAK;QACvB,SAAS;;QACT,OAAOG,WAAW,CAACH,KAAK,CAAC;MAC3B,CAAC;MACDI,MAAM,EAAGC,KAA8B,IAAK;QAC1C,SAAS;;QACT,OAAOA,KAAK,CAACC,KAAK,CAAC,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["isRegistered","registerWebGPUForReanimated","registerCustomSerializable","require","name","determine","value","__webgpuIsWebGPUObject","pack","__webgpuBox","unpack","boxed","unbox"],"sourceRoot":"../../../../src","sources":["external/reanimated/registerWebGPUForReanimated.ts"],"mappings":"AAAA;;AAOA,IAAIA,YAAY,GAAG,KAAK;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,GAAGA,CAAA,KAAM;EAC/C,IAAID,YAAY,EAAE;IAChB;EACF;EACAA,YAAY,GAAG,IAAI;EAEnB,IAAI;IACF,MAAM;MAAEE;IAA2B,CAAC,GAAGC,OAAO,CAAC,uBAAuB,CAAC;IAEvED,0BAA0B,CAAC;MACzBE,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAGC,KAAa,IAAsB;QAC7C,SAAS;;QACT,OAAOC,sBAAsB,CAACD,KAAK,CAAC;MACtC,CAAC;MACDE,IAAI,EAAGF,KAAa,IAAK;QACvB,SAAS;;QACT,OAAOG,WAAW,CAACH,KAAK,CAAC;MAC3B,CAAC;MACDI,MAAM,EAAGC,KAA8B,IAAK;QAC1C,SAAS;;QACT,OAAOA,KAAK,CAACC,KAAK,CAAC,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../commonjs/external/reanimated/registerWebGPUForReanimated.js"],"names":[],"mappings":";AAUA;;;;;GAKG;AACH,oDA+BC"}
1
+ {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../commonjs/external/reanimated/registerWebGPUForReanimated.js"],"names":[],"mappings":";AAUA;;;;;GAKG;AACH,oDA8BC"}
@@ -1 +1 @@
1
- {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../module/external/reanimated/registerWebGPUForReanimated.js"],"names":[],"mappings":"AAUO,oDA+BN"}
1
+ {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../module/external/reanimated/registerWebGPUForReanimated.js"],"names":[],"mappings":"AAUO,oDA8BN"}
@@ -1 +1 @@
1
- {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../src/external/reanimated/registerWebGPUForReanimated.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YA4BvC,CAAC"}
1
+ {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../src/external/reanimated/registerWebGPUForReanimated.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YA2BvC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wgpu",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "React Native WebGPU",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -6,7 +6,7 @@ type ImportType = ReturnType<typeof require>;
6
6
  * This is useful for lazily requiring optional dependencies.
7
7
  */
8
8
  export const createModuleProxy = <TModule>(
9
- getModule: () => ImportType
9
+ getModule: () => ImportType,
10
10
  ): TModule => {
11
11
  const holder: { module: TModule | undefined } = { module: undefined };
12
12
 
@@ -1,8 +1,9 @@
1
1
  // Declare global WebGPU worklet helper functions (installed by native module)
2
2
  declare function __webgpuIsWebGPUObject(obj: unknown): boolean;
3
- declare function __webgpuBox(
4
- obj: object
5
- ): { unbox: () => object; __boxedWebGPU: true };
3
+ declare function __webgpuBox(obj: object): {
4
+ unbox: () => object;
5
+ __boxedWebGPU: true;
6
+ };
6
7
 
7
8
  let isRegistered = false;
8
9
 
@@ -19,7 +20,6 @@ export const registerWebGPUForReanimated = () => {
19
20
  isRegistered = true;
20
21
 
21
22
  try {
22
- // eslint-disable-next-line @typescript-eslint/no-var-requires
23
23
  const { registerCustomSerializable } = require("react-native-worklets");
24
24
 
25
25
  registerCustomSerializable({
@@ -35,6 +35,6 @@ if (typeof RNWebGPU !== "undefined") {
35
35
  global.createImageBitmap ?? RNWebGPU.createImageBitmap.bind(RNWebGPU);
36
36
  } else {
37
37
  console.warn(
38
- `[react-native-wgpu] install() returned ${_installOk} but RNWebGPU global is not available`
38
+ `[react-native-wgpu] install() returned ${_installOk} but RNWebGPU global is not available`,
39
39
  );
40
40
  }