react-native-webgpu 0.21.4 → 0.23.0

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.
Files changed (170) hide show
  1. package/README.md +15 -2
  2. package/android/CMakeLists.txt +10 -8
  3. package/android/build.gradle +111 -20
  4. package/android/cpp/AndroidAnimationFrameSource.h +136 -0
  5. package/android/cpp/AndroidPlatformContext.h +55 -0
  6. package/android/cpp/cpp-adapter.cpp +148 -2
  7. package/android/src/main/java/com/webgpu/WebGPUModule.java +21 -4
  8. package/android/src/main/java/com/webgpu/WebGPUNativeBufferView.java +370 -0
  9. package/android/src/main/java/com/webgpu/WebGPUNativeBufferViewManager.java +56 -0
  10. package/android/src/main/java/com/webgpu/WebGPUTextureView.java +21 -0
  11. package/android/src/main/java/com/webgpu/WebGPUVideoPlayer.java +1 -1
  12. package/android/src/main/java/com/webgpu/WebGPUView.java +19 -3
  13. package/android/src/main/java/com/webgpu/WebGPUViewManager.java +10 -0
  14. package/android/src/main/java/com/webgpu/WebGPUViewPackage.java +2 -2
  15. package/android/src/newarch/com/webgpu/WebGPUNativeBufferViewManagerSpec.java +24 -0
  16. package/apple/AppleAnimationFrameSource.mm +208 -0
  17. package/apple/ApplePlatformContext.h +6 -0
  18. package/apple/ApplePlatformContext.mm +73 -0
  19. package/apple/MetalLayerColorSpace.h +17 -0
  20. package/apple/MetalLayerColorSpace.mm +36 -57
  21. package/apple/MetalView.h +4 -0
  22. package/apple/MetalView.mm +14 -0
  23. package/apple/NativeBufferFenceWait.mm +88 -0
  24. package/apple/RNWGUIKit.h +4 -1
  25. package/apple/WebGPUModule.mm +26 -1
  26. package/apple/WebGPUNativeBufferView.h +15 -0
  27. package/apple/WebGPUNativeBufferView.mm +200 -0
  28. package/apple/WebGPUView.h +2 -1
  29. package/apple/WebGPUView.mm +6 -0
  30. package/binaries.json +156 -0
  31. package/cpp/jsi/NativeObject.h +12 -5
  32. package/cpp/rnwgpu/AnimationFrames.cpp +576 -0
  33. package/cpp/rnwgpu/AnimationFrames.h +233 -0
  34. package/cpp/rnwgpu/CanvasColorSpace.h +16 -0
  35. package/cpp/rnwgpu/NativeBufferViewRegistry.cpp +396 -0
  36. package/cpp/rnwgpu/NativeBufferViewRegistry.h +163 -0
  37. package/cpp/rnwgpu/PlatformContext.h +20 -0
  38. package/cpp/rnwgpu/RNWebGPUManager.cpp +17 -4
  39. package/cpp/rnwgpu/SurfaceRegistry.h +26 -30
  40. package/cpp/rnwgpu/api/GPUAdapter.cpp +1 -1
  41. package/cpp/rnwgpu/api/GPUCanvasContext.cpp +41 -3
  42. package/cpp/rnwgpu/api/GPUCanvasContext.h +7 -3
  43. package/cpp/rnwgpu/api/GPUDevice.cpp +16 -131
  44. package/cpp/rnwgpu/api/GPUDevice.h +0 -18
  45. package/cpp/rnwgpu/api/GPUExternalTexture.cpp +35 -3
  46. package/cpp/rnwgpu/api/GPUExternalTexture.h +4 -4
  47. package/cpp/rnwgpu/api/GPUQueue.cpp +1 -1
  48. package/cpp/rnwgpu/api/GPUQueue.h +1 -1
  49. package/cpp/rnwgpu/api/GPUSharedFence.h +1 -0
  50. package/cpp/rnwgpu/api/GPUSharedTextureMemory.cpp +11 -5
  51. package/cpp/rnwgpu/api/GPUSharedTextureMemory.h +21 -2
  52. package/cpp/rnwgpu/api/GPUTexture.h +18 -0
  53. package/cpp/rnwgpu/api/NativeFrameFeatures.h +1 -1
  54. package/cpp/rnwgpu/api/NativeFrameImport.cpp +20 -17
  55. package/cpp/rnwgpu/api/NativeFrameImport.h +31 -20
  56. package/cpp/rnwgpu/api/RNWebGPU.h +201 -3
  57. package/cpp/rnwgpu/api/VideoFrame.h +5 -4
  58. package/cpp/rnwgpu/api/VideoFrameBlit.h +2 -2
  59. package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +21 -14
  60. package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +1 -1
  61. package/cpp/rnwgpu/api/descriptors/GPUSharedTextureMemoryDescriptor.h +17 -9
  62. package/cpp/rnwgpu/async/RuntimeContext.cpp +21 -4
  63. package/cpp/rnwgpu/async/RuntimeContext.h +8 -0
  64. package/lib/commonjs/Canvas.js +33 -1
  65. package/lib/commonjs/Canvas.js.map +1 -1
  66. package/lib/commonjs/NativeBufferView.js +131 -0
  67. package/lib/commonjs/NativeBufferView.js.map +1 -0
  68. package/lib/commonjs/NativeBufferViewNativeComponent.js +10 -0
  69. package/lib/commonjs/NativeBufferViewNativeComponent.js.map +1 -0
  70. package/lib/commonjs/WebGPUViewNativeComponent.js.map +1 -1
  71. package/lib/commonjs/WebGPUViewNativeComponent.web.js +2 -0
  72. package/lib/commonjs/WebGPUViewNativeComponent.web.js.map +1 -1
  73. package/lib/commonjs/animationFrame.js +91 -0
  74. package/lib/commonjs/animationFrame.js.map +1 -0
  75. package/lib/commonjs/index.js +16 -1
  76. package/lib/commonjs/index.js.map +1 -1
  77. package/lib/commonjs/main/index.js +12 -0
  78. package/lib/commonjs/main/index.js.map +1 -1
  79. package/lib/commonjs/mock.js +30 -1
  80. package/lib/commonjs/mock.js.map +1 -1
  81. package/lib/commonjs/video.js +14 -4
  82. package/lib/commonjs/video.js.map +1 -1
  83. package/lib/module/Canvas.js +33 -1
  84. package/lib/module/Canvas.js.map +1 -1
  85. package/lib/module/NativeBufferView.js +122 -0
  86. package/lib/module/NativeBufferView.js.map +1 -0
  87. package/lib/module/NativeBufferViewNativeComponent.js +4 -0
  88. package/lib/module/NativeBufferViewNativeComponent.js.map +1 -0
  89. package/lib/module/WebGPUViewNativeComponent.js.map +1 -1
  90. package/lib/module/WebGPUViewNativeComponent.web.js +2 -0
  91. package/lib/module/WebGPUViewNativeComponent.web.js.map +1 -1
  92. package/lib/module/animationFrame.js +83 -0
  93. package/lib/module/animationFrame.js.map +1 -0
  94. package/lib/module/index.js +1 -0
  95. package/lib/module/index.js.map +1 -1
  96. package/lib/module/main/index.js +1 -0
  97. package/lib/module/main/index.js.map +1 -1
  98. package/lib/module/mock.js +21 -0
  99. package/lib/module/mock.js.map +1 -1
  100. package/lib/module/video.js +11 -2
  101. package/lib/module/video.js.map +1 -1
  102. package/lib/typescript/lib/commonjs/Canvas.d.ts +3 -1
  103. package/lib/typescript/lib/commonjs/Canvas.d.ts.map +1 -1
  104. package/lib/typescript/lib/commonjs/NativeBufferView.d.ts +48 -0
  105. package/lib/typescript/lib/commonjs/NativeBufferView.d.ts.map +1 -0
  106. package/lib/typescript/lib/commonjs/NativeBufferViewNativeComponent.d.ts +5 -0
  107. package/lib/typescript/lib/commonjs/NativeBufferViewNativeComponent.d.ts.map +1 -0
  108. package/lib/typescript/lib/commonjs/WebGPUViewNativeComponent.web.d.ts.map +1 -1
  109. package/lib/typescript/lib/commonjs/animationFrame.d.ts +54 -0
  110. package/lib/typescript/lib/commonjs/animationFrame.d.ts.map +1 -0
  111. package/lib/typescript/lib/commonjs/index.d.ts +2 -0
  112. package/lib/typescript/lib/commonjs/mock.d.ts +12 -0
  113. package/lib/typescript/lib/commonjs/mock.d.ts.map +1 -1
  114. package/lib/typescript/lib/commonjs/video.d.ts +3 -2
  115. package/lib/typescript/lib/commonjs/video.d.ts.map +1 -1
  116. package/lib/typescript/lib/module/Canvas.d.ts +3 -1
  117. package/lib/typescript/lib/module/Canvas.d.ts.map +1 -1
  118. package/lib/typescript/lib/module/NativeBufferView.d.ts +14 -0
  119. package/lib/typescript/lib/module/NativeBufferView.d.ts.map +1 -0
  120. package/lib/typescript/lib/module/NativeBufferViewNativeComponent.d.ts +3 -0
  121. package/lib/typescript/lib/module/NativeBufferViewNativeComponent.d.ts.map +1 -0
  122. package/lib/typescript/lib/module/WebGPUViewNativeComponent.web.d.ts.map +1 -1
  123. package/lib/typescript/lib/module/animationFrame.d.ts +3 -0
  124. package/lib/typescript/lib/module/animationFrame.d.ts.map +1 -0
  125. package/lib/typescript/lib/module/index.d.ts +1 -0
  126. package/lib/typescript/lib/module/main/index.d.ts +1 -0
  127. package/lib/typescript/lib/module/mock.d.ts +14 -0
  128. package/lib/typescript/lib/module/mock.d.ts.map +1 -1
  129. package/lib/typescript/lib/module/video.d.ts +3 -2
  130. package/lib/typescript/lib/module/video.d.ts.map +1 -1
  131. package/lib/typescript/src/Canvas.d.ts +17 -1
  132. package/lib/typescript/src/Canvas.d.ts.map +1 -1
  133. package/lib/typescript/src/NativeBufferView.d.ts +99 -0
  134. package/lib/typescript/src/NativeBufferView.d.ts.map +1 -0
  135. package/lib/typescript/src/NativeBufferViewNativeComponent.d.ts +13 -0
  136. package/lib/typescript/src/NativeBufferViewNativeComponent.d.ts.map +1 -0
  137. package/lib/typescript/src/WebGPUViewNativeComponent.d.ts +2 -0
  138. package/lib/typescript/src/WebGPUViewNativeComponent.d.ts.map +1 -1
  139. package/lib/typescript/src/WebGPUViewNativeComponent.web.d.ts +2 -0
  140. package/lib/typescript/src/WebGPUViewNativeComponent.web.d.ts.map +1 -1
  141. package/lib/typescript/src/animationFrame.d.ts +59 -0
  142. package/lib/typescript/src/animationFrame.d.ts.map +1 -0
  143. package/lib/typescript/src/index.d.ts +18 -8
  144. package/lib/typescript/src/index.d.ts.map +1 -1
  145. package/lib/typescript/src/main/index.d.ts +1 -0
  146. package/lib/typescript/src/main/index.d.ts.map +1 -1
  147. package/lib/typescript/src/mock.d.ts +11 -0
  148. package/lib/typescript/src/mock.d.ts.map +1 -1
  149. package/lib/typescript/src/types.d.ts +32 -31
  150. package/lib/typescript/src/types.d.ts.map +1 -1
  151. package/lib/typescript/src/video.d.ts +12 -4
  152. package/lib/typescript/src/video.d.ts.map +1 -1
  153. package/package.json +8 -2
  154. package/react-native-webgpu.podspec +1 -1
  155. package/src/Canvas.tsx +67 -1
  156. package/src/NativeBufferView.tsx +199 -0
  157. package/src/NativeBufferViewNativeComponent.ts +20 -0
  158. package/src/WebGPUViewNativeComponent.ts +4 -0
  159. package/src/WebGPUViewNativeComponent.web.ts +6 -0
  160. package/src/animationFrame.ts +82 -0
  161. package/src/index.tsx +45 -39
  162. package/src/main/index.tsx +1 -0
  163. package/src/mock.ts +35 -0
  164. package/src/types.ts +61 -87
  165. package/src/video.ts +20 -7
  166. package/cpp/rnwgpu/api/GPUNativeBufferExternalTexture.h +0 -60
  167. package/cpp/rnwgpu/api/GPUNativeBufferTexture.h +0 -52
  168. package/cpp/rnwgpu/api/GPUNativeBufferWrapper.cpp +0 -144
  169. package/cpp/rnwgpu/api/GPUNativeBufferWrapper.h +0 -143
  170. package/cpp/rnwgpu/api/descriptors/GPUNativeBufferTextureDescriptor.h +0 -55
@@ -0,0 +1,200 @@
1
+ #import "WebGPUNativeBufferView.h"
2
+
3
+ #import <QuartzCore/QuartzCore.h>
4
+
5
+ #import <react/renderer/components/RNWgpuViewSpec/ComponentDescriptors.h>
6
+ #import <react/renderer/components/RNWgpuViewSpec/EventEmitters.h>
7
+ #import <react/renderer/components/RNWgpuViewSpec/Props.h>
8
+ #import <react/renderer/components/RNWgpuViewSpec/RCTComponentViewHelpers.h>
9
+
10
+ #import <React/RCTFabricComponentsPlugins.h>
11
+
12
+ #include <cmath>
13
+ #include <memory>
14
+
15
+ #include "NativeBufferViewRegistry.h"
16
+
17
+ using namespace facebook::react;
18
+
19
+ static const std::shared_ptr<const WebGPUNativeBufferViewProps> &
20
+ defaultNativeBufferViewProps() {
21
+ static const auto props =
22
+ std::make_shared<const WebGPUNativeBufferViewProps>();
23
+ return props;
24
+ }
25
+
26
+ static NSString *gravityForResizeMode(WebGPUNativeBufferViewResizeMode mode) {
27
+ switch (mode) {
28
+ case WebGPUNativeBufferViewResizeMode::Contain:
29
+ return kCAGravityResizeAspect;
30
+ case WebGPUNativeBufferViewResizeMode::Cover:
31
+ return kCAGravityResizeAspectFill;
32
+ case WebGPUNativeBufferViewResizeMode::TopLeft:
33
+ #if !TARGET_OS_OSX
34
+ // The gravity constants assume a bottom-left origin; UIKit layers have
35
+ // a top-left one, so "bottom" is the top edge on screen.
36
+ return kCAGravityBottomLeft;
37
+ #else
38
+ return kCAGravityTopLeft;
39
+ #endif
40
+ case WebGPUNativeBufferViewResizeMode::Stretch:
41
+ default:
42
+ return kCAGravityResize;
43
+ }
44
+ }
45
+
46
+ @implementation WebGPUNativeBufferView {
47
+ // Shows the IOSurface as its layer's contents. A subview rather than this
48
+ // view's own layer, which keeps React Native's background and borders.
49
+ RNWGPlatformView *_surfaceView;
50
+ int _viewId;
51
+ // The registry sequence number of what is shown, 0 for nothing.
52
+ uint64_t _sequence;
53
+ int _reportedWidth;
54
+ int _reportedHeight;
55
+ }
56
+
57
+ + (ComponentDescriptorProvider)componentDescriptorProvider {
58
+ return concreteComponentDescriptorProvider<
59
+ WebGPUNativeBufferViewComponentDescriptor>();
60
+ }
61
+
62
+ - (instancetype)initWithFrame:(CGRect)frame {
63
+ if (self = [super initWithFrame:frame]) {
64
+ // updateProps: casts _props to WebGPUNativeBufferViewProps, so it must
65
+ // hold that type from the start (see WebGPUView).
66
+ _props = defaultNativeBufferViewProps();
67
+ _surfaceView = [RNWGPlatformView new];
68
+ #if TARGET_OS_OSX
69
+ _surfaceView.wantsLayer = YES;
70
+ #else
71
+ _surfaceView.userInteractionEnabled = NO;
72
+ #endif
73
+ CALayer *layer = _surfaceView.layer;
74
+ layer.contentsGravity = kCAGravityResize;
75
+ layer.masksToBounds = YES;
76
+ self.contentView = _surfaceView;
77
+ }
78
+ return self;
79
+ }
80
+
81
+ - (void)dealloc {
82
+ if (_viewId != 0) {
83
+ rnwgpu::NativeBufferViewRegistry::getInstance().detachView(_viewId);
84
+ }
85
+ }
86
+
87
+ - (void)prepareForRecycle {
88
+ [super prepareForRecycle];
89
+ [self attachToViewId:0];
90
+ [self setSurfaceContents:nil];
91
+ _reportedWidth = 0;
92
+ _reportedHeight = 0;
93
+ // Reset to the default props (viewId == 0) so the next mount attaches.
94
+ _props = defaultNativeBufferViewProps();
95
+ }
96
+
97
+ - (void)updateProps:(const Props::Shared &)props
98
+ oldProps:(const Props::Shared &)oldProps {
99
+ const auto &oldViewProps =
100
+ *std::static_pointer_cast<const WebGPUNativeBufferViewProps>(_props);
101
+ const auto &newViewProps =
102
+ *std::static_pointer_cast<const WebGPUNativeBufferViewProps>(props);
103
+
104
+ if (newViewProps.viewId != oldViewProps.viewId) {
105
+ [self attachToViewId:newViewProps.viewId];
106
+ }
107
+ NSString *gravity = gravityForResizeMode(newViewProps.resizeMode);
108
+ if (![_surfaceView.layer.contentsGravity isEqualToString:gravity]) {
109
+ [CATransaction begin];
110
+ [CATransaction setDisableActions:YES];
111
+ _surfaceView.layer.contentsGravity = gravity;
112
+ [CATransaction commit];
113
+ }
114
+
115
+ [super updateProps:props oldProps:oldProps];
116
+ }
117
+
118
+ - (void)updateEventEmitter:(const EventEmitter::Shared &)eventEmitter {
119
+ [super updateEventEmitter:eventEmitter];
120
+ [self reportPixelSize];
121
+ }
122
+
123
+ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics
124
+ oldLayoutMetrics:(const LayoutMetrics &)oldLayoutMetrics {
125
+ [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
126
+ // With the screen scale, a buffer of the reported size maps 1:1 to pixels,
127
+ // and topLeft shows it unscaled.
128
+ _surfaceView.layer.contentsScale = layoutMetrics.pointScaleFactor;
129
+ [self reportPixelSize];
130
+ }
131
+
132
+ // onPixelSizeChange: the size the producer should render at for a 1:1
133
+ // display. Layout frames are already on the pixel grid; the rounding only
134
+ // absorbs floating point error, the same rounding as Android's.
135
+ - (void)reportPixelSize {
136
+ const auto scale = _layoutMetrics.pointScaleFactor;
137
+ const auto size = _layoutMetrics.frame.size;
138
+ const int width = static_cast<int>(std::lround(size.width * scale));
139
+ const int height = static_cast<int>(std::lround(size.height * scale));
140
+ if (width <= 0 || height <= 0 || _eventEmitter == nullptr ||
141
+ (width == _reportedWidth && height == _reportedHeight)) {
142
+ return;
143
+ }
144
+ _reportedWidth = width;
145
+ _reportedHeight = height;
146
+ std::static_pointer_cast<const WebGPUNativeBufferViewEventEmitter>(
147
+ _eventEmitter)
148
+ ->onPixelSizeChange({.width = width, .height = height});
149
+ }
150
+
151
+ // Main thread.
152
+ - (void)attachToViewId:(int)viewId {
153
+ auto &registry = rnwgpu::NativeBufferViewRegistry::getInstance();
154
+ if (_viewId != 0) {
155
+ registry.detachView(_viewId);
156
+ }
157
+ _viewId = viewId;
158
+ _sequence = 0;
159
+ if (viewId == 0) {
160
+ return;
161
+ }
162
+ // Called from any thread (the fence listener's queue, the JS thread)
163
+ // when content is ready, and right away when there is some already.
164
+ __weak WebGPUNativeBufferView *weakSelf = self;
165
+ registry.setListener(viewId, [weakSelf]() {
166
+ dispatch_async(dispatch_get_main_queue(), ^{
167
+ [weakSelf consumeContent];
168
+ });
169
+ });
170
+ }
171
+
172
+ // Main thread: shows the newest content, if it is newer than what is shown.
173
+ // Present on change, no frame pacing: Core Animation shows it on the next
174
+ // vsync, and retains the IOSurface for as long as it does.
175
+ - (void)consumeContent {
176
+ if (_viewId == 0) {
177
+ return;
178
+ }
179
+ uint64_t sequence = 0;
180
+ auto content = rnwgpu::NativeBufferViewRegistry::getInstance().content(
181
+ _viewId, &sequence);
182
+ if (content == nullptr || sequence <= _sequence) {
183
+ return;
184
+ }
185
+ _sequence = sequence;
186
+ [self setSurfaceContents:(__bridge id)content->buffer()];
187
+ }
188
+
189
+ - (void)setSurfaceContents:(nullable id)contents {
190
+ [CATransaction begin];
191
+ [CATransaction setDisableActions:YES];
192
+ _surfaceView.layer.contents = contents;
193
+ [CATransaction commit];
194
+ }
195
+
196
+ Class<RCTComponentViewProtocol> WebGPUNativeBufferViewCls(void) {
197
+ return WebGPUNativeBufferView.class;
198
+ }
199
+
200
+ @end
@@ -1,8 +1,9 @@
1
1
  #pragma once
2
2
 
3
3
  #import "MetalView.h"
4
+ // RNWGUIKit selects AppKit for native macOS and UIKit for other Apple targets.
5
+ #import "RNWGUIKit.h"
4
6
  #import <React/RCTViewComponentView.h>
5
- #import <UIKit/UIKit.h>
6
7
 
7
8
  NS_ASSUME_NONNULL_BEGIN
8
9
 
@@ -66,10 +66,16 @@ static const std::shared_ptr<const WebGPUViewProps> &defaultWebGPUViewProps() {
66
66
  /*
67
67
  The context is set only once during mounting the component
68
68
  and never changes because it isn't available for users to modify.
69
+ The colorspace props are read here too, and only here: the layer is
70
+ tagged with them as it is attached, on the main thread, and a change on
71
+ a mounted canvas is ignored (with a warning in development from JS, see
72
+ Canvas.tsx).
69
73
  */
70
74
  MetalView *metalView = [MetalView new];
71
75
  self.contentView = metalView;
72
76
  [metalView setContextId:@(newViewProps.contextId)];
77
+ metalView.displayP3 = newViewProps.appleDisplayP3;
78
+ metalView.extendedDynamicRange = newViewProps.appleExtendedDynamicRange;
73
79
  [metalView configure];
74
80
  }
75
81
 
package/binaries.json ADDED
@@ -0,0 +1,156 @@
1
+ {
2
+ "version": "158.0.0",
3
+ "tag": "binaries-158.0.0",
4
+ "skia": "m158",
5
+ "dawn": {
6
+ "commit": "1716e88cc9e58398fab5d4473f7f2e858667b677",
7
+ "repository": "https://dawn.googlesource.com/dawn.git",
8
+ "patches": [
9
+ "metal-maccatalyst.patch",
10
+ "metal-suspend-submissions-in-background.patch",
11
+ "vulkan-fifo-three-images-android.patch"
12
+ ]
13
+ },
14
+ "assets": {
15
+ "skia-graphite-android-armeabi-v7a.zip": {
16
+ "sha256": "ed4e7772d97cac8c03d759451711de69cd723c60cf5e6571fe78da5f21cdf9a3",
17
+ "size": 17220410
18
+ },
19
+ "dawn-android-armeabi-v7a.zip": {
20
+ "sha256": "0d15912b225a079f850af8195ce7be50c4e63d337a63aebd2cbebe1173b110f4",
21
+ "size": 4885803
22
+ },
23
+ "skia-graphite-android-arm64-v8a.zip": {
24
+ "sha256": "2a2e2fdc22aebe827ccc4d613c1336b1f8ec68384df68f057c3aa6b5e8a5da43",
25
+ "size": 18419606
26
+ },
27
+ "dawn-android-arm64-v8a.zip": {
28
+ "sha256": "5a48fdafbf73ae870b073a20cce9e46a9b3fbb9aecdc312fc900af2a3e83312f",
29
+ "size": 5308117
30
+ },
31
+ "skia-graphite-android-x86.zip": {
32
+ "sha256": "d5ce0c75db0016986a4840996bc66ae345806f4f41fb7820e9ee11815ed928a0",
33
+ "size": 18838978
34
+ },
35
+ "dawn-android-x86.zip": {
36
+ "sha256": "13e3f79fc2447f0b71d6ad559df7a8f2e7857bd02faac83a2ca7e5670963b8ed",
37
+ "size": 6066809
38
+ },
39
+ "skia-graphite-android-x86_64.zip": {
40
+ "sha256": "b69568bffb06a14cfea785c4ebfdc0f292986a6bd51bba37774d65233602f778",
41
+ "size": 18422759
42
+ },
43
+ "dawn-android-x86_64.zip": {
44
+ "sha256": "2e41a8983a379f8798d1d26ae223b123b2347b593190fd1c7d344956a796240a",
45
+ "size": 5659211
46
+ },
47
+ "dawn-headers.zip": {
48
+ "sha256": "fe255214b596fd884a480078d417571a7fd7b4beb04e8ce1a93f140b12a0a4a8",
49
+ "size": 150497
50
+ },
51
+ "dawn-LICENSE.txt": {
52
+ "sha256": "0493f897193af1796d5054659f45ec7d4c5af648fa67a99f01d30e55cc805abc",
53
+ "size": 11829
54
+ },
55
+ "skia-graphite-apple-ios-libskia.xcframework.zip": {
56
+ "sha256": "93e76f7320bc5b782b847b4b26aeec8730cdf6b7f06575d583e626eb9ed53350",
57
+ "size": 33541685
58
+ },
59
+ "skia-graphite-apple-ios-libsvg.xcframework.zip": {
60
+ "sha256": "ea5b1bb251faad33e7f3799286d8f57479cf80cdc741d436fc7d2d9c64c9c8e6",
61
+ "size": 9658038
62
+ },
63
+ "skia-graphite-apple-ios-libskshaper.xcframework.zip": {
64
+ "sha256": "35b68ae901b50d41a6c353a34f81f4a69efec9420f9976414428636544f6595f",
65
+ "size": 12905519
66
+ },
67
+ "skia-graphite-apple-ios-libskparagraph.xcframework.zip": {
68
+ "sha256": "b17b30a587b7d5248e0f1d716c938d19d09855772e2b63dc29590ca409b2370b",
69
+ "size": 1132911
70
+ },
71
+ "skia-graphite-apple-ios-libskunicode_core.xcframework.zip": {
72
+ "sha256": "52f4a1001f9d88e957091bebbf65f72f9f9e4d6fb18f15e50335e8b76cfb4ec4",
73
+ "size": 18600
74
+ },
75
+ "skia-graphite-apple-ios-libskunicode_libgrapheme.xcframework.zip": {
76
+ "sha256": "9419f8f0467095d331ec5dcc0c83652e4719d94d7553e9bf1bfd3c3a9c8bdb82",
77
+ "size": 824822
78
+ },
79
+ "skia-graphite-apple-ios-libskottie.xcframework.zip": {
80
+ "sha256": "dc2a5842b7f5732e578ee349883a01784c75ca607f89137ee6e381eba1769a61",
81
+ "size": 10719542
82
+ },
83
+ "skia-graphite-apple-ios-libsksg.xcframework.zip": {
84
+ "sha256": "d25a3e0571393f36a6fac0c0dbcfd729019626ebac2cf8d840a40e5c72c2a1cb",
85
+ "size": 9024381
86
+ },
87
+ "skia-graphite-apple-tvos-libskia.xcframework.zip": {
88
+ "sha256": "4d29ae8db6e106267bed8ba693ac097d97c4436a981a036b8d7d59aa578c72b2",
89
+ "size": 19847689
90
+ },
91
+ "skia-graphite-apple-tvos-libsvg.xcframework.zip": {
92
+ "sha256": "c3f6bf08448ad5e1cce10b32d2c43d062bb56ac84dff2af6b5d95a8d019c3af9",
93
+ "size": 5705277
94
+ },
95
+ "skia-graphite-apple-tvos-libskshaper.xcframework.zip": {
96
+ "sha256": "f18b368fad922e5a6bd736b84509c51364b4c9b8ca9cbca14a1404996cfe0d59",
97
+ "size": 7664970
98
+ },
99
+ "skia-graphite-apple-tvos-libskparagraph.xcframework.zip": {
100
+ "sha256": "495fcfef1b0094def9c7b514f0f27290ff43ebdfaa6f7f73c7409b545f2958c8",
101
+ "size": 670608
102
+ },
103
+ "skia-graphite-apple-tvos-libskunicode_core.xcframework.zip": {
104
+ "sha256": "f73bb1ce3cee1d2fbd940b8b5b91ed4512cb618f91a0009f49cf718945826812",
105
+ "size": 11546
106
+ },
107
+ "skia-graphite-apple-tvos-libskunicode_libgrapheme.xcframework.zip": {
108
+ "sha256": "c515f56f998e6ea7e2b74b853915e1627e3efcf406b7ec29316fd0769ca5c1e3",
109
+ "size": 491185
110
+ },
111
+ "skia-graphite-apple-tvos-libskottie.xcframework.zip": {
112
+ "sha256": "384f861b6c635199a249f2b76d4c2bbd55a3f3480b4fc0f5f0879d6862f0daf9",
113
+ "size": 6335725
114
+ },
115
+ "skia-graphite-apple-tvos-libsksg.xcframework.zip": {
116
+ "sha256": "929096f800fcfe775218625eb4eb9ecba3e5c8a547f6eb3d6a2867e175531a8e",
117
+ "size": 5328696
118
+ },
119
+ "skia-graphite-apple-macos-libskia.xcframework.zip": {
120
+ "sha256": "96526c51628b7ac52360c3ea6c4c86f16c8e28801fc9428fc42b36e6555b01bc",
121
+ "size": 13678266
122
+ },
123
+ "skia-graphite-apple-macos-libsvg.xcframework.zip": {
124
+ "sha256": "636d4d2c6e38ea1bb4e7c19dba98ed013745975bef38ffd53d96d901b3206e8c",
125
+ "size": 3939058
126
+ },
127
+ "skia-graphite-apple-macos-libskshaper.xcframework.zip": {
128
+ "sha256": "80d719fb0c9cb5311791170204102d0a5901e92d43f428f856ee60a32706dc7c",
129
+ "size": 5251775
130
+ },
131
+ "skia-graphite-apple-macos-libskparagraph.xcframework.zip": {
132
+ "sha256": "15a6fe0ade4e5d08661c0282aadc76a5f9293745dfb77e2d3cfe20f5258c315a",
133
+ "size": 462769
134
+ },
135
+ "skia-graphite-apple-macos-libskunicode_core.xcframework.zip": {
136
+ "sha256": "a0f5173dcee332280e72dd49411fa4534256fd6540dfa69ec71463d822fca238",
137
+ "size": 7659
138
+ },
139
+ "skia-graphite-apple-macos-libskunicode_libgrapheme.xcframework.zip": {
140
+ "sha256": "8129e8ab9bfa8d9ced3793db079e0977cdbd9c7436d057eb1ce4b48fb03b082b",
141
+ "size": 334680
142
+ },
143
+ "skia-graphite-apple-macos-libskottie.xcframework.zip": {
144
+ "sha256": "ffbcc4ccb3dd37ac634d394f263488c5f216bdaa2aa5a819093edc5ca03a0fc4",
145
+ "size": 4373140
146
+ },
147
+ "skia-graphite-apple-macos-libsksg.xcframework.zip": {
148
+ "sha256": "58b85895c87561cc4904e1c24b2b05faf6776e5f2fcf49469d6808f0421f5f8f",
149
+ "size": 3684323
150
+ },
151
+ "dawn-apple-libwebgpu_dawn.xcframework.zip": {
152
+ "sha256": "b1844ccfb27809361a9724cf5dac4b1a4b7f9e40f26dc7cf60d40a5013dd7114",
153
+ "size": 53231891
154
+ }
155
+ }
156
+ }
@@ -839,11 +839,18 @@ private:
839
839
  ReturnType (Derived::*method)(jsi::Runtime &, Args...),
840
840
  jsi::Runtime &runtime, const jsi::Value *args,
841
841
  std::index_sequence<Is...>, size_t count) {
842
- ReturnType result = (obj->*method)(
843
- runtime, rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
844
- runtime, args[Is], Is >= count)...);
845
- return rnwgpu::JSIConverter<std::decay_t<ReturnType>>::toJSI(
846
- runtime, std::move(result));
842
+ if constexpr (std::is_same_v<ReturnType, void>) {
843
+ (obj->*method)(runtime,
844
+ rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
845
+ runtime, args[Is], Is >= count)...);
846
+ return jsi::Value::undefined();
847
+ } else {
848
+ ReturnType result = (obj->*method)(
849
+ runtime, rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
850
+ runtime, args[Is], Is >= count)...);
851
+ return rnwgpu::JSIConverter<std::decay_t<ReturnType>>::toJSI(
852
+ runtime, std::move(result));
853
+ }
847
854
  }
848
855
 
849
856
  // Helper to call a method with JSI argument conversion