react-native-wgpu 0.1.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/LICENSE +20 -0
- package/README.md +31 -0
- package/android/CMakeLists.txt +74 -0
- package/android/build.gradle +166 -0
- package/android/cpp/cpp-adapter.cpp +12 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/webgpu/WebGPUModule.java +39 -0
- package/android/src/main/java/com/webgpu/WebGPUView.java +24 -0
- package/android/src/main/java/com/webgpu/WebGPUViewManager.java +31 -0
- package/android/src/main/java/com/webgpu/WebGPUViewPackage.java +26 -0
- package/android/src/newarch/WgpuViewManagerSpec.java +24 -0
- package/android/src/oldarch/WebGPUViewManagerSpec.java +11 -0
- package/cpp/Logger.h +82 -0
- package/cpp/dawn/dawn_proc_table.h +308 -0
- package/cpp/dawn/webgpu.h +4201 -0
- package/cpp/dawn/webgpu_cpp.h +8985 -0
- package/cpp/dawn/webgpu_cpp_print.h +2460 -0
- package/cpp/dawn/wire/client/webgpu.h +339 -0
- package/cpp/dawn/wire/client/webgpu_cpp.h +9140 -0
- package/cpp/jsi/RNFEnumMapper.h +49 -0
- package/cpp/jsi/RNFHybridObject.cpp +145 -0
- package/cpp/jsi/RNFHybridObject.h +162 -0
- package/cpp/jsi/RNFJSIConverter.h +412 -0
- package/cpp/jsi/RNFJSIHelper.h +49 -0
- package/cpp/jsi/RNFPointerHolder.h +95 -0
- package/cpp/jsi/RNFPromise.cpp +45 -0
- package/cpp/jsi/RNFPromise.h +38 -0
- package/cpp/jsi/RNFRuntimeCache.cpp +57 -0
- package/cpp/jsi/RNFRuntimeCache.h +79 -0
- package/cpp/jsi/RNFWorkletRuntimeCollector.h +43 -0
- package/cpp/jsi/RNFWorkletRuntimeRegistry.cpp +11 -0
- package/cpp/jsi/RNFWorkletRuntimeRegistry.h +44 -0
- package/cpp/rnwgpu/MutableBuffer.h +48 -0
- package/cpp/rnwgpu/RNWebGPUManager.cpp +60 -0
- package/cpp/rnwgpu/RNWebGPUManager.h +30 -0
- package/cpp/rnwgpu/api/GPU.cpp +40 -0
- package/cpp/rnwgpu/api/GPU.h +43 -0
- package/cpp/rnwgpu/api/GPUAdapter.cpp +33 -0
- package/cpp/rnwgpu/api/GPUAdapter.h +40 -0
- package/cpp/rnwgpu/api/GPUAdapterInfo.h +33 -0
- package/cpp/rnwgpu/api/GPUBindGroup.h +38 -0
- package/cpp/rnwgpu/api/GPUBindGroupLayout.h +39 -0
- package/cpp/rnwgpu/api/GPUBuffer.cpp +16 -0
- package/cpp/rnwgpu/api/GPUBuffer.h +44 -0
- package/cpp/rnwgpu/api/GPUCanvasContext.h +33 -0
- package/cpp/rnwgpu/api/GPUCommandBuffer.h +38 -0
- package/cpp/rnwgpu/api/GPUCommandEncoder.h +38 -0
- package/cpp/rnwgpu/api/GPUCompilationInfo.h +33 -0
- package/cpp/rnwgpu/api/GPUCompilationMessage.h +33 -0
- package/cpp/rnwgpu/api/GPUComputePassEncoder.h +40 -0
- package/cpp/rnwgpu/api/GPUComputePipeline.h +39 -0
- package/cpp/rnwgpu/api/GPUDevice.cpp +12 -0
- package/cpp/rnwgpu/api/GPUDevice.h +45 -0
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +33 -0
- package/cpp/rnwgpu/api/GPUExternalTexture.h +39 -0
- package/cpp/rnwgpu/api/GPUPipelineLayout.h +38 -0
- package/cpp/rnwgpu/api/GPUQuerySet.h +38 -0
- package/cpp/rnwgpu/api/GPUQueue.h +38 -0
- package/cpp/rnwgpu/api/GPURenderBundle.h +38 -0
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +40 -0
- package/cpp/rnwgpu/api/GPURenderPassEncoder.h +40 -0
- package/cpp/rnwgpu/api/GPURenderPipeline.h +38 -0
- package/cpp/rnwgpu/api/GPUSampler.h +38 -0
- package/cpp/rnwgpu/api/GPUShaderModule.h +38 -0
- package/cpp/rnwgpu/api/GPUSupportedLimits.h +33 -0
- package/cpp/rnwgpu/api/GPUTexture.h +38 -0
- package/cpp/rnwgpu/api/GPUTextureView.h +38 -0
- package/cpp/rnwgpu/api/GPUUncapturedErrorEvent.h +33 -0
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupDescriptor.h +81 -0
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +67 -0
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutDescriptor.h +69 -0
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutEntry.h +95 -0
- package/cpp/rnwgpu/api/descriptors/GPUBlendComponent.h +56 -0
- package/cpp/rnwgpu/api/descriptors/GPUBlendState.h +65 -0
- package/cpp/rnwgpu/api/descriptors/GPUBufferBinding.h +72 -0
- package/cpp/rnwgpu/api/descriptors/GPUBufferBindingLayout.h +62 -0
- package/cpp/rnwgpu/api/descriptors/GPUBufferDescriptor.h +85 -0
- package/cpp/rnwgpu/api/descriptors/GPUBufferUsage.h +43 -0
- package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +93 -0
- package/cpp/rnwgpu/api/descriptors/GPUColorDict.h +81 -0
- package/cpp/rnwgpu/api/descriptors/GPUColorTargetState.h +69 -0
- package/cpp/rnwgpu/api/descriptors/GPUColorWrite.h +31 -0
- package/cpp/rnwgpu/api/descriptors/GPUComputePassDescriptor.h +62 -0
- package/cpp/rnwgpu/api/descriptors/GPUComputePassTimestampWrites.h +80 -0
- package/cpp/rnwgpu/api/descriptors/GPUComputePipelineDescriptor.h +82 -0
- package/cpp/rnwgpu/api/descriptors/GPUDepthStencilState.h +126 -0
- package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +69 -0
- package/cpp/rnwgpu/api/descriptors/GPUExtent3DDict.h +76 -0
- package/cpp/rnwgpu/api/descriptors/GPUExtent3DDictStrict.h +91 -0
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureBindingLayout.h +44 -0
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +75 -0
- package/cpp/rnwgpu/api/descriptors/GPUFragmentState.h +85 -0
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyBuffer.h +83 -0
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +66 -0
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +74 -0
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +88 -0
- package/cpp/rnwgpu/api/descriptors/GPUImageDataLayout.h +70 -0
- package/cpp/rnwgpu/api/descriptors/GPUMapMode.h +25 -0
- package/cpp/rnwgpu/api/descriptors/GPUMultisampleState.h +68 -0
- package/cpp/rnwgpu/api/descriptors/GPUOrigin2DDict.h +61 -0
- package/cpp/rnwgpu/api/descriptors/GPUOrigin2DDictStrict.h +75 -0
- package/cpp/rnwgpu/api/descriptors/GPUOrigin3DDict.h +71 -0
- package/cpp/rnwgpu/api/descriptors/GPUPipelineErrorInit.h +54 -0
- package/cpp/rnwgpu/api/descriptors/GPUPipelineLayoutDescriptor.h +72 -0
- package/cpp/rnwgpu/api/descriptors/GPUPrimitiveState.h +66 -0
- package/cpp/rnwgpu/api/descriptors/GPUProgrammableStage.h +72 -0
- package/cpp/rnwgpu/api/descriptors/GPUQuerySetDescriptor.h +81 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleEncoderDescriptor.h +102 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderPassColorAttachment.h +105 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDepthStencilAttachment.h +118 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDescriptor.h +100 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderPassLayout.h +83 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderPassTimestampWrites.h +80 -0
- package/cpp/rnwgpu/api/descriptors/GPURenderPipelineDescriptor.h +104 -0
- package/cpp/rnwgpu/api/descriptors/GPURequestAdapterOptions.h +56 -0
- package/cpp/rnwgpu/api/descriptors/GPUSamplerBindingLayout.h +48 -0
- package/cpp/rnwgpu/api/descriptors/GPUSamplerDescriptor.h +116 -0
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleCompilationHint.h +64 -0
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleDescriptor.h +88 -0
- package/cpp/rnwgpu/api/descriptors/GPUShaderStage.h +27 -0
- package/cpp/rnwgpu/api/descriptors/GPUStencilFaceState.h +61 -0
- package/cpp/rnwgpu/api/descriptors/GPUStorageTextureBindingLayout.h +67 -0
- package/cpp/rnwgpu/api/descriptors/GPUTextureBindingLayout.h +58 -0
- package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +123 -0
- package/cpp/rnwgpu/api/descriptors/GPUTextureUsage.h +40 -0
- package/cpp/rnwgpu/api/descriptors/GPUTextureViewDescriptor.h +113 -0
- package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +71 -0
- package/cpp/rnwgpu/api/descriptors/GPUVertexAttribute.h +80 -0
- package/cpp/rnwgpu/api/descriptors/GPUVertexBufferLayout.h +73 -0
- package/cpp/rnwgpu/api/descriptors/GPUVertexState.h +77 -0
- package/cpp/rnwgpu/api/descriptors/Unions.h +1645 -0
- package/cpp/webgpu/webgpu.h +33 -0
- package/cpp/webgpu/webgpu_cpp.h +33 -0
- package/cpp/webgpu/webgpu_cpp_chained_struct.h +55 -0
- package/cpp/webgpu/webgpu_enum_class_bitmasks.h +161 -0
- package/ios/RNFAppleLogger.mm +22 -0
- package/ios/Utils.h +5 -0
- package/ios/Utils.m +26 -0
- package/ios/WebGPUModule.h +18 -0
- package/ios/WebGPUModule.mm +77 -0
- package/ios/WebGPUView.h +15 -0
- package/ios/WebGPUView.mm +58 -0
- package/ios/WebGPUViewManager.mm +21 -0
- package/lib/commonjs/WebGPUNativeModule.js +10 -0
- package/lib/commonjs/WebGPUNativeModule.js.map +1 -0
- package/lib/commonjs/WebGPUViewNativeComponent.js +11 -0
- package/lib/commonjs/WebGPUViewNativeComponent.js.map +1 -0
- package/lib/commonjs/index.js +45 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/WebGPUNativeModule.js +4 -0
- package/lib/module/WebGPUNativeModule.js.map +1 -0
- package/lib/module/WebGPUViewNativeComponent.js +4 -0
- package/lib/module/WebGPUViewNativeComponent.js.map +1 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/babel.config.d.ts +2 -0
- package/lib/typescript/babel.config.d.ts.map +1 -0
- package/lib/typescript/jest.config.d.ts +5 -0
- package/lib/typescript/jest.config.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/WebGPUNativeModule.d.ts +5 -0
- package/lib/typescript/lib/commonjs/WebGPUNativeModule.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/WebGPUViewNativeComponent.d.ts +4 -0
- package/lib/typescript/lib/commonjs/WebGPUViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +5 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/WebGPUNativeModule.d.ts +3 -0
- package/lib/typescript/lib/module/WebGPUNativeModule.d.ts.map +1 -0
- package/lib/typescript/lib/module/WebGPUViewNativeComponent.d.ts +4 -0
- package/lib/typescript/lib/module/WebGPUViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +5 -0
- package/lib/typescript/lib/module/index.d.ts.map +1 -0
- package/lib/typescript/scripts/build/copy-artifacts.d.ts +2 -0
- package/lib/typescript/scripts/build/copy-artifacts.d.ts.map +1 -0
- package/lib/typescript/scripts/build/dawn.d.ts +2 -0
- package/lib/typescript/scripts/build/dawn.d.ts.map +1 -0
- package/lib/typescript/scripts/build/util.d.ts +13 -0
- package/lib/typescript/scripts/build/util.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/codegen.d.ts +2 -0
- package/lib/typescript/scripts/codegen/codegen.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/model/dawn.d.ts +2 -0
- package/lib/typescript/scripts/codegen/model/dawn.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/model/model.d.ts +8 -0
- package/lib/typescript/scripts/codegen/model/model.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/templates/Descriptor.d.ts +4 -0
- package/lib/typescript/scripts/codegen/templates/Descriptor.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/templates/Enum.d.ts +3 -0
- package/lib/typescript/scripts/codegen/templates/Enum.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/templates/HybridObject.d.ts +3 -0
- package/lib/typescript/scripts/codegen/templates/HybridObject.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/templates/Unions.d.ts +6 -0
- package/lib/typescript/scripts/codegen/templates/Unions.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/templates/common.d.ts +9 -0
- package/lib/typescript/scripts/codegen/templates/common.d.ts.map +1 -0
- package/lib/typescript/scripts/codegen/util.d.ts +2 -0
- package/lib/typescript/scripts/codegen/util.d.ts.map +1 -0
- package/lib/typescript/src/WebGPUNativeModule.d.ts +7 -0
- package/lib/typescript/src/WebGPUNativeModule.d.ts.map +1 -0
- package/lib/typescript/src/WebGPUViewNativeComponent.d.ts +8 -0
- package/lib/typescript/src/WebGPUViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +9 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +120 -0
- package/react-native-webgpu.podspec +56 -0
- package/src/WebGPUNativeModule.ts +9 -0
- package/src/WebGPUViewNativeComponent.ts +9 -0
- package/src/index.tsx +13 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2022 The Dawn & Tint Authors
|
|
2
|
+
//
|
|
3
|
+
// Redistribution and use in source and binary forms, with or without
|
|
4
|
+
// modification, are permitted provided that the following conditions are met:
|
|
5
|
+
//
|
|
6
|
+
// 1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
// list of conditions and the following disclaimer.
|
|
8
|
+
//
|
|
9
|
+
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
// this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
// and/or other materials provided with the distribution.
|
|
12
|
+
//
|
|
13
|
+
// 3. Neither the name of the copyright holder nor the names of its
|
|
14
|
+
// contributors may be used to endorse or promote products derived from
|
|
15
|
+
// this software without specific prior written permission.
|
|
16
|
+
//
|
|
17
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
|
|
28
|
+
#ifndef INCLUDE_WEBGPU_WEBGPU_H_
|
|
29
|
+
#define INCLUDE_WEBGPU_WEBGPU_H_
|
|
30
|
+
|
|
31
|
+
#include "dawn/webgpu.h"
|
|
32
|
+
|
|
33
|
+
#endif // INCLUDE_WEBGPU_WEBGPU_H_
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2022 The Dawn & Tint Authors
|
|
2
|
+
//
|
|
3
|
+
// Redistribution and use in source and binary forms, with or without
|
|
4
|
+
// modification, are permitted provided that the following conditions are met:
|
|
5
|
+
//
|
|
6
|
+
// 1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
// list of conditions and the following disclaimer.
|
|
8
|
+
//
|
|
9
|
+
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
// this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
// and/or other materials provided with the distribution.
|
|
12
|
+
//
|
|
13
|
+
// 3. Neither the name of the copyright holder nor the names of its
|
|
14
|
+
// contributors may be used to endorse or promote products derived from
|
|
15
|
+
// this software without specific prior written permission.
|
|
16
|
+
//
|
|
17
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
|
|
28
|
+
#ifndef INCLUDE_WEBGPU_WEBGPU_CPP_H_
|
|
29
|
+
#define INCLUDE_WEBGPU_WEBGPU_CPP_H_
|
|
30
|
+
|
|
31
|
+
#include "dawn/webgpu_cpp.h"
|
|
32
|
+
|
|
33
|
+
#endif // INCLUDE_WEBGPU_WEBGPU_CPP_H_
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright 2023 The Dawn & Tint Authors
|
|
2
|
+
//
|
|
3
|
+
// Redistribution and use in source and binary forms, with or without
|
|
4
|
+
// modification, are permitted provided that the following conditions are met:
|
|
5
|
+
//
|
|
6
|
+
// 1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
// list of conditions and the following disclaimer.
|
|
8
|
+
//
|
|
9
|
+
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
// this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
// and/or other materials provided with the distribution.
|
|
12
|
+
//
|
|
13
|
+
// 3. Neither the name of the copyright holder nor the names of its
|
|
14
|
+
// contributors may be used to endorse or promote products derived from
|
|
15
|
+
// this software without specific prior written permission.
|
|
16
|
+
//
|
|
17
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
#ifdef __EMSCRIPTEN__
|
|
28
|
+
#error "Do not include this header. Emscripten already provides headers needed for WebGPU."
|
|
29
|
+
#endif
|
|
30
|
+
#ifndef WEBGPU_CPP_CHAINED_STRUCT_H_
|
|
31
|
+
#define WEBGPU_CPP_CHAINED_STRUCT_H_
|
|
32
|
+
|
|
33
|
+
#include <cstddef>
|
|
34
|
+
#include <cstdint>
|
|
35
|
+
|
|
36
|
+
// This header file declares the ChainedStruct structures separately from the WebGPU
|
|
37
|
+
// headers so that dependencies can directly extend structures without including the larger header
|
|
38
|
+
// which exposes capabilities that may require correctly set proc tables.
|
|
39
|
+
namespace wgpu {
|
|
40
|
+
|
|
41
|
+
enum class SType : uint32_t;
|
|
42
|
+
|
|
43
|
+
struct ChainedStruct {
|
|
44
|
+
ChainedStruct const * nextInChain = nullptr;
|
|
45
|
+
SType sType = SType(0u);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
struct ChainedStructOut {
|
|
49
|
+
ChainedStructOut * nextInChain = nullptr;
|
|
50
|
+
SType sType = SType(0u);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace wgpu}
|
|
54
|
+
|
|
55
|
+
#endif // WEBGPU_CPP_CHAINED_STRUCT_H_
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Copyright 2017 The Dawn & Tint Authors
|
|
2
|
+
//
|
|
3
|
+
// Redistribution and use in source and binary forms, with or without
|
|
4
|
+
// modification, are permitted provided that the following conditions are met:
|
|
5
|
+
//
|
|
6
|
+
// 1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
// list of conditions and the following disclaimer.
|
|
8
|
+
//
|
|
9
|
+
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
// this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
// and/or other materials provided with the distribution.
|
|
12
|
+
//
|
|
13
|
+
// 3. Neither the name of the copyright holder nor the names of its
|
|
14
|
+
// contributors may be used to endorse or promote products derived from
|
|
15
|
+
// this software without specific prior written permission.
|
|
16
|
+
//
|
|
17
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
|
|
28
|
+
#ifndef WEBGPU_ENUM_CLASS_BITMASKS_H_
|
|
29
|
+
#define WEBGPU_ENUM_CLASS_BITMASKS_H_
|
|
30
|
+
|
|
31
|
+
#include <type_traits>
|
|
32
|
+
|
|
33
|
+
// The operators in wgpu:: namespace need be introduced into other namespaces with
|
|
34
|
+
// using-declarations for C++ Argument Dependent Lookup to work.
|
|
35
|
+
#define WGPU_IMPORT_BITMASK_OPERATORS \
|
|
36
|
+
using wgpu::operator|; \
|
|
37
|
+
using wgpu::operator&; \
|
|
38
|
+
using wgpu::operator^; \
|
|
39
|
+
using wgpu::operator~; \
|
|
40
|
+
using wgpu::operator&=; \
|
|
41
|
+
using wgpu::operator|=; \
|
|
42
|
+
using wgpu::operator^=; \
|
|
43
|
+
using wgpu::HasZeroOrOneBits;
|
|
44
|
+
|
|
45
|
+
namespace wgpu {
|
|
46
|
+
|
|
47
|
+
template <typename T>
|
|
48
|
+
struct IsWGPUBitmask {
|
|
49
|
+
static constexpr bool enable = false;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
template <typename T, typename Enable = void>
|
|
53
|
+
struct LowerBitmask {
|
|
54
|
+
static constexpr bool enable = false;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
template <typename T>
|
|
58
|
+
struct LowerBitmask<T, typename std::enable_if<IsWGPUBitmask<T>::enable>::type> {
|
|
59
|
+
static constexpr bool enable = true;
|
|
60
|
+
using type = T;
|
|
61
|
+
constexpr static T Lower(T t) { return t; }
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
template <typename T>
|
|
65
|
+
struct BoolConvertible {
|
|
66
|
+
using Integral = typename std::underlying_type<T>::type;
|
|
67
|
+
|
|
68
|
+
// NOLINTNEXTLINE(runtime/explicit)
|
|
69
|
+
explicit constexpr BoolConvertible(Integral value) : value(value) {}
|
|
70
|
+
constexpr operator bool() const { return value != 0; }
|
|
71
|
+
constexpr operator T() const { return static_cast<T>(value); }
|
|
72
|
+
|
|
73
|
+
Integral value;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
template <typename T>
|
|
77
|
+
struct LowerBitmask<BoolConvertible<T>> {
|
|
78
|
+
static constexpr bool enable = true;
|
|
79
|
+
using type = T;
|
|
80
|
+
static constexpr type Lower(BoolConvertible<T> t) { return t; }
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
template <
|
|
84
|
+
typename T1,
|
|
85
|
+
typename T2,
|
|
86
|
+
typename = typename std::enable_if<LowerBitmask<T1>::enable && LowerBitmask<T2>::enable>::type>
|
|
87
|
+
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator|(T1 left, T2 right) {
|
|
88
|
+
using T = typename LowerBitmask<T1>::type;
|
|
89
|
+
using Integral = typename std::underlying_type<T>::type;
|
|
90
|
+
return BoolConvertible<T>(static_cast<Integral>(LowerBitmask<T1>::Lower(left)) |
|
|
91
|
+
static_cast<Integral>(LowerBitmask<T2>::Lower(right)));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
template <
|
|
95
|
+
typename T1,
|
|
96
|
+
typename T2,
|
|
97
|
+
typename = typename std::enable_if<LowerBitmask<T1>::enable && LowerBitmask<T2>::enable>::type>
|
|
98
|
+
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator&(T1 left, T2 right) {
|
|
99
|
+
using T = typename LowerBitmask<T1>::type;
|
|
100
|
+
using Integral = typename std::underlying_type<T>::type;
|
|
101
|
+
return BoolConvertible<T>(static_cast<Integral>(LowerBitmask<T1>::Lower(left)) &
|
|
102
|
+
static_cast<Integral>(LowerBitmask<T2>::Lower(right)));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
template <
|
|
106
|
+
typename T1,
|
|
107
|
+
typename T2,
|
|
108
|
+
typename = typename std::enable_if<LowerBitmask<T1>::enable && LowerBitmask<T2>::enable>::type>
|
|
109
|
+
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator^(T1 left, T2 right) {
|
|
110
|
+
using T = typename LowerBitmask<T1>::type;
|
|
111
|
+
using Integral = typename std::underlying_type<T>::type;
|
|
112
|
+
return BoolConvertible<T>(static_cast<Integral>(LowerBitmask<T1>::Lower(left)) ^
|
|
113
|
+
static_cast<Integral>(LowerBitmask<T2>::Lower(right)));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
template <typename T1>
|
|
117
|
+
constexpr BoolConvertible<typename LowerBitmask<T1>::type> operator~(T1 t) {
|
|
118
|
+
using T = typename LowerBitmask<T1>::type;
|
|
119
|
+
using Integral = typename std::underlying_type<T>::type;
|
|
120
|
+
return BoolConvertible<T>(~static_cast<Integral>(LowerBitmask<T1>::Lower(t)));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
template <
|
|
124
|
+
typename T,
|
|
125
|
+
typename T2,
|
|
126
|
+
typename = typename std::enable_if<IsWGPUBitmask<T>::enable && LowerBitmask<T2>::enable>::type>
|
|
127
|
+
constexpr T& operator&=(T& l, T2 right) {
|
|
128
|
+
T r = LowerBitmask<T2>::Lower(right);
|
|
129
|
+
l = l & r;
|
|
130
|
+
return l;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
template <
|
|
134
|
+
typename T,
|
|
135
|
+
typename T2,
|
|
136
|
+
typename = typename std::enable_if<IsWGPUBitmask<T>::enable && LowerBitmask<T2>::enable>::type>
|
|
137
|
+
constexpr T& operator|=(T& l, T2 right) {
|
|
138
|
+
T r = LowerBitmask<T2>::Lower(right);
|
|
139
|
+
l = l | r;
|
|
140
|
+
return l;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
template <
|
|
144
|
+
typename T,
|
|
145
|
+
typename T2,
|
|
146
|
+
typename = typename std::enable_if<IsWGPUBitmask<T>::enable && LowerBitmask<T2>::enable>::type>
|
|
147
|
+
constexpr T& operator^=(T& l, T2 right) {
|
|
148
|
+
T r = LowerBitmask<T2>::Lower(right);
|
|
149
|
+
l = l ^ r;
|
|
150
|
+
return l;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
template <typename T>
|
|
154
|
+
constexpr bool HasZeroOrOneBits(T value) {
|
|
155
|
+
using Integral = typename std::underlying_type<T>::type;
|
|
156
|
+
return (static_cast<Integral>(value) & (static_cast<Integral>(value) - 1)) == 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
} // namespace wgpu
|
|
160
|
+
|
|
161
|
+
#endif // WEBGPU_ENUM_CLASS_BITMASKS_H_
|
|
@@ -0,0 +1,22 @@
|
|
|
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
ADDED
package/ios/Utils.m
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#import <React/RCTBridgeModule.h>
|
|
4
|
+
#import <React/RCTEventEmitter.h>
|
|
5
|
+
|
|
6
|
+
@interface WebGPUModule : NSObject <RCTBridgeModule>
|
|
7
|
+
|
|
8
|
+
@property(nonatomic, weak) RCTBridge *bridge;
|
|
9
|
+
@property(nonatomic, weak) RCTModuleRegistry *moduleRegistry;
|
|
10
|
+
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
14
|
+
#import <rnwebgpu/rnwebgpu.h>
|
|
15
|
+
|
|
16
|
+
@interface WebGPUModule () <WebGPUModuleSpec>
|
|
17
|
+
@end
|
|
18
|
+
#endif
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#import "WebGPUModule.h"
|
|
2
|
+
#import <React/RCTBridge+Private.h>
|
|
3
|
+
#import <React/RCTLog.h>
|
|
4
|
+
#import <ReactCommon/RCTTurboModule.h>
|
|
5
|
+
|
|
6
|
+
#include "RNFLogger.h"
|
|
7
|
+
#include "RNWebGPUManager.h"
|
|
8
|
+
|
|
9
|
+
namespace jsi = facebook::jsi;
|
|
10
|
+
namespace react = facebook::react;
|
|
11
|
+
|
|
12
|
+
@implementation WebGPUModule {
|
|
13
|
+
rnwgpu::RNWebGPUManager *_webgpuManager;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
RCT_EXPORT_MODULE(WebGPUModule)
|
|
17
|
+
|
|
18
|
+
#pragma Accessors
|
|
19
|
+
|
|
20
|
+
- (rnwgpu::RNWebGPUManager *)manager {
|
|
21
|
+
return _webgpuManager;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#pragma Setup and invalidation
|
|
25
|
+
|
|
26
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
27
|
+
return YES;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (void)invalidate {
|
|
31
|
+
// if (_webgpuManager != nil) {
|
|
32
|
+
// [_webgpuManager invalidate];
|
|
33
|
+
// }
|
|
34
|
+
_webgpuManager = nil;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
|
|
38
|
+
if (_webgpuManager != nil) {
|
|
39
|
+
// Already initialized, ignore call.
|
|
40
|
+
return @true;
|
|
41
|
+
}
|
|
42
|
+
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)[RCTBridge currentBridge];
|
|
43
|
+
if (!cxxBridge.runtime) {
|
|
44
|
+
NSLog(@"Failed to install react-native-filament: RCTBridge is not a "
|
|
45
|
+
@"RCTCxxBridge!");
|
|
46
|
+
return [NSNumber numberWithBool:NO];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
jsi::Runtime *runtime = (jsi::Runtime *)cxxBridge.runtime;
|
|
50
|
+
if (!runtime) {
|
|
51
|
+
NSLog(@"Failed to install react-native-filament: jsi::Runtime* was null!");
|
|
52
|
+
return [NSNumber numberWithBool:NO];
|
|
53
|
+
}
|
|
54
|
+
std::shared_ptr<react::CallInvoker> jsInvoker = cxxBridge.jsCallInvoker;
|
|
55
|
+
if (!jsInvoker) {
|
|
56
|
+
NSLog(@"Failed to install react-native-filament: react::CallInvoker was "
|
|
57
|
+
@"null!");
|
|
58
|
+
return [NSNumber numberWithBool:NO];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!jsInvoker) {
|
|
62
|
+
jsInvoker = cxxBridge.jsCallInvoker;
|
|
63
|
+
}
|
|
64
|
+
// TODO: remove allocation here
|
|
65
|
+
_webgpuManager = new rnwgpu::RNWebGPUManager(runtime, jsInvoker);
|
|
66
|
+
return @true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
70
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
71
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
72
|
+
jsInvoker = params.jsInvoker;
|
|
73
|
+
return std::make_shared<facebook::react::NativeSkiaModuleSpecJSI>(params);
|
|
74
|
+
}
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
@end
|
package/ios/WebGPUView.h
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This guard prevent this file to be compiled in the old architecture.
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
#import <React/RCTViewComponentView.h>
|
|
4
|
+
#import <UIKit/UIKit.h>
|
|
5
|
+
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@interface WebGPUView : RCTViewComponentView
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
14
|
+
|
|
15
|
+
#endif /* RCT_NEW_ARCH_ENABLED */
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#import "WebGPUView.h"
|
|
3
|
+
|
|
4
|
+
#import <react/renderer/components/RNWebGPUViewSpec/ComponentDescriptors.h>
|
|
5
|
+
#import <react/renderer/components/RNWebGPUViewSpec/EventEmitters.h>
|
|
6
|
+
#import <react/renderer/components/RNWebGPUViewSpec/Props.h>
|
|
7
|
+
#import <react/renderer/components/RNWebGPUViewSpec/RCTComponentViewHelpers.h>
|
|
8
|
+
|
|
9
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
10
|
+
#import "Utils.h"
|
|
11
|
+
|
|
12
|
+
using namespace facebook::react;
|
|
13
|
+
|
|
14
|
+
@interface WebGPUView () <RCTWebGPUViewViewProtocol>
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation WebGPUView {
|
|
19
|
+
UIView *_view;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
23
|
+
return concreteComponentDescriptorProvider<WgpuViewComponentDescriptor>();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
27
|
+
if (self = [super initWithFrame:frame]) {
|
|
28
|
+
static const auto defaultProps = std::make_shared<const WgpuViewProps>();
|
|
29
|
+
_props = defaultProps;
|
|
30
|
+
|
|
31
|
+
_view = [[UIView alloc] init];
|
|
32
|
+
|
|
33
|
+
self.contentView = _view;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return self;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
- (void)updateProps:(Props::Shared const &)props
|
|
40
|
+
oldProps:(Props::Shared const &)oldProps {
|
|
41
|
+
const auto &oldViewProps =
|
|
42
|
+
*std::static_pointer_cast<WebGPUViewProps const>(_props);
|
|
43
|
+
const auto &newViewProps =
|
|
44
|
+
*std::static_pointer_cast<WebGPUViewProps const>(props);
|
|
45
|
+
|
|
46
|
+
if (oldViewProps.color != newViewProps.color) {
|
|
47
|
+
NSString *colorToConvert =
|
|
48
|
+
[[NSString alloc] initWithUTF8String:newViewProps.color.c_str()];
|
|
49
|
+
[_view setBackgroundColor:[Utils hexStringToColor:colorToConvert]];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[super updateProps:props oldProps:oldProps];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
Class<RCTComponentViewProtocol> WebGPUViewCls(void) { return WebGPUView.class; }
|
|
56
|
+
|
|
57
|
+
@end
|
|
58
|
+
#endif
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#import "RCTBridge.h"
|
|
2
|
+
#import "Utils.h"
|
|
3
|
+
#import <React/RCTUIManager.h>
|
|
4
|
+
#import <React/RCTViewManager.h>
|
|
5
|
+
|
|
6
|
+
@interface WebGPUViewManager : RCTViewManager
|
|
7
|
+
@end
|
|
8
|
+
|
|
9
|
+
@implementation WebGPUViewManager
|
|
10
|
+
|
|
11
|
+
RCT_EXPORT_MODULE(WebGPUView)
|
|
12
|
+
|
|
13
|
+
- (UIView *)view {
|
|
14
|
+
return [[UIView alloc] init];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
RCT_CUSTOM_VIEW_PROPERTY(color, NSString, UIView) {
|
|
18
|
+
[view setBackgroundColor:[Utils hexStringToColor:json]];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
// eslint-disable-next-line import/no-default-export
|
|
9
|
+
var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing("WebGPUModule");
|
|
10
|
+
//# sourceMappingURL=WebGPUNativeModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["WebGPUNativeModule.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAMA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// eslint-disable-next-line import/no-default-export
|
|
10
|
+
var _default = exports.default = (0, _codegenNativeComponent.default)("WebGPUView");
|
|
11
|
+
//# sourceMappingURL=WebGPUViewNativeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"../../src","sources":["WebGPUViewNativeComponent.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAO7F;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GACe,IAAAG,+BAAsB,EAAc,YAAY,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
gpu: true,
|
|
8
|
+
WebGPUModule: true,
|
|
9
|
+
WebGPUView: true
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "WebGPUModule", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _WebGPUNativeModule.default;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "WebGPUView", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _WebGPUViewNativeComponent.default;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
exports.gpu = void 0;
|
|
24
|
+
var _WebGPUNativeModule = _interopRequireDefault(require("./WebGPUNativeModule"));
|
|
25
|
+
var _WebGPUViewNativeComponent = _interopRequireWildcard(require("./WebGPUViewNativeComponent"));
|
|
26
|
+
Object.keys(_WebGPUViewNativeComponent).forEach(function (key) {
|
|
27
|
+
if (key === "default" || key === "__esModule") return;
|
|
28
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
29
|
+
if (key in exports && exports[key] === _WebGPUViewNativeComponent[key]) return;
|
|
30
|
+
Object.defineProperty(exports, key, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _WebGPUViewNativeComponent[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
38
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
39
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
40
|
+
_WebGPUNativeModule.default.install();
|
|
41
|
+
const {
|
|
42
|
+
gpu
|
|
43
|
+
} = global;
|
|
44
|
+
exports.gpu = gpu;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_WebGPUNativeModule","_interopRequireDefault","require","_WebGPUViewNativeComponent","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","WebGPUNativeModule","install","gpu","global"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAC,uBAAA,CAAAF,OAAA;AACAG,MAAA,CAAAC,IAAA,CAAAH,0BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,0BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,0BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAA4C,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAL,GAAA,CAAAE,CAAA,OAAAO,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAtB,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAuB,wBAAA,WAAAC,CAAA,IAAAX,CAAA,oBAAAW,CAAA,OAAAnB,cAAA,CAAAC,IAAA,CAAAO,CAAA,EAAAW,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAAtB,MAAA,CAAAuB,wBAAA,CAAAV,CAAA,EAAAW,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAd,GAAA,IAAAc,CAAA,CAAAC,GAAA,IAAA1B,MAAA,CAAAS,cAAA,CAAAW,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAJ,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA;AAAA,SAAAxB,uBAAAiB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAI,UAAA,GAAAJ,CAAA,KAAAK,OAAA,EAAAL,CAAA;AAQ5Cc,2BAAkB,CAACC,OAAO,CAAC,CAAC;AACrB,MAAM;EAAEC;AAAI,CAAC,GAAGC,MAAM;AAACtB,OAAA,CAAAqB,GAAA,GAAAA,GAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../src","sources":["WebGPUViewNativeComponent.ts"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAO5F;AACA,eAAeA,sBAAsB,CAAc,YAAY,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import WebGPUNativeModule from "./WebGPUNativeModule";
|
|
2
|
+
export { default as WebGPUView } from "./WebGPUViewNativeComponent";
|
|
3
|
+
export * from "./WebGPUViewNativeComponent";
|
|
4
|
+
export { default as WebGPUModule } from "./WebGPUNativeModule";
|
|
5
|
+
WebGPUNativeModule.install();
|
|
6
|
+
export const {
|
|
7
|
+
gpu
|
|
8
|
+
} = global;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebGPUNativeModule","default","WebGPUView","WebGPUModule","install","gpu","global"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,sBAAsB;AAErD,SAASC,OAAO,IAAIC,UAAU,QAAQ,6BAA6B;AACnE,cAAc,6BAA6B;AAC3C,SAASD,OAAO,IAAIE,YAAY,QAAQ,sBAAsB;AAO9DH,kBAAkB,CAACI,OAAO,CAAC,CAAC;AAC5B,OAAO,MAAM;EAAEC;AAAI,CAAC,GAAGC,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../babel.config.js"],"names":[],"mappings":""}
|