react-native-wgpu 0.4.2 → 0.5.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.
- package/README.md +31 -0
- package/android/CMakeLists.txt +3 -3
- package/cpp/jsi/{RNFEnumMapper.h → EnumMapper.h} +2 -6
- package/cpp/jsi/{RNFJSIConverter.h → JSIConverter.h} +27 -110
- package/cpp/jsi/NativeObject.h +607 -0
- package/cpp/jsi/{RNFPromise.cpp → Promise.cpp} +3 -6
- package/cpp/jsi/{RNFPromise.h → Promise.h} +2 -5
- package/cpp/jsi/RuntimeAwareCache.cpp +7 -0
- package/cpp/jsi/RuntimeAwareCache.h +100 -0
- package/cpp/jsi/RuntimeLifecycleMonitor.cpp +72 -0
- package/cpp/jsi/RuntimeLifecycleMonitor.h +32 -0
- package/cpp/rnwgpu/ArrayBuffer.h +8 -12
- package/cpp/rnwgpu/RNWebGPUManager.cpp +187 -28
- package/cpp/rnwgpu/RNWebGPUManager.h +7 -0
- package/cpp/rnwgpu/api/Canvas.h +14 -12
- package/cpp/rnwgpu/api/GPU.cpp +4 -6
- package/cpp/rnwgpu/api/GPU.h +13 -11
- package/cpp/rnwgpu/api/GPUAdapter.cpp +9 -9
- package/cpp/rnwgpu/api/GPUAdapter.h +14 -11
- package/cpp/rnwgpu/api/GPUAdapterInfo.h +17 -15
- package/cpp/rnwgpu/api/GPUBindGroup.h +11 -10
- package/cpp/rnwgpu/api/GPUBindGroupLayout.h +12 -11
- package/cpp/rnwgpu/api/GPUBuffer.h +19 -16
- package/cpp/rnwgpu/api/GPUCanvasContext.h +17 -13
- package/cpp/rnwgpu/api/GPUCommandBuffer.h +12 -10
- package/cpp/rnwgpu/api/GPUCommandEncoder.h +35 -32
- package/cpp/rnwgpu/api/GPUCompilationInfo.h +19 -19
- package/cpp/rnwgpu/api/GPUCompilationMessage.h +10 -7
- package/cpp/rnwgpu/api/GPUComputePassEncoder.h +28 -27
- package/cpp/rnwgpu/api/GPUComputePipeline.h +14 -13
- package/cpp/rnwgpu/api/GPUDevice.cpp +111 -95
- package/cpp/rnwgpu/api/GPUDevice.h +51 -43
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +12 -10
- package/cpp/rnwgpu/api/GPUError.h +19 -29
- package/cpp/rnwgpu/api/GPUExtent3D.h +7 -10
- package/cpp/rnwgpu/api/GPUExternalTexture.h +12 -11
- package/cpp/rnwgpu/api/GPUInternalError.h +31 -0
- package/cpp/rnwgpu/api/GPUOrigin2D.h +6 -10
- package/cpp/rnwgpu/api/GPUOrigin3D.h +6 -10
- package/cpp/rnwgpu/api/GPUOutOfMemoryError.h +33 -0
- package/cpp/rnwgpu/api/GPUPipelineLayout.h +12 -10
- package/cpp/rnwgpu/api/GPUQuerySet.h +14 -12
- package/cpp/rnwgpu/api/GPUQueue.h +18 -17
- package/cpp/rnwgpu/api/GPURenderBundle.h +11 -10
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +36 -33
- package/cpp/rnwgpu/api/GPURenderPassEncoder.h +49 -47
- package/cpp/rnwgpu/api/GPURenderPipeline.h +14 -12
- package/cpp/rnwgpu/api/GPUSampler.h +11 -10
- package/cpp/rnwgpu/api/GPUShaderModule.cpp +7 -8
- package/cpp/rnwgpu/api/GPUShaderModule.h +13 -12
- package/cpp/rnwgpu/api/GPUSupportedLimits.h +73 -93
- package/cpp/rnwgpu/api/GPUTexture.h +24 -20
- package/cpp/rnwgpu/api/GPUTextureView.h +11 -10
- package/cpp/rnwgpu/api/GPUValidationError.h +32 -0
- package/cpp/rnwgpu/api/ImageBitmap.h +10 -6
- package/cpp/rnwgpu/api/RNWebGPU.h +21 -21
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +7 -11
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutEntry.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUBlendComponent.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUBlendState.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUBufferBinding.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUBufferBindingLayout.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUBufferDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUBufferUsage.h +28 -32
- package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUColor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUColorTargetState.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUColorWrite.h +18 -20
- package/cpp/rnwgpu/api/descriptors/GPUCommandBufferDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUCommandEncoderDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUComputePassDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUComputePassTimestampWrites.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUComputePipelineDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUDepthStencilState.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureBindingLayout.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUFragmentState.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyBuffer.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUImageDataLayout.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUMapMode.h +11 -14
- package/cpp/rnwgpu/api/descriptors/GPUMultisampleState.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUPipelineLayoutDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUPrimitiveState.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUProgrammableStage.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUQuerySetDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUQueueDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleEncoderDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPURenderPassColorAttachment.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDepthStencilAttachment.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPURenderPassTimestampWrites.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPURenderPipelineDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPURequestAdapterOptions.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUSamplerBindingLayout.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUSamplerDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleCompilationHint.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUShaderStage.h +14 -16
- package/cpp/rnwgpu/api/descriptors/GPUStencilFaceState.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUStorageTextureBindingLayout.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUTextureBindingLayout.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUTextureUsage.h +18 -29
- package/cpp/rnwgpu/api/descriptors/GPUTextureViewDescriptor.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUVertexAttribute.h +3 -8
- package/cpp/rnwgpu/api/descriptors/GPUVertexBufferLayout.h +3 -7
- package/cpp/rnwgpu/api/descriptors/GPUVertexState.h +3 -7
- package/cpp/rnwgpu/api/descriptors/Unions.h +3 -3
- package/cpp/rnwgpu/async/AsyncTaskHandle.cpp +10 -10
- package/cpp/rnwgpu/async/AsyncTaskHandle.h +2 -2
- package/lib/commonjs/external/ModuleProxy.js +36 -0
- package/lib/commonjs/external/ModuleProxy.js.map +1 -0
- package/lib/commonjs/external/index.js +17 -0
- package/lib/commonjs/external/index.js.map +1 -0
- package/lib/commonjs/external/reanimated/ReanimatedProxy.js +18 -0
- package/lib/commonjs/external/reanimated/ReanimatedProxy.js.map +1 -0
- package/lib/commonjs/external/reanimated/index.js +21 -0
- package/lib/commonjs/external/reanimated/index.js.map +1 -0
- package/lib/commonjs/external/reanimated/registerWebGPUForReanimated.js +50 -0
- package/lib/commonjs/external/reanimated/registerWebGPUForReanimated.js.map +1 -0
- package/lib/commonjs/main/index.js +2 -142
- package/lib/commonjs/main/index.js.map +1 -1
- package/lib/module/external/ModuleProxy.js +28 -0
- package/lib/module/external/ModuleProxy.js.map +1 -0
- package/lib/module/external/index.js +2 -0
- package/lib/module/external/index.js.map +1 -0
- package/lib/module/external/reanimated/ReanimatedProxy.js +12 -0
- package/lib/module/external/reanimated/ReanimatedProxy.js.map +1 -0
- package/lib/module/external/reanimated/index.js +3 -0
- package/lib/module/external/reanimated/index.js.map +1 -0
- package/lib/module/external/reanimated/registerWebGPUForReanimated.js +43 -0
- package/lib/module/external/reanimated/registerWebGPUForReanimated.js.map +1 -0
- package/lib/module/main/index.js +2 -141
- package/lib/module/main/index.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +1 -0
- package/lib/typescript/lib/commonjs/external/ModuleProxy.d.ts +12 -0
- package/lib/typescript/lib/commonjs/external/ModuleProxy.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/external/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/external/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/external/reanimated/ReanimatedProxy.d.ts +6 -0
- package/lib/typescript/lib/commonjs/external/reanimated/ReanimatedProxy.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/external/reanimated/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/external/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/external/reanimated/registerWebGPUForReanimated.d.ts +9 -0
- package/lib/typescript/lib/commonjs/external/reanimated/registerWebGPUForReanimated.d.ts.map +1 -0
- package/lib/typescript/lib/module/external/ModuleProxy.d.ts +7 -0
- package/lib/typescript/lib/module/external/ModuleProxy.d.ts.map +1 -0
- package/lib/typescript/lib/module/external/index.d.ts +2 -0
- package/lib/typescript/lib/module/external/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/external/reanimated/ReanimatedProxy.d.ts +5 -0
- package/lib/typescript/lib/module/external/reanimated/ReanimatedProxy.d.ts.map +1 -0
- package/lib/typescript/lib/module/external/reanimated/index.d.ts +3 -0
- package/lib/typescript/lib/module/external/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/external/reanimated/registerWebGPUForReanimated.d.ts +2 -0
- package/lib/typescript/lib/module/external/reanimated/registerWebGPUForReanimated.d.ts.map +1 -0
- package/lib/typescript/src/external/ModuleProxy.d.ts +11 -0
- package/lib/typescript/src/external/ModuleProxy.d.ts.map +1 -0
- package/lib/typescript/src/external/index.d.ts +2 -0
- package/lib/typescript/src/external/index.d.ts.map +1 -0
- package/lib/typescript/src/external/reanimated/ReanimatedProxy.d.ts +4 -0
- package/lib/typescript/src/external/reanimated/ReanimatedProxy.d.ts.map +1 -0
- package/lib/typescript/src/external/reanimated/index.d.ts +3 -0
- package/lib/typescript/src/external/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/src/external/reanimated/registerWebGPUForReanimated.d.ts +8 -0
- package/lib/typescript/src/external/reanimated/registerWebGPUForReanimated.d.ts.map +1 -0
- package/package.json +16 -3
- package/src/external/ModuleProxy.ts +30 -0
- package/src/external/index.ts +1 -0
- package/src/external/reanimated/ReanimatedProxy.ts +19 -0
- package/src/external/reanimated/index.ts +2 -0
- package/src/external/reanimated/registerWebGPUForReanimated.ts +43 -0
- package/src/main/index.tsx +3 -170
- package/cpp/jsi/RNFHybridObject.cpp +0 -150
- package/cpp/jsi/RNFHybridObject.h +0 -181
- package/cpp/jsi/RNFJSIHelper.h +0 -51
- package/cpp/jsi/RNFPointerHolder.h +0 -95
- package/cpp/jsi/RNFRuntimeState.cpp +0 -18
- package/cpp/jsi/RNFRuntimeState.h +0 -106
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
#include "webgpu/webgpu_cpp.h"
|
|
8
8
|
|
|
9
|
-
#include "
|
|
9
|
+
#include "JSIConverter.h"
|
|
10
10
|
#include "WGPULogger.h"
|
|
11
11
|
|
|
12
12
|
#include "GPUShaderModule.h"
|
|
13
|
-
#include "RNFHybridObject.h"
|
|
14
13
|
|
|
15
14
|
namespace jsi = facebook::jsi;
|
|
16
|
-
namespace m = margelo;
|
|
17
15
|
|
|
18
16
|
namespace rnwgpu {
|
|
19
17
|
|
|
@@ -26,9 +24,7 @@ struct GPUProgrammableStage {
|
|
|
26
24
|
|
|
27
25
|
} // namespace rnwgpu
|
|
28
26
|
|
|
29
|
-
namespace
|
|
30
|
-
|
|
31
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
27
|
+
namespace rnwgpu {
|
|
32
28
|
|
|
33
29
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUProgrammableStage>> {
|
|
34
30
|
static std::shared_ptr<rnwgpu::GPUProgrammableStage>
|
|
@@ -63,4 +59,4 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUProgrammableStage>> {
|
|
|
63
59
|
}
|
|
64
60
|
};
|
|
65
61
|
|
|
66
|
-
} // namespace
|
|
62
|
+
} // namespace rnwgpu
|
|
@@ -5,13 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
#include "webgpu/webgpu_cpp.h"
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "JSIConverter.h"
|
|
9
9
|
#include "WGPULogger.h"
|
|
10
10
|
|
|
11
|
-
#include "RNFHybridObject.h"
|
|
12
|
-
|
|
13
11
|
namespace jsi = facebook::jsi;
|
|
14
|
-
namespace m = margelo;
|
|
15
12
|
|
|
16
13
|
namespace rnwgpu {
|
|
17
14
|
|
|
@@ -23,9 +20,7 @@ struct GPUQuerySetDescriptor {
|
|
|
23
20
|
|
|
24
21
|
} // namespace rnwgpu
|
|
25
22
|
|
|
26
|
-
namespace
|
|
27
|
-
|
|
28
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
23
|
+
namespace rnwgpu {
|
|
29
24
|
|
|
30
25
|
template <>
|
|
31
26
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUQuerySetDescriptor>> {
|
|
@@ -58,4 +53,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPUQuerySetDescriptor>> {
|
|
|
58
53
|
}
|
|
59
54
|
};
|
|
60
55
|
|
|
61
|
-
} // namespace
|
|
56
|
+
} // namespace rnwgpu
|
|
@@ -5,13 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
#include "webgpu/webgpu_cpp.h"
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "JSIConverter.h"
|
|
9
9
|
#include "WGPULogger.h"
|
|
10
10
|
|
|
11
|
-
#include "RNFHybridObject.h"
|
|
12
|
-
|
|
13
11
|
namespace jsi = facebook::jsi;
|
|
14
|
-
namespace m = margelo;
|
|
15
12
|
|
|
16
13
|
namespace rnwgpu {
|
|
17
14
|
|
|
@@ -21,9 +18,7 @@ struct GPUQueueDescriptor {
|
|
|
21
18
|
|
|
22
19
|
} // namespace rnwgpu
|
|
23
20
|
|
|
24
|
-
namespace
|
|
25
|
-
|
|
26
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
21
|
+
namespace rnwgpu {
|
|
27
22
|
|
|
28
23
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUQueueDescriptor>> {
|
|
29
24
|
static std::shared_ptr<rnwgpu::GPUQueueDescriptor>
|
|
@@ -46,4 +41,4 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUQueueDescriptor>> {
|
|
|
46
41
|
}
|
|
47
42
|
};
|
|
48
43
|
|
|
49
|
-
} // namespace
|
|
44
|
+
} // namespace rnwgpu
|
|
@@ -5,13 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
#include "webgpu/webgpu_cpp.h"
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "JSIConverter.h"
|
|
9
9
|
#include "WGPULogger.h"
|
|
10
10
|
|
|
11
|
-
#include "RNFHybridObject.h"
|
|
12
|
-
|
|
13
11
|
namespace jsi = facebook::jsi;
|
|
14
|
-
namespace m = margelo;
|
|
15
12
|
|
|
16
13
|
namespace rnwgpu {
|
|
17
14
|
|
|
@@ -21,9 +18,7 @@ struct GPURenderBundleDescriptor {
|
|
|
21
18
|
|
|
22
19
|
} // namespace rnwgpu
|
|
23
20
|
|
|
24
|
-
namespace
|
|
25
|
-
|
|
26
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
21
|
+
namespace rnwgpu {
|
|
27
22
|
|
|
28
23
|
template <>
|
|
29
24
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderBundleDescriptor>> {
|
|
@@ -48,4 +43,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderBundleDescriptor>> {
|
|
|
48
43
|
}
|
|
49
44
|
};
|
|
50
45
|
|
|
51
|
-
} // namespace
|
|
46
|
+
} // namespace rnwgpu
|
|
@@ -6,13 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
#include "webgpu/webgpu_cpp.h"
|
|
8
8
|
|
|
9
|
-
#include "
|
|
9
|
+
#include "JSIConverter.h"
|
|
10
10
|
#include "WGPULogger.h"
|
|
11
11
|
|
|
12
|
-
#include "RNFHybridObject.h"
|
|
13
|
-
|
|
14
12
|
namespace jsi = facebook::jsi;
|
|
15
|
-
namespace m = margelo;
|
|
16
13
|
|
|
17
14
|
namespace rnwgpu {
|
|
18
15
|
|
|
@@ -28,9 +25,7 @@ struct GPURenderBundleEncoderDescriptor {
|
|
|
28
25
|
|
|
29
26
|
} // namespace rnwgpu
|
|
30
27
|
|
|
31
|
-
namespace
|
|
32
|
-
|
|
33
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
28
|
+
namespace rnwgpu {
|
|
34
29
|
|
|
35
30
|
template <>
|
|
36
31
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderBundleEncoderDescriptor>> {
|
|
@@ -83,4 +78,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderBundleEncoderDescriptor>> {
|
|
|
83
78
|
}
|
|
84
79
|
};
|
|
85
80
|
|
|
86
|
-
} // namespace
|
|
81
|
+
} // namespace rnwgpu
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
10
|
#include "GPUColor.h"
|
|
11
11
|
#include "GPUTextureView.h"
|
|
12
|
-
#include "RNFHybridObject.h"
|
|
13
12
|
|
|
14
13
|
namespace jsi = facebook::jsi;
|
|
15
|
-
namespace m = margelo;
|
|
16
14
|
|
|
17
15
|
namespace rnwgpu {
|
|
18
16
|
|
|
@@ -28,9 +26,7 @@ struct GPURenderPassColorAttachment {
|
|
|
28
26
|
|
|
29
27
|
} // namespace rnwgpu
|
|
30
28
|
|
|
31
|
-
namespace
|
|
32
|
-
|
|
33
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
29
|
+
namespace rnwgpu {
|
|
34
30
|
|
|
35
31
|
template <>
|
|
36
32
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPassColorAttachment>> {
|
|
@@ -83,4 +79,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPassColorAttachment>> {
|
|
|
83
79
|
}
|
|
84
80
|
};
|
|
85
81
|
|
|
86
|
-
} // namespace
|
|
82
|
+
} // namespace rnwgpu
|
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
10
|
#include "GPUTextureView.h"
|
|
11
|
-
#include "RNFHybridObject.h"
|
|
12
11
|
|
|
13
12
|
namespace jsi = facebook::jsi;
|
|
14
|
-
namespace m = margelo;
|
|
15
13
|
|
|
16
14
|
namespace rnwgpu {
|
|
17
15
|
|
|
@@ -29,9 +27,7 @@ struct GPURenderPassDepthStencilAttachment {
|
|
|
29
27
|
|
|
30
28
|
} // namespace rnwgpu
|
|
31
29
|
|
|
32
|
-
namespace
|
|
33
|
-
|
|
34
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
30
|
+
namespace rnwgpu {
|
|
35
31
|
|
|
36
32
|
template <>
|
|
37
33
|
struct JSIConverter<
|
|
@@ -103,4 +99,4 @@ struct JSIConverter<
|
|
|
103
99
|
}
|
|
104
100
|
};
|
|
105
101
|
|
|
106
|
-
} // namespace
|
|
102
|
+
} // namespace rnwgpu
|
|
@@ -7,17 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
#include "webgpu/webgpu_cpp.h"
|
|
9
9
|
|
|
10
|
-
#include "
|
|
10
|
+
#include "JSIConverter.h"
|
|
11
11
|
#include "WGPULogger.h"
|
|
12
12
|
|
|
13
13
|
#include "GPUQuerySet.h"
|
|
14
14
|
#include "GPURenderPassColorAttachment.h"
|
|
15
15
|
#include "GPURenderPassDepthStencilAttachment.h"
|
|
16
16
|
#include "GPURenderPassTimestampWrites.h"
|
|
17
|
-
#include "RNFHybridObject.h"
|
|
18
17
|
|
|
19
18
|
namespace jsi = facebook::jsi;
|
|
20
|
-
namespace m = margelo;
|
|
21
19
|
|
|
22
20
|
namespace rnwgpu {
|
|
23
21
|
|
|
@@ -36,9 +34,7 @@ struct GPURenderPassDescriptor {
|
|
|
36
34
|
|
|
37
35
|
} // namespace rnwgpu
|
|
38
36
|
|
|
39
|
-
namespace
|
|
40
|
-
|
|
41
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
37
|
+
namespace rnwgpu {
|
|
42
38
|
|
|
43
39
|
template <>
|
|
44
40
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPassDescriptor>> {
|
|
@@ -94,4 +90,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPassDescriptor>> {
|
|
|
94
90
|
}
|
|
95
91
|
};
|
|
96
92
|
|
|
97
|
-
} // namespace
|
|
93
|
+
} // namespace rnwgpu
|
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
10
|
#include "GPUQuerySet.h"
|
|
11
|
-
#include "RNFHybridObject.h"
|
|
12
11
|
|
|
13
12
|
namespace jsi = facebook::jsi;
|
|
14
|
-
namespace m = margelo;
|
|
15
13
|
|
|
16
14
|
namespace rnwgpu {
|
|
17
15
|
|
|
@@ -23,9 +21,7 @@ struct GPURenderPassTimestampWrites {
|
|
|
23
21
|
|
|
24
22
|
} // namespace rnwgpu
|
|
25
23
|
|
|
26
|
-
namespace
|
|
27
|
-
|
|
28
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
24
|
+
namespace rnwgpu {
|
|
29
25
|
|
|
30
26
|
template <>
|
|
31
27
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPassTimestampWrites>> {
|
|
@@ -60,4 +56,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPassTimestampWrites>> {
|
|
|
60
56
|
}
|
|
61
57
|
};
|
|
62
58
|
|
|
63
|
-
} // namespace
|
|
59
|
+
} // namespace rnwgpu
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#include "webgpu/webgpu_cpp.h"
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "JSIConverter.h"
|
|
9
9
|
#include "WGPULogger.h"
|
|
10
10
|
|
|
11
11
|
#include "GPUDepthStencilState.h"
|
|
@@ -14,10 +14,8 @@
|
|
|
14
14
|
#include "GPUPipelineLayout.h"
|
|
15
15
|
#include "GPUPrimitiveState.h"
|
|
16
16
|
#include "GPUVertexState.h"
|
|
17
|
-
#include "RNFHybridObject.h"
|
|
18
17
|
|
|
19
18
|
namespace jsi = facebook::jsi;
|
|
20
|
-
namespace m = margelo;
|
|
21
19
|
|
|
22
20
|
namespace rnwgpu {
|
|
23
21
|
|
|
@@ -37,9 +35,7 @@ struct GPURenderPipelineDescriptor {
|
|
|
37
35
|
|
|
38
36
|
} // namespace rnwgpu
|
|
39
37
|
|
|
40
|
-
namespace
|
|
41
|
-
|
|
42
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
38
|
+
namespace rnwgpu {
|
|
43
39
|
|
|
44
40
|
template <>
|
|
45
41
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPipelineDescriptor>> {
|
|
@@ -105,4 +101,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPipelineDescriptor>> {
|
|
|
105
101
|
}
|
|
106
102
|
};
|
|
107
103
|
|
|
108
|
-
} // namespace
|
|
104
|
+
} // namespace rnwgpu
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
|
-
#include "RNFHybridObject.h"
|
|
11
|
-
|
|
12
10
|
namespace jsi = facebook::jsi;
|
|
13
|
-
namespace m = margelo;
|
|
14
11
|
|
|
15
12
|
namespace rnwgpu {
|
|
16
13
|
|
|
@@ -21,9 +18,7 @@ struct GPURequestAdapterOptions {
|
|
|
21
18
|
|
|
22
19
|
} // namespace rnwgpu
|
|
23
20
|
|
|
24
|
-
namespace
|
|
25
|
-
|
|
26
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
21
|
+
namespace rnwgpu {
|
|
27
22
|
|
|
28
23
|
template <>
|
|
29
24
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPURequestAdapterOptions>> {
|
|
@@ -54,4 +49,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPURequestAdapterOptions>> {
|
|
|
54
49
|
}
|
|
55
50
|
};
|
|
56
51
|
|
|
57
|
-
} // namespace
|
|
52
|
+
} // namespace rnwgpu
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
|
-
#include "RNFHybridObject.h"
|
|
11
|
-
|
|
12
10
|
namespace jsi = facebook::jsi;
|
|
13
|
-
namespace m = margelo;
|
|
14
11
|
|
|
15
12
|
namespace rnwgpu {
|
|
16
13
|
|
|
@@ -20,9 +17,7 @@ struct GPUSamplerBindingLayout {
|
|
|
20
17
|
|
|
21
18
|
} // namespace rnwgpu
|
|
22
19
|
|
|
23
|
-
namespace
|
|
24
|
-
|
|
25
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
20
|
+
namespace rnwgpu {
|
|
26
21
|
|
|
27
22
|
template <>
|
|
28
23
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUSamplerBindingLayout>> {
|
|
@@ -48,4 +43,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPUSamplerBindingLayout>> {
|
|
|
48
43
|
}
|
|
49
44
|
};
|
|
50
45
|
|
|
51
|
-
} // namespace
|
|
46
|
+
} // namespace rnwgpu
|
|
@@ -5,13 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
#include "webgpu/webgpu_cpp.h"
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "JSIConverter.h"
|
|
9
9
|
#include "WGPULogger.h"
|
|
10
10
|
|
|
11
|
-
#include "RNFHybridObject.h"
|
|
12
|
-
|
|
13
11
|
namespace jsi = facebook::jsi;
|
|
14
|
-
namespace m = margelo;
|
|
15
12
|
|
|
16
13
|
namespace rnwgpu {
|
|
17
14
|
|
|
@@ -31,9 +28,7 @@ struct GPUSamplerDescriptor {
|
|
|
31
28
|
|
|
32
29
|
} // namespace rnwgpu
|
|
33
30
|
|
|
34
|
-
namespace
|
|
35
|
-
|
|
36
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
31
|
+
namespace rnwgpu {
|
|
37
32
|
|
|
38
33
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUSamplerDescriptor>> {
|
|
39
34
|
static std::shared_ptr<rnwgpu::GPUSamplerDescriptor>
|
|
@@ -113,4 +108,4 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUSamplerDescriptor>> {
|
|
|
113
108
|
}
|
|
114
109
|
};
|
|
115
110
|
|
|
116
|
-
} // namespace
|
|
111
|
+
} // namespace rnwgpu
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
#include "webgpu/webgpu_cpp.h"
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "JSIConverter.h"
|
|
9
9
|
#include "WGPULogger.h"
|
|
10
10
|
|
|
11
11
|
#include "GPUPipelineLayout.h"
|
|
12
|
-
#include "RNFHybridObject.h"
|
|
13
12
|
|
|
14
13
|
namespace jsi = facebook::jsi;
|
|
15
|
-
namespace m = margelo;
|
|
16
14
|
|
|
17
15
|
namespace rnwgpu {
|
|
18
16
|
|
|
@@ -25,9 +23,7 @@ struct GPUShaderModuleCompilationHint {
|
|
|
25
23
|
|
|
26
24
|
} // namespace rnwgpu
|
|
27
25
|
|
|
28
|
-
namespace
|
|
29
|
-
|
|
30
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
26
|
+
namespace rnwgpu {
|
|
31
27
|
|
|
32
28
|
template <>
|
|
33
29
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUShaderModuleCompilationHint>> {
|
|
@@ -62,4 +58,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPUShaderModuleCompilationHint>> {
|
|
|
62
58
|
}
|
|
63
59
|
};
|
|
64
60
|
|
|
65
|
-
} // namespace
|
|
61
|
+
} // namespace rnwgpu
|
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
#include "webgpu/webgpu_cpp.h"
|
|
8
8
|
|
|
9
|
-
#include "
|
|
9
|
+
#include "JSIConverter.h"
|
|
10
10
|
#include "WGPULogger.h"
|
|
11
11
|
|
|
12
12
|
#include "GPUShaderModuleCompilationHint.h"
|
|
13
|
-
#include "RNFHybridObject.h"
|
|
14
13
|
|
|
15
14
|
namespace jsi = facebook::jsi;
|
|
16
|
-
namespace m = margelo;
|
|
17
15
|
|
|
18
16
|
namespace rnwgpu {
|
|
19
17
|
|
|
@@ -26,9 +24,7 @@ struct GPUShaderModuleDescriptor {
|
|
|
26
24
|
|
|
27
25
|
} // namespace rnwgpu
|
|
28
26
|
|
|
29
|
-
namespace
|
|
30
|
-
|
|
31
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
27
|
+
namespace rnwgpu {
|
|
32
28
|
|
|
33
29
|
template <>
|
|
34
30
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUShaderModuleDescriptor>> {
|
|
@@ -64,4 +60,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPUShaderModuleDescriptor>> {
|
|
|
64
60
|
}
|
|
65
61
|
};
|
|
66
62
|
|
|
67
|
-
} // namespace
|
|
63
|
+
} // namespace rnwgpu
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
#pragma once
|
|
2
|
-
#include <string>
|
|
3
2
|
|
|
4
|
-
#include <
|
|
3
|
+
#include <jsi/jsi.h>
|
|
5
4
|
|
|
6
5
|
#include "webgpu/webgpu_cpp.h"
|
|
7
6
|
|
|
8
7
|
namespace rnwgpu {
|
|
9
8
|
|
|
10
|
-
namespace
|
|
9
|
+
namespace jsi = facebook::jsi;
|
|
11
10
|
|
|
12
|
-
class GPUShaderStage
|
|
11
|
+
class GPUShaderStage {
|
|
13
12
|
public:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
registerHybridGetter("FRAGMENT", &GPUShaderStage::Fragment, this);
|
|
24
|
-
registerHybridGetter("COMPUTE", &GPUShaderStage::Compute, this);
|
|
13
|
+
static jsi::Object create(jsi::Runtime &runtime) {
|
|
14
|
+
jsi::Object obj(runtime);
|
|
15
|
+
obj.setProperty(runtime, "VERTEX",
|
|
16
|
+
static_cast<double>(wgpu::ShaderStage::Vertex));
|
|
17
|
+
obj.setProperty(runtime, "FRAGMENT",
|
|
18
|
+
static_cast<double>(wgpu::ShaderStage::Fragment));
|
|
19
|
+
obj.setProperty(runtime, "COMPUTE",
|
|
20
|
+
static_cast<double>(wgpu::ShaderStage::Compute));
|
|
21
|
+
return obj;
|
|
25
22
|
}
|
|
26
23
|
};
|
|
27
|
-
|
|
24
|
+
|
|
25
|
+
} // namespace rnwgpu
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
|
-
#include "RNFHybridObject.h"
|
|
11
|
-
|
|
12
10
|
namespace jsi = facebook::jsi;
|
|
13
|
-
namespace m = margelo;
|
|
14
11
|
|
|
15
12
|
namespace rnwgpu {
|
|
16
13
|
|
|
@@ -23,9 +20,7 @@ struct GPUStencilFaceState {
|
|
|
23
20
|
|
|
24
21
|
} // namespace rnwgpu
|
|
25
22
|
|
|
26
|
-
namespace
|
|
27
|
-
|
|
28
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
23
|
+
namespace rnwgpu {
|
|
29
24
|
|
|
30
25
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUStencilFaceState>> {
|
|
31
26
|
static std::shared_ptr<rnwgpu::GPUStencilFaceState>
|
|
@@ -67,4 +62,4 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUStencilFaceState>> {
|
|
|
67
62
|
}
|
|
68
63
|
};
|
|
69
64
|
|
|
70
|
-
} // namespace
|
|
65
|
+
} // namespace rnwgpu
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
|
-
#include "RNFHybridObject.h"
|
|
11
|
-
|
|
12
10
|
namespace jsi = facebook::jsi;
|
|
13
|
-
namespace m = margelo;
|
|
14
11
|
|
|
15
12
|
namespace rnwgpu {
|
|
16
13
|
|
|
@@ -23,9 +20,7 @@ struct GPUStorageTextureBindingLayout {
|
|
|
23
20
|
|
|
24
21
|
} // namespace rnwgpu
|
|
25
22
|
|
|
26
|
-
namespace
|
|
27
|
-
|
|
28
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
23
|
+
namespace rnwgpu {
|
|
29
24
|
|
|
30
25
|
template <>
|
|
31
26
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUStorageTextureBindingLayout>> {
|
|
@@ -62,4 +57,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPUStorageTextureBindingLayout>> {
|
|
|
62
57
|
}
|
|
63
58
|
};
|
|
64
59
|
|
|
65
|
-
} // namespace
|
|
60
|
+
} // namespace rnwgpu
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
#include "webgpu/webgpu_cpp.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JSIConverter.h"
|
|
8
8
|
#include "WGPULogger.h"
|
|
9
9
|
|
|
10
|
-
#include "RNFHybridObject.h"
|
|
11
|
-
|
|
12
10
|
namespace jsi = facebook::jsi;
|
|
13
|
-
namespace m = margelo;
|
|
14
11
|
|
|
15
12
|
namespace rnwgpu {
|
|
16
13
|
|
|
@@ -23,9 +20,7 @@ struct GPUTextureBindingLayout {
|
|
|
23
20
|
|
|
24
21
|
} // namespace rnwgpu
|
|
25
22
|
|
|
26
|
-
namespace
|
|
27
|
-
|
|
28
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
23
|
+
namespace rnwgpu {
|
|
29
24
|
|
|
30
25
|
template <>
|
|
31
26
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUTextureBindingLayout>> {
|
|
@@ -62,4 +57,4 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPUTextureBindingLayout>> {
|
|
|
62
57
|
}
|
|
63
58
|
};
|
|
64
59
|
|
|
65
|
-
} // namespace
|
|
60
|
+
} // namespace rnwgpu
|
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
#include "webgpu/webgpu_cpp.h"
|
|
8
8
|
|
|
9
|
-
#include "
|
|
9
|
+
#include "JSIConverter.h"
|
|
10
10
|
#include "WGPULogger.h"
|
|
11
11
|
|
|
12
12
|
#include "GPUExtent3D.h"
|
|
13
|
-
#include "RNFHybridObject.h"
|
|
14
13
|
|
|
15
14
|
namespace jsi = facebook::jsi;
|
|
16
|
-
namespace m = margelo;
|
|
17
15
|
|
|
18
16
|
namespace rnwgpu {
|
|
19
17
|
|
|
@@ -31,9 +29,7 @@ struct GPUTextureDescriptor {
|
|
|
31
29
|
|
|
32
30
|
} // namespace rnwgpu
|
|
33
31
|
|
|
34
|
-
namespace
|
|
35
|
-
|
|
36
|
-
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
32
|
+
namespace rnwgpu {
|
|
37
33
|
|
|
38
34
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUTextureDescriptor>> {
|
|
39
35
|
static std::shared_ptr<rnwgpu::GPUTextureDescriptor>
|
|
@@ -93,4 +89,4 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUTextureDescriptor>> {
|
|
|
93
89
|
}
|
|
94
90
|
};
|
|
95
91
|
|
|
96
|
-
} // namespace
|
|
92
|
+
} // namespace rnwgpu
|