react-native-wgpu 0.1.0 → 0.1.3
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 +221 -13
- package/android/CMakeLists.txt +15 -1
- package/android/build.gradle +0 -18
- package/android/cpp/AndroidPlatformContext.h +132 -0
- package/android/cpp/cpp-adapter.cpp +70 -4
- package/android/src/main/java/com/webgpu/WebGPUModule.java +69 -21
- package/android/src/main/java/com/webgpu/WebGPUView.java +63 -8
- package/android/src/main/java/com/webgpu/WebGPUViewManager.java +5 -6
- package/android/src/newarch/{WgpuViewManagerSpec.java → com/webgpu/WebGPUViewManagerSpec.java} +5 -5
- package/android/src/oldarch/com/webgpu/NativeWebGPUModuleSpec.java +23 -0
- package/android/src/oldarch/{WebGPUViewManagerSpec.java → com/webgpu/WebGPUViewManagerSpec.java} +1 -1
- package/cpp/{Logger.h → WGPULogger.h} +13 -6
- package/cpp/dawn/webgpu.h +9 -0
- package/cpp/dawn/webgpu_cpp.h +95 -43
- package/cpp/dawn/webgpu_cpp_print.h +6 -0
- package/cpp/dawn/wire/client/webgpu_cpp.h +80 -43
- package/cpp/jsi/RNFHybridObject.cpp +1 -1
- package/cpp/jsi/RNFHybridObject.h +4 -4
- package/cpp/jsi/RNFJSIConverter.h +204 -17
- package/cpp/rnwgpu/ArrayBuffer.h +72 -0
- package/cpp/rnwgpu/PlatformContext.h +29 -0
- package/cpp/rnwgpu/RNWebGPUManager.cpp +13 -11
- package/cpp/rnwgpu/RNWebGPUManager.h +9 -1
- package/cpp/rnwgpu/SurfaceRegistry.h +36 -0
- package/cpp/rnwgpu/api/AsyncRunner.h +30 -0
- package/cpp/rnwgpu/api/Canvas.h +55 -0
- package/cpp/rnwgpu/api/Convertors.h +765 -0
- package/cpp/rnwgpu/api/External.h +12 -0
- package/cpp/rnwgpu/api/GPU.cpp +81 -23
- package/cpp/rnwgpu/api/GPU.h +24 -6
- package/cpp/rnwgpu/api/GPUAdapter.cpp +138 -24
- package/cpp/rnwgpu/api/GPUAdapter.h +24 -5
- package/cpp/rnwgpu/api/GPUAdapterInfo.h +19 -7
- package/cpp/rnwgpu/api/GPUBindGroup.cpp +3 -0
- package/cpp/rnwgpu/api/GPUBindGroup.h +11 -4
- package/cpp/rnwgpu/api/GPUBindGroupLayout.h +11 -4
- package/cpp/rnwgpu/api/GPUBuffer.cpp +82 -7
- package/cpp/rnwgpu/api/GPUBuffer.h +44 -8
- package/cpp/rnwgpu/api/GPUCanvasContext.cpp +63 -0
- package/cpp/rnwgpu/api/GPUCanvasContext.h +51 -8
- package/cpp/rnwgpu/api/GPUCommandBuffer.h +11 -4
- package/cpp/rnwgpu/api/GPUCommandEncoder.cpp +177 -0
- package/cpp/rnwgpu/api/GPUCommandEncoder.h +75 -3
- package/cpp/rnwgpu/api/GPUCompilationInfo.h +65 -8
- package/cpp/rnwgpu/api/GPUCompilationMessage.h +6 -4
- package/cpp/rnwgpu/api/GPUComputePassEncoder.cpp +58 -0
- package/cpp/rnwgpu/api/GPUComputePassEncoder.h +49 -3
- package/cpp/rnwgpu/api/GPUComputePipeline.cpp +11 -0
- package/cpp/rnwgpu/api/GPUComputePipeline.h +18 -3
- package/cpp/rnwgpu/api/GPUDevice.cpp +330 -3
- package/cpp/rnwgpu/api/GPUDevice.h +119 -5
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.cpp +6 -0
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +14 -7
- package/cpp/rnwgpu/api/GPUError.h +42 -0
- package/cpp/rnwgpu/api/GPUExtent3D.h +69 -0
- package/cpp/rnwgpu/api/GPUExternalTexture.h +11 -4
- package/cpp/rnwgpu/api/GPUFeatures.h +221 -0
- package/cpp/rnwgpu/api/GPUOrigin2D.h +59 -0
- package/cpp/rnwgpu/api/GPUOrigin3D.h +66 -0
- package/cpp/rnwgpu/api/GPUPipelineLayout.h +11 -4
- package/cpp/rnwgpu/api/GPUQuerySet.cpp +11 -0
- package/cpp/rnwgpu/api/GPUQuerySet.h +19 -5
- package/cpp/rnwgpu/api/GPUQueue.cpp +153 -0
- package/cpp/rnwgpu/api/GPUQueue.h +45 -4
- package/cpp/rnwgpu/api/GPURenderBundle.h +11 -4
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.cpp +128 -0
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +72 -3
- package/cpp/rnwgpu/api/GPURenderPassEncoder.cpp +161 -0
- package/cpp/rnwgpu/api/GPURenderPassEncoder.h +93 -3
- package/cpp/rnwgpu/api/GPURenderPipeline.cpp +13 -0
- package/cpp/rnwgpu/api/GPURenderPipeline.h +18 -3
- package/cpp/rnwgpu/api/GPUSampler.h +11 -4
- package/cpp/rnwgpu/api/GPUShaderModule.cpp +39 -0
- package/cpp/rnwgpu/api/GPUShaderModule.h +23 -4
- package/cpp/rnwgpu/api/GPUSupportedLimits.cpp +133 -0
- package/cpp/rnwgpu/api/GPUSupportedLimits.h +128 -4
- package/cpp/rnwgpu/api/GPUTexture.cpp +47 -0
- package/cpp/rnwgpu/api/GPUTexture.h +38 -4
- package/cpp/rnwgpu/api/GPUTextureView.h +11 -4
- package/cpp/rnwgpu/api/ImageBitmap.h +34 -0
- package/cpp/rnwgpu/api/RNWebGPU.h +100 -0
- package/cpp/rnwgpu/api/WebGPUCanvasContextFactory.h +59 -0
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupDescriptor.h +31 -43
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +40 -31
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutDescriptor.h +24 -32
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutEntry.h +56 -49
- package/cpp/rnwgpu/api/descriptors/GPUBlendComponent.h +27 -20
- package/cpp/rnwgpu/api/descriptors/GPUBlendState.h +23 -31
- package/cpp/rnwgpu/api/descriptors/GPUBufferBinding.h +25 -36
- package/cpp/rnwgpu/api/descriptors/GPUBufferBindingLayout.h +25 -25
- package/cpp/rnwgpu/api/descriptors/GPUBufferDescriptor.h +26 -46
- package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +31 -53
- package/cpp/rnwgpu/api/descriptors/GPUColor.h +72 -0
- package/cpp/rnwgpu/api/descriptors/GPUColorTargetState.h +27 -33
- package/cpp/rnwgpu/api/descriptors/GPUCommandBufferDescriptor.h +51 -0
- package/cpp/rnwgpu/api/descriptors/GPUCommandEncoderDescriptor.h +51 -0
- package/cpp/rnwgpu/api/descriptors/GPUComputePassDescriptor.h +24 -25
- package/cpp/rnwgpu/api/descriptors/GPUComputePassTimestampWrites.h +25 -42
- package/cpp/rnwgpu/api/descriptors/GPUComputePipelineDescriptor.h +32 -42
- package/cpp/rnwgpu/api/descriptors/GPUDepthStencilState.h +58 -76
- package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +38 -30
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureBindingLayout.h +11 -11
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +43 -34
- package/cpp/rnwgpu/api/descriptors/GPUFragmentState.h +39 -46
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyBuffer.h +29 -45
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +32 -31
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +32 -36
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +42 -44
- package/cpp/rnwgpu/api/descriptors/GPUImageDataLayout.h +24 -34
- package/cpp/rnwgpu/api/descriptors/GPUMultisampleState.h +24 -32
- package/cpp/rnwgpu/api/descriptors/GPUPipelineLayoutDescriptor.h +25 -35
- package/cpp/rnwgpu/api/descriptors/GPUPrimitiveState.h +35 -26
- package/cpp/rnwgpu/api/descriptors/GPUProgrammableStage.h +29 -35
- package/cpp/rnwgpu/api/descriptors/GPUQuerySetDescriptor.h +23 -43
- package/cpp/rnwgpu/api/descriptors/GPUQueueDescriptor.h +49 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleDescriptor.h +51 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleEncoderDescriptor.h +41 -57
- package/cpp/rnwgpu/api/descriptors/GPURenderPassColorAttachment.h +42 -61
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDepthStencilAttachment.h +54 -66
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDescriptor.h +52 -55
- package/cpp/rnwgpu/api/descriptors/GPURenderPassTimestampWrites.h +25 -42
- package/cpp/rnwgpu/api/descriptors/GPURenderPipelineDescriptor.h +60 -56
- package/cpp/rnwgpu/api/descriptors/GPURequestAdapterOptions.h +21 -20
- package/cpp/rnwgpu/api/descriptors/GPUSamplerBindingLayout.h +17 -14
- package/cpp/rnwgpu/api/descriptors/GPUSamplerDescriptor.h +63 -63
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleCompilationHint.h +28 -27
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleDescriptor.h +28 -49
- package/cpp/rnwgpu/api/descriptors/GPUStencilFaceState.h +32 -23
- package/cpp/rnwgpu/api/descriptors/GPUStorageTextureBindingLayout.h +27 -29
- package/cpp/rnwgpu/api/descriptors/GPUTextureBindingLayout.h +27 -20
- package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +49 -76
- package/cpp/rnwgpu/api/descriptors/GPUTextureViewDescriptor.h +48 -64
- package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +29 -31
- package/cpp/rnwgpu/api/descriptors/GPUVertexAttribute.h +23 -44
- package/cpp/rnwgpu/api/descriptors/GPUVertexBufferLayout.h +30 -36
- package/cpp/rnwgpu/api/descriptors/GPUVertexState.h +39 -38
- package/cpp/rnwgpu/api/descriptors/Unions.h +57 -2
- package/ios/IOSPlatformContext.h +19 -0
- package/ios/IOSPlatformContext.mm +68 -0
- package/ios/MetalView.h +10 -0
- package/ios/MetalView.mm +27 -0
- package/ios/SurfaceUtils.h +13 -0
- package/ios/SurfaceUtils.mm +24 -0
- package/ios/WebGPUModule.h +8 -7
- package/ios/WebGPUModule.mm +47 -14
- package/ios/WebGPUView.h +6 -3
- package/ios/WebGPUView.mm +36 -24
- package/ios/WebGPUViewComponentDescriptor.h +61 -0
- package/ios/WebGPUViewManager.mm +6 -4
- package/lib/commonjs/Canvas.js +47 -0
- package/lib/commonjs/Canvas.js.map +1 -0
- package/lib/commonjs/{WebGPUNativeModule.js → NativeWebGPUModule.js} +1 -1
- package/lib/commonjs/{WebGPUNativeModule.js.map → NativeWebGPUModule.js.map} +1 -1
- package/lib/commonjs/WebGPUView.js +2 -0
- package/lib/commonjs/WebGPUView.js.map +1 -0
- package/lib/commonjs/WebGPUViewNativeComponent.js.map +1 -1
- package/lib/commonjs/index.js +183 -19
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils.js +39 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/module/Canvas.js +40 -0
- package/lib/module/Canvas.js.map +1 -0
- package/lib/module/{WebGPUNativeModule.js → NativeWebGPUModule.js} +1 -1
- package/lib/module/NativeWebGPUModule.js.map +1 -0
- package/lib/module/WebGPUView.js +2 -0
- package/lib/module/WebGPUView.js.map +1 -0
- package/lib/module/WebGPUViewNativeComponent.js.map +1 -1
- package/lib/module/index.js +158 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js +31 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/example/src/Triangle/triangle.d.ts +3 -0
- package/lib/typescript/example/src/Triangle/triangle.d.ts.map +1 -0
- package/lib/typescript/example/src/Wireframe/Shaders.d.ts +3 -0
- package/lib/typescript/example/src/Wireframe/Shaders.d.ts.map +1 -0
- package/lib/typescript/example/src/Wireframe/models.d.ts +29 -0
- package/lib/typescript/example/src/Wireframe/models.d.ts.map +1 -0
- package/lib/typescript/example/src/components/DrawingContext.d.ts +13 -0
- package/lib/typescript/example/src/components/DrawingContext.d.ts.map +1 -0
- package/lib/typescript/example/src/components/cube.d.ts +7 -0
- package/lib/typescript/example/src/components/cube.d.ts.map +1 -0
- package/lib/typescript/example/src/components/meshes/sphere.d.ts +12 -0
- package/lib/typescript/example/src/components/meshes/sphere.d.ts.map +1 -0
- package/lib/typescript/example/src/components/meshes/teapot.d.ts +6 -0
- package/lib/typescript/example/src/components/meshes/teapot.d.ts.map +1 -0
- package/lib/typescript/example/src/components/meshes/utils.d.ts +10 -0
- package/lib/typescript/example/src/components/meshes/utils.d.ts.map +1 -0
- package/lib/typescript/jest.config.d.ts +4 -0
- package/lib/typescript/lib/commonjs/Canvas.d.ts +4 -0
- package/lib/typescript/lib/commonjs/Canvas.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/{WebGPUNativeModule.d.ts → NativeWebGPUModule.d.ts} +1 -1
- package/lib/typescript/lib/commonjs/NativeWebGPUModule.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/WebGPUView.d.ts +1 -0
- package/lib/typescript/lib/commonjs/WebGPUView.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +0 -2
- package/lib/typescript/lib/commonjs/utils.d.ts +5 -0
- package/lib/typescript/lib/commonjs/utils.d.ts.map +1 -0
- package/lib/typescript/lib/module/Canvas.d.ts +2 -0
- package/lib/typescript/lib/module/Canvas.d.ts.map +1 -0
- package/lib/typescript/lib/module/{WebGPUNativeModule.d.ts → NativeWebGPUModule.d.ts} +1 -1
- package/lib/typescript/lib/module/NativeWebGPUModule.d.ts.map +1 -0
- package/lib/typescript/lib/module/WebGPUView.d.ts +1 -0
- package/lib/typescript/lib/module/WebGPUView.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +3 -3
- package/lib/typescript/lib/module/utils.d.ts +3 -0
- package/lib/typescript/lib/module/utils.d.ts.map +1 -0
- package/lib/typescript/src/Canvas.d.ts +29 -0
- package/lib/typescript/src/Canvas.d.ts.map +1 -0
- package/lib/typescript/src/{WebGPUNativeModule.d.ts → NativeWebGPUModule.d.ts} +2 -1
- package/lib/typescript/src/NativeWebGPUModule.d.ts.map +1 -0
- package/lib/typescript/src/WebGPUView.d.ts +1 -0
- package/lib/typescript/src/WebGPUView.d.ts.map +1 -0
- package/lib/typescript/src/WebGPUViewNativeComponent.d.ts +2 -1
- package/lib/typescript/src/WebGPUViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -7
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +7 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/libs/android/arm64-v8a/libwebgpu_dawn.so +0 -0
- package/libs/android/armeabi-v7a/libwebgpu_dawn.so +0 -0
- package/libs/android/x86/libwebgpu_dawn.so +0 -0
- package/libs/android/x86_64/libwebgpu_dawn.so +0 -0
- package/libs/dawn.json +4597 -0
- package/libs/ios/arm64_iphoneos/libwebgpu_dawn.a +0 -0
- package/libs/ios/arm64_iphonesimulator/libwebgpu_dawn.a +0 -0
- package/libs/ios/libwebgpu_dawn.a +0 -0
- package/libs/ios/libwebgpu_dawn.xcframework/Info.plist +44 -0
- package/libs/ios/libwebgpu_dawn.xcframework/ios-arm64/libwebgpu_dawn.a +0 -0
- package/libs/ios/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a +0 -0
- package/libs/ios/x86_64_iphonesimulator/libwebgpu_dawn.a +0 -0
- package/package.json +25 -8
- package/{react-native-webgpu.podspec → react-native-wgpu.podspec} +6 -9
- package/src/Canvas.tsx +73 -0
- package/src/{WebGPUNativeModule.ts → NativeWebGPUModule.ts} +1 -0
- package/src/WebGPUView.tsx +0 -0
- package/src/WebGPUViewNativeComponent.ts +2 -1
- package/src/index.tsx +191 -8
- package/src/utils.ts +40 -0
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/cpp/rnwgpu/MutableBuffer.h +0 -48
- package/cpp/rnwgpu/api/GPUUncapturedErrorEvent.h +0 -33
- package/cpp/rnwgpu/api/descriptors/GPUColorDict.h +0 -81
- package/cpp/rnwgpu/api/descriptors/GPUExtent3DDict.h +0 -76
- package/cpp/rnwgpu/api/descriptors/GPUExtent3DDictStrict.h +0 -91
- package/cpp/rnwgpu/api/descriptors/GPUOrigin2DDict.h +0 -61
- package/cpp/rnwgpu/api/descriptors/GPUOrigin2DDictStrict.h +0 -75
- package/cpp/rnwgpu/api/descriptors/GPUOrigin3DDict.h +0 -71
- package/cpp/rnwgpu/api/descriptors/GPUPipelineErrorInit.h +0 -54
- package/cpp/rnwgpu/api/descriptors/GPURenderPassLayout.h +0 -83
- package/ios/RNFAppleLogger.mm +0 -22
- package/ios/Utils.h +0 -5
- package/ios/Utils.m +0 -26
- package/lib/module/WebGPUNativeModule.js.map +0 -1
- package/lib/typescript/lib/commonjs/WebGPUNativeModule.d.ts.map +0 -1
- package/lib/typescript/lib/module/WebGPUNativeModule.d.ts.map +0 -1
- package/lib/typescript/scripts/build/copy-artifacts.d.ts +0 -2
- package/lib/typescript/scripts/build/copy-artifacts.d.ts.map +0 -1
- package/lib/typescript/scripts/build/dawn.d.ts +0 -2
- package/lib/typescript/scripts/build/dawn.d.ts.map +0 -1
- package/lib/typescript/scripts/build/util.d.ts +0 -13
- package/lib/typescript/scripts/build/util.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/codegen.d.ts +0 -2
- package/lib/typescript/scripts/codegen/codegen.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/model/dawn.d.ts +0 -2
- package/lib/typescript/scripts/codegen/model/dawn.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/model/model.d.ts +0 -8
- package/lib/typescript/scripts/codegen/model/model.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/templates/Descriptor.d.ts +0 -4
- package/lib/typescript/scripts/codegen/templates/Descriptor.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/templates/Enum.d.ts +0 -3
- package/lib/typescript/scripts/codegen/templates/Enum.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/templates/HybridObject.d.ts +0 -3
- package/lib/typescript/scripts/codegen/templates/HybridObject.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/templates/Unions.d.ts +0 -6
- package/lib/typescript/scripts/codegen/templates/Unions.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/templates/common.d.ts +0 -9
- package/lib/typescript/scripts/codegen/templates/common.d.ts.map +0 -1
- package/lib/typescript/scripts/codegen/util.d.ts +0 -2
- package/lib/typescript/scripts/codegen/util.d.ts.map +0 -1
- package/lib/typescript/src/WebGPUNativeModule.d.ts.map +0 -1
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPUColorDict {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::ColorDict *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::ColorDict _instance;
|
|
21
|
-
};
|
|
22
|
-
} // namespace rnwgpu
|
|
23
|
-
|
|
24
|
-
namespace margelo {
|
|
25
|
-
|
|
26
|
-
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUColorDict>> {
|
|
27
|
-
static std::shared_ptr<rnwgpu::GPUColorDict>
|
|
28
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
29
|
-
auto result = std::make_unique<rnwgpu::GPUColorDict>();
|
|
30
|
-
if (!outOfBounds && arg.isObject()) {
|
|
31
|
-
auto value = arg.getObject(runtime);
|
|
32
|
-
if (value.hasProperty(runtime, "r")) {
|
|
33
|
-
auto r = value.getProperty(runtime, "r");
|
|
34
|
-
|
|
35
|
-
if (r.isUndefined()) {
|
|
36
|
-
throw std::runtime_error("Property GPUColorDict::r is required");
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
throw std::runtime_error("Property GPUColorDict::r is not defined");
|
|
40
|
-
}
|
|
41
|
-
if (value.hasProperty(runtime, "g")) {
|
|
42
|
-
auto g = value.getProperty(runtime, "g");
|
|
43
|
-
|
|
44
|
-
if (g.isUndefined()) {
|
|
45
|
-
throw std::runtime_error("Property GPUColorDict::g is required");
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
throw std::runtime_error("Property GPUColorDict::g is not defined");
|
|
49
|
-
}
|
|
50
|
-
if (value.hasProperty(runtime, "b")) {
|
|
51
|
-
auto b = value.getProperty(runtime, "b");
|
|
52
|
-
|
|
53
|
-
if (b.isUndefined()) {
|
|
54
|
-
throw std::runtime_error("Property GPUColorDict::b is required");
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
throw std::runtime_error("Property GPUColorDict::b is not defined");
|
|
58
|
-
}
|
|
59
|
-
if (value.hasProperty(runtime, "a")) {
|
|
60
|
-
auto a = value.getProperty(runtime, "a");
|
|
61
|
-
|
|
62
|
-
if (a.isUndefined()) {
|
|
63
|
-
throw std::runtime_error("Property GPUColorDict::a is required");
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
throw std::runtime_error("Property GPUColorDict::a is not defined");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
rnwgpu::Logger::logToConsole("GPUColorDict::r = %f", result->_instance.r);
|
|
70
|
-
rnwgpu::Logger::logToConsole("GPUColorDict::g = %f", result->_instance.g);
|
|
71
|
-
rnwgpu::Logger::logToConsole("GPUColorDict::b = %f", result->_instance.b);
|
|
72
|
-
rnwgpu::Logger::logToConsole("GPUColorDict::a = %f", result->_instance.a);
|
|
73
|
-
return result;
|
|
74
|
-
}
|
|
75
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
76
|
-
std::shared_ptr<rnwgpu::GPUColorDict> arg) {
|
|
77
|
-
// No conversions here
|
|
78
|
-
return jsi::Value::null();
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
} // namespace margelo
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPUExtent3DDict {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::Extent3DDict *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::Extent3DDict _instance;
|
|
21
|
-
};
|
|
22
|
-
} // namespace rnwgpu
|
|
23
|
-
|
|
24
|
-
namespace margelo {
|
|
25
|
-
|
|
26
|
-
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUExtent3DDict>> {
|
|
27
|
-
static std::shared_ptr<rnwgpu::GPUExtent3DDict>
|
|
28
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
29
|
-
auto result = std::make_unique<rnwgpu::GPUExtent3DDict>();
|
|
30
|
-
if (!outOfBounds && arg.isObject()) {
|
|
31
|
-
auto value = arg.getObject(runtime);
|
|
32
|
-
if (value.hasProperty(runtime, "width")) {
|
|
33
|
-
auto width = value.getProperty(runtime, "width");
|
|
34
|
-
|
|
35
|
-
if (width.isUndefined()) {
|
|
36
|
-
throw std::runtime_error(
|
|
37
|
-
"Property GPUExtent3DDict::width is required");
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
throw std::runtime_error(
|
|
41
|
-
"Property GPUExtent3DDict::width is not defined");
|
|
42
|
-
}
|
|
43
|
-
if (value.hasProperty(runtime, "height")) {
|
|
44
|
-
auto height = value.getProperty(runtime, "height");
|
|
45
|
-
|
|
46
|
-
if (height.isNumber()) {
|
|
47
|
-
result->_instance.height =
|
|
48
|
-
static_cast<wgpu::IntegerCoordinate>(height.getNumber());
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (value.hasProperty(runtime, "depthOrArrayLayers")) {
|
|
52
|
-
auto depthOrArrayLayers =
|
|
53
|
-
value.getProperty(runtime, "depthOrArrayLayers");
|
|
54
|
-
|
|
55
|
-
if (depthOrArrayLayers.isNumber()) {
|
|
56
|
-
result->_instance.depthOrArrayLayers =
|
|
57
|
-
static_cast<wgpu::IntegerCoordinate>(
|
|
58
|
-
depthOrArrayLayers.getNumber());
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
rnwgpu::Logger::logToConsole("GPUExtent3DDict::width = %f",
|
|
63
|
-
result->_instance.width);
|
|
64
|
-
rnwgpu::Logger::logToConsole("GPUExtent3DDict::height = %f",
|
|
65
|
-
result->_instance.height);
|
|
66
|
-
rnwgpu::Logger::logToConsole("GPUExtent3DDict::depthOrArrayLayers = %f",
|
|
67
|
-
result->_instance.depthOrArrayLayers);
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
71
|
-
std::shared_ptr<rnwgpu::GPUExtent3DDict> arg) {
|
|
72
|
-
// No conversions here
|
|
73
|
-
return jsi::Value::null();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
} // namespace margelo
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPUExtent3DDictStrict {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::Extent3DDictStrict *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::Extent3DDictStrict _instance;
|
|
21
|
-
};
|
|
22
|
-
} // namespace rnwgpu
|
|
23
|
-
|
|
24
|
-
namespace margelo {
|
|
25
|
-
|
|
26
|
-
template <>
|
|
27
|
-
struct JSIConverter<std::shared_ptr<rnwgpu::GPUExtent3DDictStrict>> {
|
|
28
|
-
static std::shared_ptr<rnwgpu::GPUExtent3DDictStrict>
|
|
29
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
30
|
-
auto result = std::make_unique<rnwgpu::GPUExtent3DDictStrict>();
|
|
31
|
-
if (!outOfBounds && arg.isObject()) {
|
|
32
|
-
auto value = arg.getObject(runtime);
|
|
33
|
-
if (value.hasProperty(runtime, "depth")) {
|
|
34
|
-
auto depth = value.getProperty(runtime, "depth");
|
|
35
|
-
|
|
36
|
-
if (depth.isUndefined()) {
|
|
37
|
-
throw std::runtime_error(
|
|
38
|
-
"Property GPUExtent3DDictStrict::depth is required");
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
throw std::runtime_error(
|
|
42
|
-
"Property GPUExtent3DDictStrict::depth is not defined");
|
|
43
|
-
}
|
|
44
|
-
if (value.hasProperty(runtime, "width")) {
|
|
45
|
-
auto width = value.getProperty(runtime, "width");
|
|
46
|
-
|
|
47
|
-
if (width.isUndefined()) {
|
|
48
|
-
throw std::runtime_error(
|
|
49
|
-
"Property GPUExtent3DDictStrict::width is required");
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
throw std::runtime_error(
|
|
53
|
-
"Property GPUExtent3DDictStrict::width is not defined");
|
|
54
|
-
}
|
|
55
|
-
if (value.hasProperty(runtime, "height")) {
|
|
56
|
-
auto height = value.getProperty(runtime, "height");
|
|
57
|
-
|
|
58
|
-
if (height.isNumber()) {
|
|
59
|
-
result->_instance.height =
|
|
60
|
-
static_cast<wgpu::IntegerCoordinate>(height.getNumber());
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (value.hasProperty(runtime, "depthOrArrayLayers")) {
|
|
64
|
-
auto depthOrArrayLayers =
|
|
65
|
-
value.getProperty(runtime, "depthOrArrayLayers");
|
|
66
|
-
|
|
67
|
-
if (depthOrArrayLayers.isNumber()) {
|
|
68
|
-
result->_instance.depthOrArrayLayers =
|
|
69
|
-
static_cast<wgpu::IntegerCoordinate>(
|
|
70
|
-
depthOrArrayLayers.getNumber());
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
rnwgpu::Logger::logToConsole("GPUExtent3DDictStrict::depth = %f",
|
|
75
|
-
result->_instance.depth);
|
|
76
|
-
rnwgpu::Logger::logToConsole("GPUExtent3DDictStrict::width = %f",
|
|
77
|
-
result->_instance.width);
|
|
78
|
-
rnwgpu::Logger::logToConsole("GPUExtent3DDictStrict::height = %f",
|
|
79
|
-
result->_instance.height);
|
|
80
|
-
rnwgpu::Logger::logToConsole(
|
|
81
|
-
"GPUExtent3DDictStrict::depthOrArrayLayers = %f",
|
|
82
|
-
result->_instance.depthOrArrayLayers);
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
86
|
-
std::shared_ptr<rnwgpu::GPUExtent3DDictStrict> arg) {
|
|
87
|
-
// No conversions here
|
|
88
|
-
return jsi::Value::null();
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
} // namespace margelo
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPUOrigin2DDict {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::Origin2DDict *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::Origin2DDict _instance;
|
|
21
|
-
};
|
|
22
|
-
} // namespace rnwgpu
|
|
23
|
-
|
|
24
|
-
namespace margelo {
|
|
25
|
-
|
|
26
|
-
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUOrigin2DDict>> {
|
|
27
|
-
static std::shared_ptr<rnwgpu::GPUOrigin2DDict>
|
|
28
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
29
|
-
auto result = std::make_unique<rnwgpu::GPUOrigin2DDict>();
|
|
30
|
-
if (!outOfBounds && arg.isObject()) {
|
|
31
|
-
auto value = arg.getObject(runtime);
|
|
32
|
-
if (value.hasProperty(runtime, "x")) {
|
|
33
|
-
auto x = value.getProperty(runtime, "x");
|
|
34
|
-
|
|
35
|
-
if (x.isNumber()) {
|
|
36
|
-
result->_instance.x =
|
|
37
|
-
static_cast<wgpu::IntegerCoordinate>(x.getNumber());
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (value.hasProperty(runtime, "y")) {
|
|
41
|
-
auto y = value.getProperty(runtime, "y");
|
|
42
|
-
|
|
43
|
-
if (y.isNumber()) {
|
|
44
|
-
result->_instance.y =
|
|
45
|
-
static_cast<wgpu::IntegerCoordinate>(y.getNumber());
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
rnwgpu::Logger::logToConsole("GPUOrigin2DDict::x = %f",
|
|
50
|
-
result->_instance.x);
|
|
51
|
-
rnwgpu::Logger::logToConsole("GPUOrigin2DDict::y = %f",
|
|
52
|
-
result->_instance.y);
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
56
|
-
std::shared_ptr<rnwgpu::GPUOrigin2DDict> arg) {
|
|
57
|
-
// No conversions here
|
|
58
|
-
return jsi::Value::null();
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
} // namespace margelo
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPUOrigin2DDictStrict {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::Origin2DDictStrict *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::Origin2DDictStrict _instance;
|
|
21
|
-
};
|
|
22
|
-
} // namespace rnwgpu
|
|
23
|
-
|
|
24
|
-
namespace margelo {
|
|
25
|
-
|
|
26
|
-
template <>
|
|
27
|
-
struct JSIConverter<std::shared_ptr<rnwgpu::GPUOrigin2DDictStrict>> {
|
|
28
|
-
static std::shared_ptr<rnwgpu::GPUOrigin2DDictStrict>
|
|
29
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
30
|
-
auto result = std::make_unique<rnwgpu::GPUOrigin2DDictStrict>();
|
|
31
|
-
if (!outOfBounds && arg.isObject()) {
|
|
32
|
-
auto value = arg.getObject(runtime);
|
|
33
|
-
if (value.hasProperty(runtime, "z")) {
|
|
34
|
-
auto z = value.getProperty(runtime, "z");
|
|
35
|
-
|
|
36
|
-
if (z.isUndefined()) {
|
|
37
|
-
throw std::runtime_error(
|
|
38
|
-
"Property GPUOrigin2DDictStrict::z is required");
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
throw std::runtime_error(
|
|
42
|
-
"Property GPUOrigin2DDictStrict::z is not defined");
|
|
43
|
-
}
|
|
44
|
-
if (value.hasProperty(runtime, "x")) {
|
|
45
|
-
auto x = value.getProperty(runtime, "x");
|
|
46
|
-
|
|
47
|
-
if (x.isNumber()) {
|
|
48
|
-
result->_instance.x =
|
|
49
|
-
static_cast<wgpu::IntegerCoordinate>(x.getNumber());
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (value.hasProperty(runtime, "y")) {
|
|
53
|
-
auto y = value.getProperty(runtime, "y");
|
|
54
|
-
|
|
55
|
-
if (y.isNumber()) {
|
|
56
|
-
result->_instance.y =
|
|
57
|
-
static_cast<wgpu::IntegerCoordinate>(y.getNumber());
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
rnwgpu::Logger::logToConsole("GPUOrigin2DDictStrict::z = %f",
|
|
62
|
-
result->_instance.z);
|
|
63
|
-
rnwgpu::Logger::logToConsole("GPUOrigin2DDictStrict::x = %f",
|
|
64
|
-
result->_instance.x);
|
|
65
|
-
rnwgpu::Logger::logToConsole("GPUOrigin2DDictStrict::y = %f",
|
|
66
|
-
result->_instance.y);
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
70
|
-
std::shared_ptr<rnwgpu::GPUOrigin2DDictStrict> arg) {
|
|
71
|
-
// No conversions here
|
|
72
|
-
return jsi::Value::null();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
} // namespace margelo
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPUOrigin3DDict {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::Origin3DDict *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::Origin3DDict _instance;
|
|
21
|
-
};
|
|
22
|
-
} // namespace rnwgpu
|
|
23
|
-
|
|
24
|
-
namespace margelo {
|
|
25
|
-
|
|
26
|
-
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUOrigin3DDict>> {
|
|
27
|
-
static std::shared_ptr<rnwgpu::GPUOrigin3DDict>
|
|
28
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
29
|
-
auto result = std::make_unique<rnwgpu::GPUOrigin3DDict>();
|
|
30
|
-
if (!outOfBounds && arg.isObject()) {
|
|
31
|
-
auto value = arg.getObject(runtime);
|
|
32
|
-
if (value.hasProperty(runtime, "x")) {
|
|
33
|
-
auto x = value.getProperty(runtime, "x");
|
|
34
|
-
|
|
35
|
-
if (x.isNumber()) {
|
|
36
|
-
result->_instance.x =
|
|
37
|
-
static_cast<wgpu::IntegerCoordinate>(x.getNumber());
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (value.hasProperty(runtime, "y")) {
|
|
41
|
-
auto y = value.getProperty(runtime, "y");
|
|
42
|
-
|
|
43
|
-
if (y.isNumber()) {
|
|
44
|
-
result->_instance.y =
|
|
45
|
-
static_cast<wgpu::IntegerCoordinate>(y.getNumber());
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (value.hasProperty(runtime, "z")) {
|
|
49
|
-
auto z = value.getProperty(runtime, "z");
|
|
50
|
-
|
|
51
|
-
if (z.isNumber()) {
|
|
52
|
-
result->_instance.z =
|
|
53
|
-
static_cast<wgpu::IntegerCoordinate>(z.getNumber());
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
rnwgpu::Logger::logToConsole("GPUOrigin3DDict::x = %f",
|
|
58
|
-
result->_instance.x);
|
|
59
|
-
rnwgpu::Logger::logToConsole("GPUOrigin3DDict::y = %f",
|
|
60
|
-
result->_instance.y);
|
|
61
|
-
rnwgpu::Logger::logToConsole("GPUOrigin3DDict::z = %f",
|
|
62
|
-
result->_instance.z);
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
66
|
-
std::shared_ptr<rnwgpu::GPUOrigin3DDict> arg) {
|
|
67
|
-
// No conversions here
|
|
68
|
-
return jsi::Value::null();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
} // namespace margelo
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPUPipelineErrorInit {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::PipelineErrorInit *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::PipelineErrorInit _instance;
|
|
21
|
-
};
|
|
22
|
-
} // namespace rnwgpu
|
|
23
|
-
|
|
24
|
-
namespace margelo {
|
|
25
|
-
|
|
26
|
-
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUPipelineErrorInit>> {
|
|
27
|
-
static std::shared_ptr<rnwgpu::GPUPipelineErrorInit>
|
|
28
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
29
|
-
auto result = std::make_unique<rnwgpu::GPUPipelineErrorInit>();
|
|
30
|
-
if (!outOfBounds && arg.isObject()) {
|
|
31
|
-
auto value = arg.getObject(runtime);
|
|
32
|
-
if (value.hasProperty(runtime, "reason")) {
|
|
33
|
-
auto reason = value.getProperty(runtime, "reason");
|
|
34
|
-
|
|
35
|
-
if (reason.isUndefined()) {
|
|
36
|
-
throw std::runtime_error(
|
|
37
|
-
"Property GPUPipelineErrorInit::reason is required");
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
throw std::runtime_error(
|
|
41
|
-
"Property GPUPipelineErrorInit::reason is not defined");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
rnwgpu::Logger::logToConsole("GPUPipelineErrorInit::reason = %f",
|
|
45
|
-
result->_instance.reason);
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
49
|
-
std::shared_ptr<rnwgpu::GPUPipelineErrorInit> arg) {
|
|
50
|
-
// No conversions here
|
|
51
|
-
return jsi::Value::null();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
} // namespace margelo
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include "webgpu/webgpu_cpp.h"
|
|
7
|
-
|
|
8
|
-
#include "Logger.h"
|
|
9
|
-
#include "RNFJSIConverter.h"
|
|
10
|
-
#include <RNFHybridObject.h>
|
|
11
|
-
|
|
12
|
-
namespace jsi = facebook::jsi;
|
|
13
|
-
|
|
14
|
-
namespace rnwgpu {
|
|
15
|
-
|
|
16
|
-
class GPURenderPassLayout {
|
|
17
|
-
public:
|
|
18
|
-
wgpu::RenderPassLayout *getInstance() { return &_instance; }
|
|
19
|
-
|
|
20
|
-
wgpu::RenderPassLayout _instance;
|
|
21
|
-
|
|
22
|
-
std::string label;
|
|
23
|
-
};
|
|
24
|
-
} // namespace rnwgpu
|
|
25
|
-
|
|
26
|
-
namespace margelo {
|
|
27
|
-
|
|
28
|
-
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPURenderPassLayout>> {
|
|
29
|
-
static std::shared_ptr<rnwgpu::GPURenderPassLayout>
|
|
30
|
-
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
31
|
-
auto result = std::make_unique<rnwgpu::GPURenderPassLayout>();
|
|
32
|
-
if (!outOfBounds && arg.isObject()) {
|
|
33
|
-
auto value = arg.getObject(runtime);
|
|
34
|
-
if (value.hasProperty(runtime, "colorFormats")) {
|
|
35
|
-
auto colorFormats = value.getProperty(runtime, "colorFormats");
|
|
36
|
-
|
|
37
|
-
if (colorFormats.isUndefined()) {
|
|
38
|
-
throw std::runtime_error(
|
|
39
|
-
"Property GPURenderPassLayout::colorFormats is required");
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
throw std::runtime_error(
|
|
43
|
-
"Property GPURenderPassLayout::colorFormats is not defined");
|
|
44
|
-
}
|
|
45
|
-
if (value.hasProperty(runtime, "depthStencilFormat")) {
|
|
46
|
-
auto depthStencilFormat =
|
|
47
|
-
value.getProperty(runtime, "depthStencilFormat");
|
|
48
|
-
}
|
|
49
|
-
if (value.hasProperty(runtime, "sampleCount")) {
|
|
50
|
-
auto sampleCount = value.getProperty(runtime, "sampleCount");
|
|
51
|
-
|
|
52
|
-
if (sampleCount.isNumber()) {
|
|
53
|
-
result->_instance.sampleCount =
|
|
54
|
-
static_cast<wgpu::Size32>(sampleCount.getNumber());
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (value.hasProperty(runtime, "label")) {
|
|
58
|
-
auto label = value.getProperty(runtime, "label");
|
|
59
|
-
|
|
60
|
-
if (label.isString()) {
|
|
61
|
-
auto str = label.asString(runtime).utf8(runtime);
|
|
62
|
-
result->label = str;
|
|
63
|
-
result->_instance.label = result->label.c_str();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
rnwgpu::Logger::logToConsole("GPURenderPassLayout::colorFormats = %f",
|
|
68
|
-
result->_instance.colorFormats);
|
|
69
|
-
rnwgpu::Logger::logToConsole("GPURenderPassLayout::depthStencilFormat = %f",
|
|
70
|
-
result->_instance.depthStencilFormat);
|
|
71
|
-
rnwgpu::Logger::logToConsole("GPURenderPassLayout::sampleCount = %f",
|
|
72
|
-
result->_instance.sampleCount);
|
|
73
|
-
rnwgpu::Logger::logToConsole("GPURenderPassLayout::label = %f",
|
|
74
|
-
result->_instance.label);
|
|
75
|
-
return result;
|
|
76
|
-
}
|
|
77
|
-
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
78
|
-
std::shared_ptr<rnwgpu::GPURenderPassLayout> arg) {
|
|
79
|
-
// No conversions here
|
|
80
|
-
return jsi::Value::null();
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
} // namespace margelo
|
package/ios/RNFAppleLogger.mm
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// AppleLogger.cpp
|
|
3
|
-
// react-native-filament
|
|
4
|
-
//
|
|
5
|
-
// Created by Marc Rousavy on 05.03.24.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#include "RNFLogger.h"
|
|
9
|
-
#include <Foundation/Foundation.h>
|
|
10
|
-
|
|
11
|
-
namespace margelo {
|
|
12
|
-
|
|
13
|
-
void Logger::log(const std::string &tag, const std::string &message) {
|
|
14
|
-
#if RNF_ENABLE_LOGS
|
|
15
|
-
#pragma clang diagnostic push
|
|
16
|
-
#pragma clang diagnostic ignored "-Wformat-security"
|
|
17
|
-
NSLog(@"[RNF/%s]: %s", tag.c_str(), message.c_str());
|
|
18
|
-
#pragma clang diagnostic pop
|
|
19
|
-
#endif
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
} // namespace margelo
|
package/ios/Utils.h
DELETED
package/ios/Utils.m
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import "Utils.h"
|
|
3
|
-
#import <UIKit/UIKit.h>
|
|
4
|
-
|
|
5
|
-
@implementation Utils
|
|
6
|
-
|
|
7
|
-
+ hexStringToColor:(NSString *)stringToConvert
|
|
8
|
-
{
|
|
9
|
-
NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""];
|
|
10
|
-
NSScanner *stringScanner = [NSScanner scannerWithString:noHashString];
|
|
11
|
-
|
|
12
|
-
unsigned hex;
|
|
13
|
-
if (![stringScanner scanHexInt:&hex]) return nil;
|
|
14
|
-
int r = (hex >> 16) & 0xFF;
|
|
15
|
-
int g = (hex >> 8) & 0xFF;
|
|
16
|
-
int b = (hex) & 0xFF;
|
|
17
|
-
|
|
18
|
-
return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
+ (id)alloc {
|
|
22
|
-
[NSException raise:@"Cannot be instantiated!" format:@"Static class 'Utils' cannot be instantiated!"];
|
|
23
|
-
return nil;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["WebGPUNativeModule.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAMlD;AACA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebGPUNativeModule.d.ts","sourceRoot":"","sources":["../../../commonjs/WebGPUNativeModule.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebGPUNativeModule.d.ts","sourceRoot":"","sources":["../../../module/WebGPUNativeModule.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy-artifacts.d.ts","sourceRoot":"","sources":["../../../../scripts/build/copy-artifacts.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dawn.d.ts","sourceRoot":"","sources":["../../../../scripts/build/dawn.ts"],"names":[],"mappings":""}
|