react-native-webgpu 0.9.0 → 0.10.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 (143) hide show
  1. package/Package.swift +191 -0
  2. package/android/CMakeLists.txt +1 -2
  3. package/android/src/main/java/com/webgpu/WebGPUSurfaceView.java +10 -1
  4. package/android/src/main/java/com/webgpu/WebGPUTextureView.java +2 -2
  5. package/android/src/main/java/com/webgpu/WebGPUView.java +48 -16
  6. package/android/src/main/java/com/webgpu/WebGPUViewManager.java +21 -4
  7. package/cpp/jsi/JSICache.cpp +97 -0
  8. package/cpp/jsi/JSICache.h +90 -0
  9. package/cpp/jsi/NativeObject.h +24 -86
  10. package/cpp/rnwgpu/RNWebGPUManager.cpp +0 -3
  11. package/cpp/rnwgpu/SurfaceRegistry.h +153 -3
  12. package/cpp/rnwgpu/api/GPUAdapter.cpp +43 -1
  13. package/cpp/rnwgpu/api/GPUDevice.cpp +6 -1
  14. package/cpp/rnwgpu/api/GPUExternalTexture.cpp +5 -7
  15. package/cpp/rnwgpu/api/GPUExternalTexture.h +40 -3
  16. package/cpp/rnwgpu/api/GPUFeatures.h +2 -1
  17. package/cpp/rnwgpu/api/GPUSharedTextureMemory.cpp +2 -2
  18. package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +11 -0
  19. package/cpp/webgpu/webgpu.h +63 -29
  20. package/cpp/webgpu/webgpu_cpp.h +415 -367
  21. package/cpp/webgpu/webgpu_cpp_print.h +21 -9
  22. package/cpp/webgpu/webgpu_enum_class_bitmasks.h +2 -1
  23. package/lib/commonjs/Canvas.js +8 -2
  24. package/lib/commonjs/Canvas.js.map +1 -1
  25. package/lib/commonjs/WebGPUViewNativeComponent.js.map +1 -1
  26. package/lib/commonjs/WebGPUViewNativeComponent.web.js +4 -2
  27. package/lib/commonjs/WebGPUViewNativeComponent.web.js.map +1 -1
  28. package/lib/commonjs/mock.js +3 -1
  29. package/lib/commonjs/mock.js.map +1 -1
  30. package/lib/module/Canvas.js +8 -2
  31. package/lib/module/Canvas.js.map +1 -1
  32. package/lib/module/WebGPUViewNativeComponent.js.map +1 -1
  33. package/lib/module/WebGPUViewNativeComponent.web.js +4 -2
  34. package/lib/module/WebGPUViewNativeComponent.web.js.map +1 -1
  35. package/lib/module/mock.js +3 -1
  36. package/lib/module/mock.js.map +1 -1
  37. package/lib/typescript/lib/commonjs/Canvas.d.ts +3 -2
  38. package/lib/typescript/lib/commonjs/Canvas.d.ts.map +1 -1
  39. package/lib/typescript/lib/commonjs/WebGPUViewNativeComponent.web.d.ts.map +1 -1
  40. package/lib/typescript/lib/commonjs/mock.d.ts +3 -2
  41. package/lib/typescript/lib/commonjs/mock.d.ts.map +1 -1
  42. package/lib/typescript/lib/module/Canvas.d.ts +3 -2
  43. package/lib/typescript/lib/module/Canvas.d.ts.map +1 -1
  44. package/lib/typescript/lib/module/WebGPUViewNativeComponent.web.d.ts.map +1 -1
  45. package/lib/typescript/lib/module/mock.d.ts +3 -2
  46. package/lib/typescript/lib/module/mock.d.ts.map +1 -1
  47. package/lib/typescript/src/Canvas.d.ts +24 -3
  48. package/lib/typescript/src/Canvas.d.ts.map +1 -1
  49. package/lib/typescript/src/WebGPUViewNativeComponent.d.ts +4 -2
  50. package/lib/typescript/src/WebGPUViewNativeComponent.d.ts.map +1 -1
  51. package/lib/typescript/src/WebGPUViewNativeComponent.web.d.ts +3 -1
  52. package/lib/typescript/src/WebGPUViewNativeComponent.web.d.ts.map +1 -1
  53. package/lib/typescript/src/index.d.ts +1 -0
  54. package/lib/typescript/src/index.d.ts.map +1 -1
  55. package/lib/typescript/src/mock.d.ts +3 -7
  56. package/lib/typescript/src/mock.d.ts.map +1 -1
  57. package/lib/typescript/src/types.d.ts.map +1 -1
  58. package/libs/android/arm64-v8a/libwebgpu_dawn.so +0 -0
  59. package/libs/android/armeabi-v7a/libwebgpu_dawn.so +0 -0
  60. package/libs/android/x86/libwebgpu_dawn.so +0 -0
  61. package/libs/android/x86_64/libwebgpu_dawn.so +0 -0
  62. package/libs/apple/libwebgpu_dawn.xcframework/Info.plist +12 -6
  63. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/dawn_proc_table.h +329 -0
  64. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/native/DawnNative.h +367 -0
  65. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/native/NullBackend.h +39 -0
  66. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/native/OpenGLBackend.h +89 -0
  67. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/native/VulkanBackend.h +183 -0
  68. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/native/dawn_native_export.h +49 -0
  69. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/webgpu.h +5063 -0
  70. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/webgpu.ixx +358 -0
  71. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/webgpu_cpp.h +10401 -0
  72. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/webgpu_cpp_print.h +2868 -0
  73. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/wire/client/webgpu.h +369 -0
  74. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/wire/client/webgpu_cpp.h +10584 -0
  75. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/dawn/wire/client/webgpu_cpp_print.h +2868 -0
  76. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu/webgpu.h +33 -0
  77. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu/webgpu_cpp.h +33 -0
  78. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu/webgpu_cpp_chained_struct.h +57 -0
  79. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu/webgpu_cpp_print.h +33 -0
  80. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu/webgpu_enum_class_bitmasks.h +163 -0
  81. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu_upstream/webgpu/webgpu_cpp.h +5932 -0
  82. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu_upstream/webgpu/webgpu_cpp_chained_struct.h +54 -0
  83. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu_upstream/webgpu/webgpu_cpp_print.h +2059 -0
  84. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/Headers/webgpu_upstream/webgpu/webgpu_enum_class_bitmasks.h +163 -0
  85. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/libwebgpu_dawn.a +0 -0
  86. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/dawn_proc_table.h +329 -0
  87. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/native/DawnNative.h +367 -0
  88. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/native/NullBackend.h +39 -0
  89. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/native/OpenGLBackend.h +89 -0
  90. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/native/VulkanBackend.h +183 -0
  91. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/native/dawn_native_export.h +49 -0
  92. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/webgpu.h +5063 -0
  93. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/webgpu.ixx +358 -0
  94. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/webgpu_cpp.h +10401 -0
  95. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/webgpu_cpp_print.h +2868 -0
  96. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/wire/client/webgpu.h +369 -0
  97. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/wire/client/webgpu_cpp.h +10584 -0
  98. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/dawn/wire/client/webgpu_cpp_print.h +2868 -0
  99. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu/webgpu.h +33 -0
  100. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu/webgpu_cpp.h +33 -0
  101. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu/webgpu_cpp_chained_struct.h +57 -0
  102. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu/webgpu_cpp_print.h +33 -0
  103. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu/webgpu_enum_class_bitmasks.h +163 -0
  104. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu_upstream/webgpu/webgpu_cpp.h +5932 -0
  105. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu_upstream/webgpu/webgpu_cpp_chained_struct.h +54 -0
  106. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu_upstream/webgpu/webgpu_cpp_print.h +2059 -0
  107. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/Headers/webgpu_upstream/webgpu/webgpu_enum_class_bitmasks.h +163 -0
  108. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a +0 -0
  109. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/dawn_proc_table.h +329 -0
  110. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/native/DawnNative.h +367 -0
  111. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/native/NullBackend.h +39 -0
  112. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/native/OpenGLBackend.h +89 -0
  113. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/native/VulkanBackend.h +183 -0
  114. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/native/dawn_native_export.h +49 -0
  115. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/webgpu.h +5063 -0
  116. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/webgpu.ixx +358 -0
  117. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/webgpu_cpp.h +10401 -0
  118. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/webgpu_cpp_print.h +2868 -0
  119. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/wire/client/webgpu.h +369 -0
  120. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/wire/client/webgpu_cpp.h +10584 -0
  121. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/dawn/wire/client/webgpu_cpp_print.h +2868 -0
  122. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu/webgpu.h +33 -0
  123. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu/webgpu_cpp.h +33 -0
  124. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu/webgpu_cpp_chained_struct.h +57 -0
  125. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu/webgpu_cpp_print.h +33 -0
  126. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu/webgpu_enum_class_bitmasks.h +163 -0
  127. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu_upstream/webgpu/webgpu_cpp.h +5932 -0
  128. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu_upstream/webgpu/webgpu_cpp_chained_struct.h +54 -0
  129. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu_upstream/webgpu/webgpu_cpp_print.h +2059 -0
  130. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/Headers/webgpu_upstream/webgpu/webgpu_enum_class_bitmasks.h +163 -0
  131. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/libwebgpu_dawn.a +0 -0
  132. package/package.json +7 -5
  133. package/react-native-webgpu.podspec +33 -9
  134. package/src/Canvas.tsx +43 -4
  135. package/src/WebGPUViewNativeComponent.ts +10 -2
  136. package/src/WebGPUViewNativeComponent.web.ts +12 -3
  137. package/src/index.tsx +7 -0
  138. package/src/mock.ts +12 -9
  139. package/src/types.ts +1 -3
  140. package/cpp/jsi/RuntimeAwareCache.cpp +0 -8
  141. package/cpp/jsi/RuntimeAwareCache.h +0 -133
  142. package/cpp/jsi/RuntimeLifecycleMonitor.cpp +0 -72
  143. package/cpp/jsi/RuntimeLifecycleMonitor.h +0 -32
@@ -0,0 +1,54 @@
1
+ // Copyright 2023 The Dawn & Tint Authors
2
+ //
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
5
+ //
6
+ // 1. Redistributions of source code must retain the above copyright notice, this
7
+ // list of conditions and the following disclaimer.
8
+ //
9
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ // this list of conditions and the following disclaimer in the documentation
11
+ // and/or other materials provided with the distribution.
12
+ //
13
+ // 3. Neither the name of the copyright holder nor the names of its
14
+ // contributors may be used to endorse or promote products derived from
15
+ // this software without specific prior written permission.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+
29
+ #ifndef WEBGPU_CPP_CHAINED_STRUCT_H_
30
+ #define WEBGPU_CPP_CHAINED_STRUCT_H_
31
+
32
+ #include <cstddef>
33
+ #include <cstdint>
34
+
35
+ // This header file declares the ChainedStruct structures separately from the WebGPU
36
+ // headers so that dependencies can directly extend structures without including the larger header
37
+ // which exposes capabilities that may require correctly set proc tables.
38
+ namespace wgpu {
39
+
40
+ enum class SType : uint32_t;
41
+
42
+ struct ChainedStruct {
43
+ ChainedStruct const * nextInChain = nullptr;
44
+ SType sType = SType(0u);
45
+ };
46
+
47
+ struct ChainedStructOut {
48
+ ChainedStructOut * nextInChain = nullptr;
49
+ SType sType = SType(0u);
50
+ };
51
+
52
+ } // namespace wgpu}
53
+
54
+ #endif // WEBGPU_CPP_CHAINED_STRUCT_H_