react-native-webgpu 0.13.1 → 0.14.1

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 (43) hide show
  1. package/android/CMakeLists.txt +1 -0
  2. package/android/cpp/AndroidPlatformContext.h +0 -9
  3. package/android/cpp/cpp-adapter.cpp +6 -4
  4. package/android/src/main/java/com/webgpu/WebGPUView.java +8 -0
  5. package/apple/ApplePlatformContext.h +0 -3
  6. package/apple/ApplePlatformContext.mm +0 -10
  7. package/apple/MetalView.mm +4 -3
  8. package/cpp/jsi/JSIConverter.h +6 -11
  9. package/cpp/jsi/NativeObject.h +130 -18
  10. package/cpp/rnwgpu/EnforceRange.h +68 -0
  11. package/cpp/rnwgpu/PlatformContext.h +0 -2
  12. package/cpp/rnwgpu/RNWebGPUManager.cpp +7 -95
  13. package/cpp/rnwgpu/RNWebGPUManager.h +4 -3
  14. package/cpp/rnwgpu/WebGPURuntime.cpp +91 -0
  15. package/cpp/rnwgpu/WebGPURuntime.h +36 -0
  16. package/cpp/rnwgpu/api/Convertors.h +10 -1
  17. package/cpp/rnwgpu/api/DestroyedError.h +26 -0
  18. package/cpp/rnwgpu/api/GPU.cpp +3 -57
  19. package/cpp/rnwgpu/api/GPUDevice.cpp +17 -9
  20. package/cpp/rnwgpu/api/GPUError.h +15 -0
  21. package/cpp/rnwgpu/api/GPUInternalError.h +2 -0
  22. package/cpp/rnwgpu/api/GPUOutOfMemoryError.h +2 -0
  23. package/cpp/rnwgpu/api/GPUQueue.cpp +7 -21
  24. package/cpp/rnwgpu/api/GPUSharedFence.cpp +39 -12
  25. package/cpp/rnwgpu/api/GPUSharedFence.h +21 -4
  26. package/cpp/rnwgpu/api/GPUSharedTextureMemory.cpp +80 -4
  27. package/cpp/rnwgpu/api/GPUSharedTextureMemory.h +29 -6
  28. package/cpp/rnwgpu/api/GPUTexture.h +6 -0
  29. package/cpp/rnwgpu/api/GPUValidationError.h +2 -0
  30. package/cpp/rnwgpu/api/descriptors/Unions.h +80 -0
  31. package/lib/commonjs/external/reanimated/registerWebGPUForReanimated.js +13 -3
  32. package/lib/commonjs/external/reanimated/registerWebGPUForReanimated.js.map +1 -1
  33. package/lib/module/external/reanimated/registerWebGPUForReanimated.js +13 -3
  34. package/lib/module/external/reanimated/registerWebGPUForReanimated.js.map +1 -1
  35. package/lib/typescript/lib/commonjs/external/reanimated/registerWebGPUForReanimated.d.ts.map +1 -1
  36. package/lib/typescript/lib/module/external/reanimated/registerWebGPUForReanimated.d.ts.map +1 -1
  37. package/lib/typescript/src/external/reanimated/registerWebGPUForReanimated.d.ts +12 -0
  38. package/lib/typescript/src/external/reanimated/registerWebGPUForReanimated.d.ts.map +1 -1
  39. package/lib/typescript/src/types.d.ts +2 -0
  40. package/lib/typescript/src/types.d.ts.map +1 -1
  41. package/package.json +2 -2
  42. package/src/external/reanimated/registerWebGPUForReanimated.ts +29 -7
  43. package/src/types.ts +14 -1
@@ -1,15 +1,62 @@
1
1
  #include "GPUSharedTextureMemory.h"
2
2
 
3
+ #include <algorithm>
3
4
  #include <memory>
4
5
  #include <stdexcept>
5
6
  #include <string>
6
7
 
7
8
  #include "Convertors.h"
9
+ #include "DestroyedError.h"
8
10
 
9
11
  namespace rnwgpu {
10
12
 
13
+ void GPUSharedTextureMemory::destroy() {
14
+ if (!_instance) {
15
+ return;
16
+ }
17
+ (void)_instance.GetProperties(&_properties);
18
+ if (!_accessed.empty()) {
19
+ // Dawn's contract is an endAccess() for every beginAccess(), but Dawn
20
+ // doesn't check it when the memory goes away. Report the misuse; the
21
+ // access itself is left as is (ending it would hand its fences to no one).
22
+ auto message = "Destroyed " + describeDestroyed(CLASS_NAME, _label) +
23
+ " with an access still open: call endAccess() first.";
24
+ _device.InjectError(wgpu::ErrorType::Validation, message.c_str());
25
+ _accessed.clear();
26
+ }
27
+ _instance = nullptr;
28
+ }
29
+
30
+ void GPUSharedTextureMemory::injectDestroyedError(const char *method) {
31
+ reportDestroyedUse(_device, CLASS_NAME, _label, method);
32
+ }
33
+
11
34
  std::shared_ptr<GPUTexture> GPUSharedTextureMemory::createTexture(
12
35
  std::optional<std::shared_ptr<GPUTextureDescriptor>> descriptor) {
36
+ if (!_instance) {
37
+ // Like a texture Dawn can't create from the memory: the validation error
38
+ // says why, and the texture is an error texture. As Dawn does, it is
39
+ // described by the caller's descriptor, or else by the memory's
40
+ // properties. It owns no GPU memory, so it reports no memory pressure.
41
+ injectDestroyedError("createTexture");
42
+ wgpu::TextureDescriptor desc{};
43
+ std::string label;
44
+ if (descriptor.has_value() && descriptor.value() != nullptr) {
45
+ Convertor conv;
46
+ if (!conv(desc, descriptor.value())) {
47
+ throw std::runtime_error(
48
+ "GPUSharedTextureMemory::createTexture(): Error with "
49
+ "GPUTextureDescriptor");
50
+ }
51
+ label = descriptor.value()->label.value_or("");
52
+ } else {
53
+ desc.usage = _properties.usage;
54
+ desc.size = _properties.size;
55
+ desc.format = _properties.format;
56
+ }
57
+ return std::make_shared<GPUTexture>(_device.CreateErrorTexture(&desc),
58
+ std::move(label), false);
59
+ }
13
60
  if (!descriptor.has_value() || descriptor.value() == nullptr) {
14
61
  auto texture = _instance.CreateTexture();
15
62
  return std::make_shared<GPUTexture>(texture, "");
@@ -34,6 +81,12 @@ void GPUSharedTextureMemory::beginAccess(
34
81
  throw std::runtime_error(
35
82
  "GPUSharedTextureMemory::beginAccess(): texture is null");
36
83
  }
84
+ // Fails like an access Dawn rejects: a validation error, then the throw.
85
+ if (!_instance) {
86
+ injectDestroyedError("beginAccess");
87
+ throw std::runtime_error(
88
+ "GPUSharedTextureMemory::beginAccess(): the memory was destroyed");
89
+ }
37
90
  wgpu::SharedTextureMemoryBeginAccessDescriptor desc{};
38
91
  desc.initialized = initialized;
39
92
  desc.concurrentRead = false;
@@ -45,7 +98,13 @@ void GPUSharedTextureMemory::beginAccess(
45
98
  if (fences.has_value()) {
46
99
  for (const auto &state : *fences) {
47
100
  if (state && state->fence) {
48
- rawFences.push_back(state->fence->get());
101
+ auto fence = state->fence->get();
102
+ if (!fence) {
103
+ state->fence->injectDestroyedError("beginAccess");
104
+ throw std::runtime_error(
105
+ "GPUSharedTextureMemory::beginAccess(): a fence was destroyed");
106
+ }
107
+ rawFences.push_back(std::move(fence));
49
108
  values.push_back(state->signaledValue);
50
109
  }
51
110
  }
@@ -53,10 +112,12 @@ void GPUSharedTextureMemory::beginAccess(
53
112
  if (!rawFences.empty()) {
54
113
  desc.fenceCount = rawFences.size();
55
114
  desc.fences = rawFences.data();
115
+ desc.signaledValueCount = values.size();
56
116
  desc.signaledValues = values.data();
57
117
  } else {
58
118
  desc.fenceCount = 0;
59
119
  desc.fences = nullptr;
120
+ desc.signaledValueCount = 0;
60
121
  desc.signaledValues = nullptr;
61
122
  }
62
123
 
@@ -78,6 +139,7 @@ void GPUSharedTextureMemory::beginAccess(
78
139
  if (status != wgpu::Status::Success) {
79
140
  throw std::runtime_error("GPUSharedTextureMemory::beginAccess() failed");
80
141
  }
142
+ _accessed.push_back(texture->get());
81
143
  }
82
144
 
83
145
  jsi::Value GPUSharedTextureMemory::endAccess(jsi::Runtime &runtime,
@@ -88,6 +150,12 @@ jsi::Value GPUSharedTextureMemory::endAccess(jsi::Runtime &runtime,
88
150
  throw jsi::JSError(
89
151
  runtime, "GPUSharedTextureMemory::endAccess(): expected (texture)");
90
152
  }
153
+ if (!_instance) {
154
+ injectDestroyedError("endAccess");
155
+ throw jsi::JSError(
156
+ runtime,
157
+ "GPUSharedTextureMemory::endAccess(): the memory was destroyed");
158
+ }
91
159
  auto texture = GPUTexture::fromValue(runtime, args[0]);
92
160
 
93
161
  wgpu::SharedTextureMemoryEndAccessState state{};
@@ -104,18 +172,26 @@ jsi::Value GPUSharedTextureMemory::endAccess(jsi::Runtime &runtime,
104
172
  if (status != wgpu::Status::Success) {
105
173
  throw jsi::JSError(runtime, "GPUSharedTextureMemory::endAccess() failed");
106
174
  }
175
+ auto ended = texture->get();
176
+ _accessed.erase(std::remove_if(_accessed.begin(), _accessed.end(),
177
+ [&](const wgpu::Texture &accessed) {
178
+ return accessed.Get() == ended.Get();
179
+ }),
180
+ _accessed.end());
107
181
 
108
182
  // Copy each wgpu::SharedFence (ref-counted) into its own GPUSharedFence
109
183
  // wrapper before `state` is destroyed.
110
184
  jsi::Array fences(runtime, state.fenceCount);
111
185
  for (size_t i = 0; i < state.fenceCount; i++) {
112
186
  wgpu::SharedFence fence = state.fences[i];
113
- auto wrapper = std::make_shared<GPUSharedFence>(std::move(fence), "");
187
+ auto wrapper =
188
+ std::make_shared<GPUSharedFence>(_device, std::move(fence), "");
114
189
  jsi::Object entry(runtime);
115
190
  entry.setProperty(runtime, "fence",
116
191
  GPUSharedFence::create(runtime, std::move(wrapper)));
117
- entry.setProperty(runtime, "signaledValue",
118
- jsi::BigInt::fromUint64(runtime, state.signaledValues[i]));
192
+ entry.setProperty(
193
+ runtime, "signaledValue",
194
+ jsi::BigInt::fromUint64(runtime, state.signaledValues[i]));
119
195
  fences.setValueAtIndex(runtime, i, std::move(entry));
120
196
  }
121
197
 
@@ -23,16 +23,17 @@ class GPUSharedTextureMemory : public NativeObject<GPUSharedTextureMemory> {
23
23
  public:
24
24
  static constexpr const char *CLASS_NAME = "GPUSharedTextureMemory";
25
25
 
26
- explicit GPUSharedTextureMemory(wgpu::SharedTextureMemory instance,
26
+ explicit GPUSharedTextureMemory(wgpu::Device device,
27
+ wgpu::SharedTextureMemory instance,
27
28
  std::string label)
28
- : NativeObject(CLASS_NAME), _instance(std::move(instance)),
29
- _label(std::move(label)) {}
29
+ : NativeObject(CLASS_NAME), _device(std::move(device)),
30
+ _instance(std::move(instance)), _label(std::move(label)) {}
30
31
 
31
32
  public:
32
33
  std::string getBrand() { return CLASS_NAME; }
33
34
 
34
- std::shared_ptr<GPUTexture>
35
- createTexture(std::optional<std::shared_ptr<GPUTextureDescriptor>> descriptor);
35
+ std::shared_ptr<GPUTexture> createTexture(
36
+ std::optional<std::shared_ptr<GPUTextureDescriptor>> descriptor);
36
37
 
37
38
  // Optional `fences` are wait fences: Dawn waits for each to reach its
38
39
  // signaledValue before writing the surface. Throws on failure.
@@ -48,9 +49,17 @@ public:
48
49
  std::string getLabel() { return _label; }
49
50
  void setLabel(const std::string &label) {
50
51
  _label = label;
51
- _instance.SetLabel(_label.c_str());
52
+ if (_instance) {
53
+ _instance.SetLabel(_label.c_str());
54
+ }
52
55
  }
53
56
 
57
+ // Releases the memory now (the imported native buffer and Dawn's import of
58
+ // it) rather than when the JS object is garbage collected. End the access
59
+ // first (destroying during one is a validation error), and destroy the
60
+ // textures created from it: they keep what they use until then.
61
+ void destroy();
62
+
54
63
  static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
55
64
  installGetter(runtime, prototype, "__brand",
56
65
  &GPUSharedTextureMemory::getBrand);
@@ -60,6 +69,8 @@ public:
60
69
  &GPUSharedTextureMemory::beginAccess);
61
70
  installMethod(runtime, prototype, "endAccess",
62
71
  &GPUSharedTextureMemory::endAccess);
72
+ installMethod(runtime, prototype, "destroy",
73
+ &GPUSharedTextureMemory::destroy);
63
74
  installGetterSetter(runtime, prototype, "label",
64
75
  &GPUSharedTextureMemory::getLabel,
65
76
  &GPUSharedTextureMemory::setLabel);
@@ -68,7 +79,19 @@ public:
68
79
  inline const wgpu::SharedTextureMemory get() { return _instance; }
69
80
 
70
81
  private:
82
+ // Reports a use of the destroyed memory the way Dawn reports an invalid
83
+ // object: a validation error, caught by error scopes or else delivered to
84
+ // the device's uncapturederror event.
85
+ void injectDestroyedError(const char *method);
86
+
87
+ wgpu::Device _device;
71
88
  wgpu::SharedTextureMemory _instance;
89
+ // Kept by destroy(): like Dawn, createTexture() describes the error texture
90
+ // it then returns with them.
91
+ wgpu::SharedTextureMemoryProperties _properties;
92
+ // The textures with an access begun and not yet ended, so destroy() can
93
+ // report an access left open. Dawn doesn't track that across a release.
94
+ std::vector<wgpu::Texture> _accessed;
72
95
  std::string _label;
73
96
  };
74
97
 
@@ -101,6 +101,8 @@ public:
101
101
  case wgpu::TextureFormat::Stencil8:
102
102
  bytesPerPixel = 1;
103
103
  break;
104
+ case wgpu::TextureFormat::R16Unorm:
105
+ case wgpu::TextureFormat::R16Snorm:
104
106
  case wgpu::TextureFormat::R16Uint:
105
107
  case wgpu::TextureFormat::R16Sint:
106
108
  case wgpu::TextureFormat::R16Float:
@@ -122,6 +124,8 @@ public:
122
124
  case wgpu::TextureFormat::R32Float:
123
125
  case wgpu::TextureFormat::R32Uint:
124
126
  case wgpu::TextureFormat::R32Sint:
127
+ case wgpu::TextureFormat::RG16Unorm:
128
+ case wgpu::TextureFormat::RG16Snorm:
125
129
  case wgpu::TextureFormat::RG16Uint:
126
130
  case wgpu::TextureFormat::RG16Sint:
127
131
  case wgpu::TextureFormat::RG16Float:
@@ -133,6 +137,8 @@ public:
133
137
  case wgpu::TextureFormat::RG32Float:
134
138
  case wgpu::TextureFormat::RG32Uint:
135
139
  case wgpu::TextureFormat::RG32Sint:
140
+ case wgpu::TextureFormat::RGBA16Unorm:
141
+ case wgpu::TextureFormat::RGBA16Snorm:
136
142
  case wgpu::TextureFormat::RGBA16Uint:
137
143
  case wgpu::TextureFormat::RGBA16Sint:
138
144
  case wgpu::TextureFormat::RGBA16Float:
@@ -2,6 +2,7 @@
2
2
 
3
3
  #include <string>
4
4
 
5
+ #include "GPUError.h"
5
6
  #include "NativeObject.h"
6
7
 
7
8
  namespace rnwgpu {
@@ -20,6 +21,7 @@ public:
20
21
  std::string getMessage() { return _message; }
21
22
 
22
23
  static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
24
+ GPUError::inheritPrototype(runtime, prototype);
23
25
  installGetter(runtime, prototype, "__brand", &GPUValidationError::getBrand);
24
26
  installGetter(runtime, prototype, "message",
25
27
  &GPUValidationError::getMessage);
@@ -866,6 +866,10 @@ inline void convertJSUnionToEnum(const std::string &inUnion,
866
866
  *outEnum = wgpu::TextureFormat::R16Sint;
867
867
  } else if (inUnion == "r16float") {
868
868
  *outEnum = wgpu::TextureFormat::R16Float;
869
+ } else if (inUnion == "r16unorm") {
870
+ *outEnum = wgpu::TextureFormat::R16Unorm;
871
+ } else if (inUnion == "r16snorm") {
872
+ *outEnum = wgpu::TextureFormat::R16Snorm;
869
873
  } else if (inUnion == "rg8unorm") {
870
874
  *outEnum = wgpu::TextureFormat::RG8Unorm;
871
875
  } else if (inUnion == "rg8snorm") {
@@ -886,6 +890,10 @@ inline void convertJSUnionToEnum(const std::string &inUnion,
886
890
  *outEnum = wgpu::TextureFormat::RG16Sint;
887
891
  } else if (inUnion == "rg16float") {
888
892
  *outEnum = wgpu::TextureFormat::RG16Float;
893
+ } else if (inUnion == "rg16unorm") {
894
+ *outEnum = wgpu::TextureFormat::RG16Unorm;
895
+ } else if (inUnion == "rg16snorm") {
896
+ *outEnum = wgpu::TextureFormat::RG16Snorm;
889
897
  } else if (inUnion == "rgba8unorm") {
890
898
  *outEnum = wgpu::TextureFormat::RGBA8Unorm;
891
899
  } else if (inUnion == "rgba8unorm-srgb") {
@@ -920,6 +928,10 @@ inline void convertJSUnionToEnum(const std::string &inUnion,
920
928
  *outEnum = wgpu::TextureFormat::RGBA16Sint;
921
929
  } else if (inUnion == "rgba16float") {
922
930
  *outEnum = wgpu::TextureFormat::RGBA16Float;
931
+ } else if (inUnion == "rgba16unorm") {
932
+ *outEnum = wgpu::TextureFormat::RGBA16Unorm;
933
+ } else if (inUnion == "rgba16snorm") {
934
+ *outEnum = wgpu::TextureFormat::RGBA16Snorm;
923
935
  } else if (inUnion == "rgba32uint") {
924
936
  *outEnum = wgpu::TextureFormat::RGBA32Uint;
925
937
  } else if (inUnion == "rgba32sint") {
@@ -1072,6 +1084,12 @@ inline void convertEnumToJSUnion(wgpu::TextureFormat inEnum,
1072
1084
  case wgpu::TextureFormat::R16Float:
1073
1085
  *outUnion = "r16float";
1074
1086
  break;
1087
+ case wgpu::TextureFormat::R16Unorm:
1088
+ *outUnion = "r16unorm";
1089
+ break;
1090
+ case wgpu::TextureFormat::R16Snorm:
1091
+ *outUnion = "r16snorm";
1092
+ break;
1075
1093
  case wgpu::TextureFormat::RG8Unorm:
1076
1094
  *outUnion = "rg8unorm";
1077
1095
  break;
@@ -1102,6 +1120,12 @@ inline void convertEnumToJSUnion(wgpu::TextureFormat inEnum,
1102
1120
  case wgpu::TextureFormat::RG16Float:
1103
1121
  *outUnion = "rg16float";
1104
1122
  break;
1123
+ case wgpu::TextureFormat::RG16Unorm:
1124
+ *outUnion = "rg16unorm";
1125
+ break;
1126
+ case wgpu::TextureFormat::RG16Snorm:
1127
+ *outUnion = "rg16snorm";
1128
+ break;
1105
1129
  case wgpu::TextureFormat::RGBA8Unorm:
1106
1130
  *outUnion = "rgba8unorm";
1107
1131
  break;
@@ -1153,6 +1177,12 @@ inline void convertEnumToJSUnion(wgpu::TextureFormat inEnum,
1153
1177
  case wgpu::TextureFormat::RGBA16Float:
1154
1178
  *outUnion = "rgba16float";
1155
1179
  break;
1180
+ case wgpu::TextureFormat::RGBA16Unorm:
1181
+ *outUnion = "rgba16unorm";
1182
+ break;
1183
+ case wgpu::TextureFormat::RGBA16Snorm:
1184
+ *outUnion = "rgba16snorm";
1185
+ break;
1156
1186
  case wgpu::TextureFormat::RGBA32Uint:
1157
1187
  *outUnion = "rgba32uint";
1158
1188
  break;
@@ -1431,38 +1461,56 @@ inline void convertJSUnionToEnum(const std::string &inUnion,
1431
1461
  *outEnum = wgpu::VertexFormat::Uint8x2;
1432
1462
  } else if (inUnion == "uint8x4") {
1433
1463
  *outEnum = wgpu::VertexFormat::Uint8x4;
1464
+ } else if (inUnion == "uint8") {
1465
+ *outEnum = wgpu::VertexFormat::Uint8;
1434
1466
  } else if (inUnion == "sint8x2") {
1435
1467
  *outEnum = wgpu::VertexFormat::Sint8x2;
1436
1468
  } else if (inUnion == "sint8x4") {
1437
1469
  *outEnum = wgpu::VertexFormat::Sint8x4;
1470
+ } else if (inUnion == "sint8") {
1471
+ *outEnum = wgpu::VertexFormat::Sint8;
1438
1472
  } else if (inUnion == "unorm8x2") {
1439
1473
  *outEnum = wgpu::VertexFormat::Unorm8x2;
1440
1474
  } else if (inUnion == "unorm8x4") {
1441
1475
  *outEnum = wgpu::VertexFormat::Unorm8x4;
1476
+ } else if (inUnion == "unorm8") {
1477
+ *outEnum = wgpu::VertexFormat::Unorm8;
1442
1478
  } else if (inUnion == "snorm8x2") {
1443
1479
  *outEnum = wgpu::VertexFormat::Snorm8x2;
1444
1480
  } else if (inUnion == "snorm8x4") {
1445
1481
  *outEnum = wgpu::VertexFormat::Snorm8x4;
1482
+ } else if (inUnion == "snorm8") {
1483
+ *outEnum = wgpu::VertexFormat::Snorm8;
1446
1484
  } else if (inUnion == "uint16x2") {
1447
1485
  *outEnum = wgpu::VertexFormat::Uint16x2;
1448
1486
  } else if (inUnion == "uint16x4") {
1449
1487
  *outEnum = wgpu::VertexFormat::Uint16x4;
1488
+ } else if (inUnion == "uint16") {
1489
+ *outEnum = wgpu::VertexFormat::Uint16;
1450
1490
  } else if (inUnion == "sint16x2") {
1451
1491
  *outEnum = wgpu::VertexFormat::Sint16x2;
1452
1492
  } else if (inUnion == "sint16x4") {
1453
1493
  *outEnum = wgpu::VertexFormat::Sint16x4;
1494
+ } else if (inUnion == "sint16") {
1495
+ *outEnum = wgpu::VertexFormat::Sint16;
1454
1496
  } else if (inUnion == "unorm16x2") {
1455
1497
  *outEnum = wgpu::VertexFormat::Unorm16x2;
1456
1498
  } else if (inUnion == "unorm16x4") {
1457
1499
  *outEnum = wgpu::VertexFormat::Unorm16x4;
1500
+ } else if (inUnion == "unorm16") {
1501
+ *outEnum = wgpu::VertexFormat::Unorm16;
1458
1502
  } else if (inUnion == "snorm16x2") {
1459
1503
  *outEnum = wgpu::VertexFormat::Snorm16x2;
1460
1504
  } else if (inUnion == "snorm16x4") {
1461
1505
  *outEnum = wgpu::VertexFormat::Snorm16x4;
1506
+ } else if (inUnion == "snorm16") {
1507
+ *outEnum = wgpu::VertexFormat::Snorm16;
1462
1508
  } else if (inUnion == "float16x2") {
1463
1509
  *outEnum = wgpu::VertexFormat::Float16x2;
1464
1510
  } else if (inUnion == "float16x4") {
1465
1511
  *outEnum = wgpu::VertexFormat::Float16x4;
1512
+ } else if (inUnion == "float16") {
1513
+ *outEnum = wgpu::VertexFormat::Float16;
1466
1514
  } else if (inUnion == "float32") {
1467
1515
  *outEnum = wgpu::VertexFormat::Float32;
1468
1516
  } else if (inUnion == "float32x2") {
@@ -1487,6 +1535,8 @@ inline void convertJSUnionToEnum(const std::string &inUnion,
1487
1535
  *outEnum = wgpu::VertexFormat::Sint32x4;
1488
1536
  } else if (inUnion == "unorm10-10-10-2") {
1489
1537
  *outEnum = wgpu::VertexFormat::Unorm10_10_10_2;
1538
+ } else if (inUnion == "unorm8x4-bgra") {
1539
+ *outEnum = wgpu::VertexFormat::Unorm8x4BGRA;
1490
1540
  } else {
1491
1541
  throw invalidUnion(inUnion);
1492
1542
  }
@@ -1504,54 +1554,81 @@ inline void convertEnumToJSUnion(wgpu::VertexFormat inEnum,
1504
1554
  case wgpu::VertexFormat::Uint8x4:
1505
1555
  *outUnion = "uint8x4";
1506
1556
  break;
1557
+ case wgpu::VertexFormat::Uint8:
1558
+ *outUnion = "uint8";
1559
+ break;
1507
1560
  case wgpu::VertexFormat::Sint8x2:
1508
1561
  *outUnion = "sint8x2";
1509
1562
  break;
1510
1563
  case wgpu::VertexFormat::Sint8x4:
1511
1564
  *outUnion = "sint8x4";
1512
1565
  break;
1566
+ case wgpu::VertexFormat::Sint8:
1567
+ *outUnion = "sint8";
1568
+ break;
1513
1569
  case wgpu::VertexFormat::Unorm8x2:
1514
1570
  *outUnion = "unorm8x2";
1515
1571
  break;
1516
1572
  case wgpu::VertexFormat::Unorm8x4:
1517
1573
  *outUnion = "unorm8x4";
1518
1574
  break;
1575
+ case wgpu::VertexFormat::Unorm8:
1576
+ *outUnion = "unorm8";
1577
+ break;
1519
1578
  case wgpu::VertexFormat::Snorm8x2:
1520
1579
  *outUnion = "snorm8x2";
1521
1580
  break;
1522
1581
  case wgpu::VertexFormat::Snorm8x4:
1523
1582
  *outUnion = "snorm8x4";
1524
1583
  break;
1584
+ case wgpu::VertexFormat::Snorm8:
1585
+ *outUnion = "snorm8";
1586
+ break;
1525
1587
  case wgpu::VertexFormat::Uint16x2:
1526
1588
  *outUnion = "uint16x2";
1527
1589
  break;
1528
1590
  case wgpu::VertexFormat::Uint16x4:
1529
1591
  *outUnion = "uint16x4";
1530
1592
  break;
1593
+ case wgpu::VertexFormat::Uint16:
1594
+ *outUnion = "uint16";
1595
+ break;
1531
1596
  case wgpu::VertexFormat::Sint16x2:
1532
1597
  *outUnion = "sint16x2";
1533
1598
  break;
1534
1599
  case wgpu::VertexFormat::Sint16x4:
1535
1600
  *outUnion = "sint16x4";
1536
1601
  break;
1602
+ case wgpu::VertexFormat::Sint16:
1603
+ *outUnion = "sint16";
1604
+ break;
1537
1605
  case wgpu::VertexFormat::Unorm16x2:
1538
1606
  *outUnion = "unorm16x2";
1539
1607
  break;
1540
1608
  case wgpu::VertexFormat::Unorm16x4:
1541
1609
  *outUnion = "unorm16x4";
1542
1610
  break;
1611
+ case wgpu::VertexFormat::Unorm16:
1612
+ *outUnion = "unorm16";
1613
+ break;
1543
1614
  case wgpu::VertexFormat::Snorm16x2:
1544
1615
  *outUnion = "snorm16x2";
1545
1616
  break;
1546
1617
  case wgpu::VertexFormat::Snorm16x4:
1547
1618
  *outUnion = "snorm16x4";
1548
1619
  break;
1620
+ case wgpu::VertexFormat::Snorm16:
1621
+ *outUnion = "snorm16";
1622
+ break;
1549
1623
  case wgpu::VertexFormat::Float16x2:
1550
1624
  *outUnion = "float16x2";
1551
1625
  break;
1552
1626
  case wgpu::VertexFormat::Float16x4:
1553
1627
  *outUnion = "float16x4";
1554
1628
  break;
1629
+ case wgpu::VertexFormat::Float16:
1630
+ *outUnion = "float16";
1631
+ break;
1555
1632
  case wgpu::VertexFormat::Float32:
1556
1633
  *outUnion = "float32";
1557
1634
  break;
@@ -1588,6 +1665,9 @@ inline void convertEnumToJSUnion(wgpu::VertexFormat inEnum,
1588
1665
  case wgpu::VertexFormat::Unorm10_10_10_2:
1589
1666
  *outUnion = "unorm10-10-10-2";
1590
1667
  break;
1668
+ case wgpu::VertexFormat::Unorm8x4BGRA:
1669
+ *outUnion = "unorm8x4-bgra";
1670
+ break;
1591
1671
  default:
1592
1672
  throw invalidEnum(inEnum);
1593
1673
  }
@@ -4,7 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.registerWebGPUForReanimated = void 0;
7
- // Declare global WebGPU worklet helper functions (installed by native module)
7
+ // The native half of the serializer (WebGPUWorkletHelpers in
8
+ // cpp/jsi/NativeObject.h), installed on the main runtime by the native module.
9
+ // determine/pack capture it by closure, and worklets hands a HostObject to
10
+ // every runtime by reference, so the serializer works wherever a WebGPU object
11
+ // is captured (Reanimated UI runtime, createWorkletRuntime, Vision Camera frame
12
+ // processors) without installing anything on those runtimes.
8
13
 
9
14
  let isRegistered = false;
10
15
 
@@ -19,6 +24,11 @@ const registerWebGPUForReanimated = () => {
19
24
  return;
20
25
  }
21
26
  isRegistered = true;
27
+ const helpers = globalThis.__webgpuWorkletHelpers;
28
+ if (helpers === undefined) {
29
+ // The native module is not installed (web, node): nothing to serialize.
30
+ return;
31
+ }
22
32
  try {
23
33
  const {
24
34
  registerCustomSerializable
@@ -28,12 +38,12 @@ const registerWebGPUForReanimated = () => {
28
38
  determine: value => {
29
39
  "worklet";
30
40
 
31
- return __webgpuIsWebGPUObject(value);
41
+ return helpers.isNativeObject(value);
32
42
  },
33
43
  pack: value => {
34
44
  "worklet";
35
45
 
36
- return __webgpuBox(value);
46
+ return helpers.box(value);
37
47
  },
38
48
  unpack: boxed => {
39
49
  "worklet";
@@ -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;;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":[]}
1
+ {"version":3,"names":["isRegistered","registerWebGPUForReanimated","helpers","globalThis","__webgpuWorkletHelpers","undefined","registerCustomSerializable","require","name","determine","value","isNativeObject","pack","box","unpack","boxed","unbox","exports"],"sourceRoot":"../../../../src","sources":["external/reanimated/registerWebGPUForReanimated.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAkBA,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,MAAME,OAAO,GAAGC,UAAU,CAACC,sBAAsB;EACjD,IAAIF,OAAO,KAAKG,SAAS,EAAE;IACzB;IACA;EACF;EAEA,IAAI;IACF,MAAM;MAAEC;IAA2B,CAAC,GAAGC,OAAO,CAAC,uBAAuB,CAAC;IAEvED,0BAA0B,CAAC;MACzBE,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAGC,KAAa,IAAsB;QAC7C,SAAS;;QACT,OAAOR,OAAO,CAACS,cAAc,CAACD,KAAK,CAAC;MACtC,CAAC;MACDE,IAAI,EAAGF,KAAa,IAAK;QACvB,SAAS;;QACT,OAAOR,OAAO,CAACW,GAAG,CAACH,KAAK,CAAC;MAC3B,CAAC;MACDI,MAAM,EAAGC,KAAwB,IAAK;QACpC,SAAS;;QACT,OAAOA,KAAK,CAACC,KAAK,CAAC,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC;AAACC,OAAA,CAAAhB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -1,4 +1,9 @@
1
- // Declare global WebGPU worklet helper functions (installed by native module)
1
+ // The native half of the serializer (WebGPUWorkletHelpers in
2
+ // cpp/jsi/NativeObject.h), installed on the main runtime by the native module.
3
+ // determine/pack capture it by closure, and worklets hands a HostObject to
4
+ // every runtime by reference, so the serializer works wherever a WebGPU object
5
+ // is captured (Reanimated UI runtime, createWorkletRuntime, Vision Camera frame
6
+ // processors) without installing anything on those runtimes.
2
7
 
3
8
  let isRegistered = false;
4
9
 
@@ -13,6 +18,11 @@ export const registerWebGPUForReanimated = () => {
13
18
  return;
14
19
  }
15
20
  isRegistered = true;
21
+ const helpers = globalThis.__webgpuWorkletHelpers;
22
+ if (helpers === undefined) {
23
+ // The native module is not installed (web, node): nothing to serialize.
24
+ return;
25
+ }
16
26
  try {
17
27
  const {
18
28
  registerCustomSerializable
@@ -22,12 +32,12 @@ export const registerWebGPUForReanimated = () => {
22
32
  determine: value => {
23
33
  "worklet";
24
34
 
25
- return __webgpuIsWebGPUObject(value);
35
+ return helpers.isNativeObject(value);
26
36
  },
27
37
  pack: value => {
28
38
  "worklet";
29
39
 
30
- return __webgpuBox(value);
40
+ return helpers.box(value);
31
41
  },
32
42
  unpack: boxed => {
33
43
  "worklet";
@@ -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;;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
+ {"version":3,"names":["isRegistered","registerWebGPUForReanimated","helpers","globalThis","__webgpuWorkletHelpers","undefined","registerCustomSerializable","require","name","determine","value","isNativeObject","pack","box","unpack","boxed","unbox"],"sourceRoot":"../../../../src","sources":["external/reanimated/registerWebGPUForReanimated.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAkBA,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,MAAME,OAAO,GAAGC,UAAU,CAACC,sBAAsB;EACjD,IAAIF,OAAO,KAAKG,SAAS,EAAE;IACzB;IACA;EACF;EAEA,IAAI;IACF,MAAM;MAAEC;IAA2B,CAAC,GAAGC,OAAO,CAAC,uBAAuB,CAAC;IAEvED,0BAA0B,CAAC;MACzBE,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAGC,KAAa,IAAsB;QAC7C,SAAS;;QACT,OAAOR,OAAO,CAACS,cAAc,CAACD,KAAK,CAAC;MACtC,CAAC;MACDE,IAAI,EAAGF,KAAa,IAAK;QACvB,SAAS;;QACT,OAAOR,OAAO,CAACW,GAAG,CAACH,KAAK,CAAC;MAC3B,CAAC;MACDI,MAAM,EAAGC,KAAwB,IAAK;QACpC,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,oDA8BC"}
1
+ {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../commonjs/external/reanimated/registerWebGPUForReanimated.js"],"names":[],"mappings":";AAeA;;;;;GAKG;AACH,oDAmCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../module/external/reanimated/registerWebGPUForReanimated.js"],"names":[],"mappings":"AAUO,oDA8BN"}
1
+ {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../module/external/reanimated/registerWebGPUForReanimated.js"],"names":[],"mappings":"AAeO,oDAmCN"}
@@ -1,3 +1,14 @@
1
+ interface WebGPUWorkletHelpers {
2
+ isNativeObject: (value: unknown) => boolean;
3
+ box: (value: object) => BoxedWebGPUObject;
4
+ }
5
+ interface BoxedWebGPUObject {
6
+ unbox: () => object;
7
+ __boxedWebGPU: true;
8
+ }
9
+ declare global {
10
+ var __webgpuWorkletHelpers: WebGPUWorkletHelpers | undefined;
11
+ }
1
12
  /**
2
13
  * Register WebGPU objects for Worklets serialization.
3
14
  * This allows GPUDevice, GPUCanvasContext, etc. to be passed to worklets.
@@ -5,4 +16,5 @@
5
16
  * This is called automatically when the module loads if react-native-worklets is installed.
6
17
  */
7
18
  export declare const registerWebGPUForReanimated: () => void;
19
+ export {};
8
20
  //# sourceMappingURL=registerWebGPUForReanimated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../src/external/reanimated/registerWebGPUForReanimated.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YA2BvC,CAAC"}
1
+ {"version":3,"file":"registerWebGPUForReanimated.d.ts","sourceRoot":"","sources":["../../../../../src/external/reanimated/registerWebGPUForReanimated.ts"],"names":[],"mappings":"AAMA,UAAU,oBAAoB;IAI5B,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC5C,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,iBAAiB,CAAC;CAC3C;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,aAAa,EAAE,IAAI,CAAC;CACrB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,sBAAsB,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC9D;AAID;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YAiCvC,CAAC"}
@@ -95,6 +95,7 @@ export interface GPUSharedFence {
95
95
  readonly __brand: "GPUSharedFence";
96
96
  label: string;
97
97
  export(): GPUSharedFenceExportInfo;
98
+ destroy(): void;
98
99
  }
99
100
  export interface GPUSharedFenceState {
100
101
  fence: GPUSharedFence;
@@ -114,6 +115,7 @@ export interface GPUSharedTextureMemory {
114
115
  createTexture(descriptor?: GPUTextureDescriptor): GPUTexture;
115
116
  beginAccess(texture: GPUTexture, initialized: boolean, fences?: GPUSharedFenceState[]): void;
116
117
  endAccess(texture: GPUTexture): GPUSharedTextureMemoryEndAccessState;
118
+ destroy(): void;
117
119
  }
118
120
  export {};
119
121
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IAGrB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9D,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACjE,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAChD;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG;IAC/C;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,UAAU,CAAC,WAAW,EAAE,QAAQ,GAAG,eAAe,GAAG,IAAI,CAAC;IAC1D,gB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