react-native-wgpu 0.1.0 → 0.1.2
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 +26 -0
- package/android/cpp/cpp-adapter.cpp +66 -3
- package/android/src/main/java/com/webgpu/WebGPUModule.java +64 -22
- 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 +16 -0
- package/cpp/rnwgpu/RNWebGPUManager.cpp +14 -9
- package/cpp/rnwgpu/RNWebGPUManager.h +12 -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 +100 -23
- package/cpp/rnwgpu/api/GPU.h +24 -6
- package/cpp/rnwgpu/api/GPUAdapter.cpp +122 -8
- 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 +43 -7
- 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 +110 -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/ImageData.h +50 -0
- package/cpp/rnwgpu/api/Navigator.h +46 -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 +25 -34
- 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 +16 -0
- package/ios/IOSPlatformContext.mm +18 -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 +49 -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 +158 -19
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Canvas.js +42 -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 +144 -6
- package/lib/module/index.js.map +1 -1
- 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/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 +2 -3
- package/lib/typescript/src/Canvas.d.ts +22 -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 +2 -7
- package/lib/typescript/src/index.d.ts.map +1 -1
- 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 +68 -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 +172 -8
- 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,30 +1,45 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <memory>
|
|
4
|
+
#include <optional>
|
|
4
5
|
#include <string>
|
|
6
|
+
#include <variant>
|
|
5
7
|
|
|
6
8
|
#include "webgpu/webgpu_cpp.h"
|
|
7
9
|
|
|
8
|
-
#include "
|
|
10
|
+
#include "Convertors.h"
|
|
11
|
+
|
|
12
|
+
#include "RNFHybridObject.h"
|
|
9
13
|
#include "RNFJSIConverter.h"
|
|
10
|
-
#include
|
|
14
|
+
#include "WGPULogger.h"
|
|
11
15
|
|
|
12
16
|
namespace jsi = facebook::jsi;
|
|
17
|
+
namespace m = margelo;
|
|
13
18
|
|
|
14
19
|
namespace rnwgpu {
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
wgpu::
|
|
21
|
-
|
|
22
|
-
std::string label;
|
|
21
|
+
struct GPUExternalTextureDescriptor {
|
|
22
|
+
// std::variant<std::shared_ptr<HTMLVideoElement>,
|
|
23
|
+
// std::shared_ptr<VideoFrame>>
|
|
24
|
+
// source; // | HTMLVideoElement | VideoFrame
|
|
25
|
+
// std::optional<wgpu::DefinedColorSpace> colorSpace; // PredefinedColorSpace
|
|
26
|
+
std::optional<std::string> label; // string
|
|
23
27
|
};
|
|
28
|
+
|
|
29
|
+
static bool conv(wgpu::ExternalTextureDescriptor &out,
|
|
30
|
+
const std::shared_ptr<GPUExternalTextureDescriptor> &in) {
|
|
31
|
+
// TODO: implement
|
|
32
|
+
// return conv(out.source, in->source) && conv(out.colorSpace, in->colorSpace)
|
|
33
|
+
// &&
|
|
34
|
+
// return conv(out.label, in->label);
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
24
37
|
} // namespace rnwgpu
|
|
25
38
|
|
|
26
39
|
namespace margelo {
|
|
27
40
|
|
|
41
|
+
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
42
|
+
|
|
28
43
|
template <>
|
|
29
44
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUExternalTextureDescriptor>> {
|
|
30
45
|
static std::shared_ptr<rnwgpu::GPUExternalTextureDescriptor>
|
|
@@ -33,43 +48,37 @@ struct JSIConverter<std::shared_ptr<rnwgpu::GPUExternalTextureDescriptor>> {
|
|
|
33
48
|
if (!outOfBounds && arg.isObject()) {
|
|
34
49
|
auto value = arg.getObject(runtime);
|
|
35
50
|
if (value.hasProperty(runtime, "source")) {
|
|
36
|
-
auto
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} else {
|
|
43
|
-
throw std::runtime_error(
|
|
44
|
-
"Property GPUExternalTextureDescriptor::source is not defined");
|
|
51
|
+
auto prop = value.getProperty(runtime, "source");
|
|
52
|
+
// result->source = JSIConverter<
|
|
53
|
+
// std::variant<std::shared_ptr<HTMLVideoElement>,
|
|
54
|
+
// std::shared_ptr<VideoFrame>>>::fromJSI(runtime,
|
|
55
|
+
// prop,
|
|
56
|
+
// false);
|
|
45
57
|
}
|
|
46
58
|
if (value.hasProperty(runtime, "colorSpace")) {
|
|
47
|
-
auto
|
|
59
|
+
auto prop = value.getProperty(runtime, "colorSpace");
|
|
60
|
+
if (!prop.isUndefined()) {
|
|
61
|
+
// result->colorSpace =
|
|
62
|
+
// JSIConverter<std::optional<wgpu::definedColorSpace>>::fromJSI(
|
|
63
|
+
// runtime, prop, false);
|
|
64
|
+
}
|
|
48
65
|
}
|
|
49
66
|
if (value.hasProperty(runtime, "label")) {
|
|
50
|
-
auto
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
result->label = str;
|
|
55
|
-
result->_instance.label = result->label.c_str();
|
|
67
|
+
auto prop = value.getProperty(runtime, "label");
|
|
68
|
+
if (!prop.isUndefined()) {
|
|
69
|
+
result->label = JSIConverter<std::optional<std::string>>::fromJSI(
|
|
70
|
+
runtime, prop, false);
|
|
56
71
|
}
|
|
57
72
|
}
|
|
58
73
|
}
|
|
59
|
-
|
|
60
|
-
result->_instance.source);
|
|
61
|
-
rnwgpu::Logger::logToConsole(
|
|
62
|
-
"GPUExternalTextureDescriptor::colorSpace = %f",
|
|
63
|
-
result->_instance.colorSpace);
|
|
64
|
-
rnwgpu::Logger::logToConsole("GPUExternalTextureDescriptor::label = %f",
|
|
65
|
-
result->_instance.label);
|
|
74
|
+
|
|
66
75
|
return result;
|
|
67
76
|
}
|
|
68
77
|
static jsi::Value
|
|
69
78
|
toJSI(jsi::Runtime &runtime,
|
|
70
79
|
std::shared_ptr<rnwgpu::GPUExternalTextureDescriptor> arg) {
|
|
71
|
-
|
|
72
|
-
return jsi::Value::null();
|
|
80
|
+
throw std::runtime_error("Invalid GPUExternalTextureDescriptor::toJSI()");
|
|
73
81
|
}
|
|
74
82
|
};
|
|
83
|
+
|
|
75
84
|
} // namespace margelo
|
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
|
+
#include <map>
|
|
3
4
|
#include <memory>
|
|
4
5
|
#include <string>
|
|
6
|
+
#include <variant>
|
|
7
|
+
#include <vector>
|
|
5
8
|
|
|
6
9
|
#include "webgpu/webgpu_cpp.h"
|
|
7
10
|
|
|
8
|
-
#include "Logger.h"
|
|
9
11
|
#include "RNFJSIConverter.h"
|
|
10
|
-
#include
|
|
12
|
+
#include "WGPULogger.h"
|
|
13
|
+
|
|
14
|
+
#include "GPUColorTargetState.h"
|
|
15
|
+
#include "GPUShaderModule.h"
|
|
16
|
+
#include "RNFHybridObject.h"
|
|
11
17
|
|
|
12
18
|
namespace jsi = facebook::jsi;
|
|
19
|
+
namespace m = margelo;
|
|
13
20
|
|
|
14
21
|
namespace rnwgpu {
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
std::string
|
|
23
|
+
struct GPUFragmentState {
|
|
24
|
+
std::vector<
|
|
25
|
+
std::variant<std::nullptr_t, std::shared_ptr<GPUColorTargetState>>>
|
|
26
|
+
targets; // Iterable<GPUColorTargetState | null>
|
|
27
|
+
std::shared_ptr<GPUShaderModule> module; // GPUShaderModule
|
|
28
|
+
std::optional<std::string> entryPoint; // string
|
|
29
|
+
std::optional<std::map<std::string, double>>
|
|
30
|
+
constants; // Record< string, GPUPipelineConstantValue >
|
|
23
31
|
};
|
|
32
|
+
|
|
24
33
|
} // namespace rnwgpu
|
|
25
34
|
|
|
26
35
|
namespace margelo {
|
|
27
36
|
|
|
37
|
+
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
38
|
+
|
|
28
39
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUFragmentState>> {
|
|
29
40
|
static std::shared_ptr<rnwgpu::GPUFragmentState>
|
|
30
41
|
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
@@ -32,54 +43,36 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUFragmentState>> {
|
|
|
32
43
|
if (!outOfBounds && arg.isObject()) {
|
|
33
44
|
auto value = arg.getObject(runtime);
|
|
34
45
|
if (value.hasProperty(runtime, "targets")) {
|
|
35
|
-
auto
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"Property GPUFragmentState::targets is required");
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
throw std::runtime_error(
|
|
43
|
-
"Property GPUFragmentState::targets is not defined");
|
|
46
|
+
auto prop = value.getProperty(runtime, "targets");
|
|
47
|
+
result->targets = JSIConverter<std::vector<std::variant<
|
|
48
|
+
std::nullptr_t, std::shared_ptr<GPUColorTargetState>>>>::
|
|
49
|
+
fromJSI(runtime, prop, false);
|
|
44
50
|
}
|
|
45
51
|
if (value.hasProperty(runtime, "module")) {
|
|
46
|
-
auto
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"Property GPUFragmentState::module is required");
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
throw std::runtime_error(
|
|
54
|
-
"Property GPUFragmentState::module is not defined");
|
|
52
|
+
auto prop = value.getProperty(runtime, "module");
|
|
53
|
+
result->module =
|
|
54
|
+
JSIConverter<std::shared_ptr<GPUShaderModule>>::fromJSI(
|
|
55
|
+
runtime, prop, false);
|
|
55
56
|
}
|
|
56
57
|
if (value.hasProperty(runtime, "entryPoint")) {
|
|
57
|
-
auto
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
auto str = entryPoint.asString(runtime).utf8(runtime);
|
|
61
|
-
result->entryPoint = str;
|
|
62
|
-
result->_instance.entryPoint = result->entryPoint.c_str();
|
|
63
|
-
}
|
|
58
|
+
auto prop = value.getProperty(runtime, "entryPoint");
|
|
59
|
+
result->entryPoint = JSIConverter<std::optional<std::string>>::fromJSI(
|
|
60
|
+
runtime, prop, false);
|
|
64
61
|
}
|
|
65
62
|
if (value.hasProperty(runtime, "constants")) {
|
|
66
|
-
auto
|
|
63
|
+
auto prop = value.getProperty(runtime, "constants");
|
|
64
|
+
result->constants =
|
|
65
|
+
JSIConverter<std::optional<std::map<std::string, double>>>::fromJSI(
|
|
66
|
+
runtime, prop, false);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
result->_instance.targets);
|
|
71
|
-
rnwgpu::Logger::logToConsole("GPUFragmentState::module = %f",
|
|
72
|
-
result->_instance.module);
|
|
73
|
-
rnwgpu::Logger::logToConsole("GPUFragmentState::entryPoint = %f",
|
|
74
|
-
result->_instance.entryPoint);
|
|
75
|
-
rnwgpu::Logger::logToConsole("GPUFragmentState::constants = %f",
|
|
76
|
-
result->_instance.constants);
|
|
69
|
+
|
|
77
70
|
return result;
|
|
78
71
|
}
|
|
79
72
|
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
80
73
|
std::shared_ptr<rnwgpu::GPUFragmentState> arg) {
|
|
81
|
-
|
|
82
|
-
return jsi::Value::null();
|
|
74
|
+
throw std::runtime_error("Invalid GPUFragmentState::toJSI()");
|
|
83
75
|
}
|
|
84
76
|
};
|
|
85
|
-
|
|
77
|
+
|
|
78
|
+
} // namespace margelo
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
4
|
|
|
6
5
|
#include "webgpu/webgpu_cpp.h"
|
|
7
6
|
|
|
8
|
-
#include "Logger.h"
|
|
9
7
|
#include "RNFJSIConverter.h"
|
|
10
|
-
#include
|
|
8
|
+
#include "WGPULogger.h"
|
|
9
|
+
|
|
10
|
+
#include "GPUBuffer.h"
|
|
11
|
+
#include "RNFHybridObject.h"
|
|
11
12
|
|
|
12
13
|
namespace jsi = facebook::jsi;
|
|
14
|
+
namespace m = margelo;
|
|
13
15
|
|
|
14
16
|
namespace rnwgpu {
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
struct GPUImageCopyBuffer {
|
|
19
|
+
std::shared_ptr<GPUBuffer> buffer; // GPUBuffer
|
|
20
|
+
std::optional<double> offset; // GPUSize64
|
|
21
|
+
std::optional<double> bytesPerRow; // GPUSize32
|
|
22
|
+
std::optional<double> rowsPerImage; // GPUSize32
|
|
21
23
|
};
|
|
24
|
+
|
|
22
25
|
} // namespace rnwgpu
|
|
23
26
|
|
|
24
27
|
namespace margelo {
|
|
25
28
|
|
|
29
|
+
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
30
|
+
|
|
26
31
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUImageCopyBuffer>> {
|
|
27
32
|
static std::shared_ptr<rnwgpu::GPUImageCopyBuffer>
|
|
28
33
|
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
@@ -30,54 +35,33 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUImageCopyBuffer>> {
|
|
|
30
35
|
if (!outOfBounds && arg.isObject()) {
|
|
31
36
|
auto value = arg.getObject(runtime);
|
|
32
37
|
if (value.hasProperty(runtime, "buffer")) {
|
|
33
|
-
auto
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
throw std::runtime_error(
|
|
37
|
-
"Property GPUImageCopyBuffer::buffer is required");
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
throw std::runtime_error(
|
|
41
|
-
"Property GPUImageCopyBuffer::buffer is not defined");
|
|
38
|
+
auto prop = value.getProperty(runtime, "buffer");
|
|
39
|
+
result->buffer = JSIConverter<std::shared_ptr<GPUBuffer>>::fromJSI(
|
|
40
|
+
runtime, prop, false);
|
|
42
41
|
}
|
|
43
42
|
if (value.hasProperty(runtime, "offset")) {
|
|
44
|
-
auto
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
result->_instance.offset = offset.getNumber();
|
|
48
|
-
}
|
|
43
|
+
auto prop = value.getProperty(runtime, "offset");
|
|
44
|
+
result->offset =
|
|
45
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, prop, false);
|
|
49
46
|
}
|
|
50
47
|
if (value.hasProperty(runtime, "bytesPerRow")) {
|
|
51
|
-
auto
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
result->_instance.bytesPerRow =
|
|
55
|
-
static_cast<wgpu::Size32>(bytesPerRow.getNumber());
|
|
56
|
-
}
|
|
48
|
+
auto prop = value.getProperty(runtime, "bytesPerRow");
|
|
49
|
+
result->bytesPerRow =
|
|
50
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, prop, false);
|
|
57
51
|
}
|
|
58
52
|
if (value.hasProperty(runtime, "rowsPerImage")) {
|
|
59
|
-
auto
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
result->_instance.rowsPerImage =
|
|
63
|
-
static_cast<wgpu::Size32>(rowsPerImage.getNumber());
|
|
64
|
-
}
|
|
53
|
+
auto prop = value.getProperty(runtime, "rowsPerImage");
|
|
54
|
+
result->rowsPerImage =
|
|
55
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, prop, false);
|
|
65
56
|
}
|
|
66
57
|
}
|
|
67
|
-
|
|
68
|
-
result->_instance.buffer);
|
|
69
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyBuffer::offset = %f",
|
|
70
|
-
result->_instance.offset);
|
|
71
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyBuffer::bytesPerRow = %f",
|
|
72
|
-
result->_instance.bytesPerRow);
|
|
73
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyBuffer::rowsPerImage = %f",
|
|
74
|
-
result->_instance.rowsPerImage);
|
|
58
|
+
|
|
75
59
|
return result;
|
|
76
60
|
}
|
|
77
61
|
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
78
62
|
std::shared_ptr<rnwgpu::GPUImageCopyBuffer> arg) {
|
|
79
|
-
|
|
80
|
-
return jsi::Value::null();
|
|
63
|
+
throw std::runtime_error("Invalid GPUImageCopyBuffer::toJSI()");
|
|
81
64
|
}
|
|
82
65
|
};
|
|
83
|
-
|
|
66
|
+
|
|
67
|
+
} // namespace margelo
|
|
@@ -1,66 +1,57 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <memory>
|
|
4
|
-
#include <
|
|
4
|
+
#include <optional>
|
|
5
|
+
#include <variant>
|
|
6
|
+
#include <vector>
|
|
5
7
|
|
|
6
8
|
#include "webgpu/webgpu_cpp.h"
|
|
7
9
|
|
|
8
|
-
#include "
|
|
10
|
+
#include "Convertors.h"
|
|
11
|
+
#include "RNFHybridObject.h"
|
|
9
12
|
#include "RNFJSIConverter.h"
|
|
10
|
-
|
|
13
|
+
|
|
14
|
+
#include "GPUOrigin2D.h"
|
|
15
|
+
#include "ImageData.h"
|
|
11
16
|
|
|
12
17
|
namespace jsi = facebook::jsi;
|
|
18
|
+
namespace m = margelo;
|
|
13
19
|
|
|
14
20
|
namespace rnwgpu {
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
wgpu::ImageCopyExternalImage _instance;
|
|
22
|
+
struct GPUImageCopyExternalImage {
|
|
23
|
+
std::shared_ptr<ImageData> source; // GPUImageCopyExternalImageSource
|
|
24
|
+
std::optional<std::shared_ptr<GPUOrigin2D>> origin; // GPUOrigin2DStrict
|
|
25
|
+
std::optional<bool> flipY; // boolean
|
|
21
26
|
};
|
|
27
|
+
|
|
22
28
|
} // namespace rnwgpu
|
|
23
29
|
|
|
24
30
|
namespace margelo {
|
|
25
31
|
|
|
32
|
+
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
33
|
+
|
|
26
34
|
template <>
|
|
27
35
|
struct JSIConverter<std::shared_ptr<rnwgpu::GPUImageCopyExternalImage>> {
|
|
28
36
|
static std::shared_ptr<rnwgpu::GPUImageCopyExternalImage>
|
|
29
37
|
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
30
38
|
auto result = std::make_unique<rnwgpu::GPUImageCopyExternalImage>();
|
|
31
39
|
if (!outOfBounds && arg.isObject()) {
|
|
32
|
-
auto
|
|
33
|
-
if (
|
|
34
|
-
auto
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
throw std::runtime_error(
|
|
38
|
-
"Property GPUImageCopyExternalImage::source is required");
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
throw std::runtime_error(
|
|
42
|
-
"Property GPUImageCopyExternalImage::source is not defined");
|
|
43
|
-
}
|
|
44
|
-
if (value.hasProperty(runtime, "origin")) {
|
|
45
|
-
auto origin = value.getProperty(runtime, "origin");
|
|
46
|
-
}
|
|
47
|
-
if (value.hasProperty(runtime, "flipY")) {
|
|
48
|
-
auto flipY = value.getProperty(runtime, "flipY");
|
|
40
|
+
auto obj = arg.getObject(runtime);
|
|
41
|
+
if (obj.hasProperty(runtime, "source")) {
|
|
42
|
+
auto prop = obj.getProperty(runtime, "source");
|
|
43
|
+
result->source = JSIConverter<std::shared_ptr<ImageData>>::fromJSI(
|
|
44
|
+
runtime, prop, false);
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
|
-
|
|
52
|
-
result->_instance.source);
|
|
53
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyExternalImage::origin = %f",
|
|
54
|
-
result->_instance.origin);
|
|
55
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyExternalImage::flipY = %f",
|
|
56
|
-
result->_instance.flipY);
|
|
47
|
+
|
|
57
48
|
return result;
|
|
58
49
|
}
|
|
59
50
|
static jsi::Value
|
|
60
51
|
toJSI(jsi::Runtime &runtime,
|
|
61
52
|
std::shared_ptr<rnwgpu::GPUImageCopyExternalImage> arg) {
|
|
62
|
-
|
|
63
|
-
return jsi::Value::null();
|
|
53
|
+
throw std::runtime_error("Invalid GPUImageCopyExternalImage::toJSI()");
|
|
64
54
|
}
|
|
65
55
|
};
|
|
66
|
-
|
|
56
|
+
|
|
57
|
+
} // namespace margelo
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
4
|
|
|
6
5
|
#include "webgpu/webgpu_cpp.h"
|
|
7
6
|
|
|
8
|
-
#include "Logger.h"
|
|
9
7
|
#include "RNFJSIConverter.h"
|
|
10
|
-
#include
|
|
8
|
+
#include "WGPULogger.h"
|
|
9
|
+
|
|
10
|
+
#include "GPUOrigin3D.h"
|
|
11
|
+
#include "GPUTexture.h"
|
|
12
|
+
#include "RNFHybridObject.h"
|
|
11
13
|
|
|
12
14
|
namespace jsi = facebook::jsi;
|
|
15
|
+
namespace m = margelo;
|
|
13
16
|
|
|
14
17
|
namespace rnwgpu {
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
wgpu::
|
|
19
|
+
struct GPUImageCopyTexture {
|
|
20
|
+
std::shared_ptr<GPUTexture> texture; // GPUTexture
|
|
21
|
+
std::optional<double> mipLevel; // GPUIntegerCoordinate
|
|
22
|
+
std::optional<std::shared_ptr<GPUOrigin3D>> origin; // GPUOrigin3D
|
|
23
|
+
std::optional<wgpu::TextureAspect> aspect; // GPUTextureAspect
|
|
21
24
|
};
|
|
25
|
+
|
|
22
26
|
} // namespace rnwgpu
|
|
23
27
|
|
|
24
28
|
namespace margelo {
|
|
25
29
|
|
|
30
|
+
using namespace rnwgpu; // NOLINT(build/namespaces)
|
|
31
|
+
|
|
26
32
|
template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUImageCopyTexture>> {
|
|
27
33
|
static std::shared_ptr<rnwgpu::GPUImageCopyTexture>
|
|
28
34
|
fromJSI(jsi::Runtime &runtime, const jsi::Value &arg, bool outOfBounds) {
|
|
@@ -30,45 +36,35 @@ template <> struct JSIConverter<std::shared_ptr<rnwgpu::GPUImageCopyTexture>> {
|
|
|
30
36
|
if (!outOfBounds && arg.isObject()) {
|
|
31
37
|
auto value = arg.getObject(runtime);
|
|
32
38
|
if (value.hasProperty(runtime, "texture")) {
|
|
33
|
-
auto
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
throw std::runtime_error(
|
|
37
|
-
"Property GPUImageCopyTexture::texture is required");
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
throw std::runtime_error(
|
|
41
|
-
"Property GPUImageCopyTexture::texture is not defined");
|
|
39
|
+
auto prop = value.getProperty(runtime, "texture");
|
|
40
|
+
result->texture = JSIConverter<std::shared_ptr<GPUTexture>>::fromJSI(
|
|
41
|
+
runtime, prop, false);
|
|
42
42
|
}
|
|
43
43
|
if (value.hasProperty(runtime, "mipLevel")) {
|
|
44
|
-
auto
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
result->_instance.mipLevel =
|
|
48
|
-
static_cast<wgpu::IntegerCoordinate>(mipLevel.getNumber());
|
|
49
|
-
}
|
|
44
|
+
auto prop = value.getProperty(runtime, "mipLevel");
|
|
45
|
+
result->mipLevel =
|
|
46
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, prop, false);
|
|
50
47
|
}
|
|
51
48
|
if (value.hasProperty(runtime, "origin")) {
|
|
52
|
-
auto
|
|
49
|
+
auto prop = value.getProperty(runtime, "origin");
|
|
50
|
+
result->origin =
|
|
51
|
+
JSIConverter<std::optional<std::shared_ptr<GPUOrigin3D>>>::fromJSI(
|
|
52
|
+
runtime, prop, false);
|
|
53
53
|
}
|
|
54
54
|
if (value.hasProperty(runtime, "aspect")) {
|
|
55
|
-
auto
|
|
55
|
+
auto prop = value.getProperty(runtime, "aspect");
|
|
56
|
+
result->aspect =
|
|
57
|
+
JSIConverter<std::optional<wgpu::TextureAspect>>::fromJSI(
|
|
58
|
+
runtime, prop, false);
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
|
-
|
|
59
|
-
result->_instance.texture);
|
|
60
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyTexture::mipLevel = %f",
|
|
61
|
-
result->_instance.mipLevel);
|
|
62
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyTexture::origin = %f",
|
|
63
|
-
result->_instance.origin);
|
|
64
|
-
rnwgpu::Logger::logToConsole("GPUImageCopyTexture::aspect = %f",
|
|
65
|
-
result->_instance.aspect);
|
|
61
|
+
|
|
66
62
|
return result;
|
|
67
63
|
}
|
|
68
64
|
static jsi::Value toJSI(jsi::Runtime &runtime,
|
|
69
65
|
std::shared_ptr<rnwgpu::GPUImageCopyTexture> arg) {
|
|
70
|
-
|
|
71
|
-
return jsi::Value::null();
|
|
66
|
+
throw std::runtime_error("Invalid GPUImageCopyTexture::toJSI()");
|
|
72
67
|
}
|
|
73
68
|
};
|
|
74
|
-
|
|
69
|
+
|
|
70
|
+
} // namespace margelo
|