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,24 +1,79 @@
|
|
|
1
1
|
package com.webgpu;
|
|
2
2
|
|
|
3
|
-
import androidx.annotation.
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
4
|
|
|
5
5
|
import android.content.Context;
|
|
6
|
-
import android.
|
|
6
|
+
import android.view.Surface;
|
|
7
|
+
import android.view.SurfaceHolder;
|
|
8
|
+
import android.view.SurfaceView;
|
|
7
9
|
|
|
8
|
-
import
|
|
10
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
11
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
9
12
|
|
|
10
|
-
public class WebGPUView extends
|
|
13
|
+
public class WebGPUView extends SurfaceView implements SurfaceHolder.Callback {
|
|
14
|
+
|
|
15
|
+
private Integer mContextId;
|
|
16
|
+
private WebGPUModule mModule;
|
|
11
17
|
|
|
12
18
|
public WebGPUView(Context context) {
|
|
13
19
|
super(context);
|
|
20
|
+
getHolder().addCallback(this);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public void setContextId(Integer contextId) {
|
|
24
|
+
if (mModule == null) {
|
|
25
|
+
Context context = getContext();
|
|
26
|
+
if (context instanceof ThemedReactContext) {
|
|
27
|
+
mModule = ((ThemedReactContext) context).getReactApplicationContext().getNativeModule(WebGPUModule.class);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
mContextId = contextId;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
|
35
|
+
super.onLayout(changed, left, top, right, bottom);
|
|
14
36
|
}
|
|
15
37
|
|
|
16
|
-
|
|
17
|
-
|
|
38
|
+
@Override
|
|
39
|
+
public void surfaceCreated(@NonNull SurfaceHolder holder) {
|
|
40
|
+
float density = getResources().getDisplayMetrics().density;
|
|
41
|
+
float width = getWidth() / density;
|
|
42
|
+
float height = getHeight() / density;
|
|
43
|
+
onSurfaceCreate(holder.getSurface(), mContextId, width, height);
|
|
44
|
+
mModule.onSurfaceCreated(mContextId);
|
|
18
45
|
}
|
|
19
46
|
|
|
20
|
-
|
|
21
|
-
|
|
47
|
+
@Override
|
|
48
|
+
public void surfaceChanged(@NonNull SurfaceHolder holder, int format, int width, int height) {
|
|
49
|
+
float density = getResources().getDisplayMetrics().density;
|
|
50
|
+
float scaledWidth = width / density;
|
|
51
|
+
float scaledHeight = height / density;
|
|
52
|
+
onSurfaceChanged(holder.getSurface(), mContextId, scaledWidth, scaledHeight);
|
|
22
53
|
}
|
|
23
54
|
|
|
55
|
+
@Override
|
|
56
|
+
public void surfaceDestroyed(@NonNull SurfaceHolder holder) {
|
|
57
|
+
onSurfaceDestroy(mContextId);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@DoNotStrip
|
|
61
|
+
private native void onSurfaceCreate(
|
|
62
|
+
Surface surface,
|
|
63
|
+
int contextId,
|
|
64
|
+
float width,
|
|
65
|
+
float height
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
@DoNotStrip
|
|
69
|
+
private native void onSurfaceChanged(
|
|
70
|
+
Surface surface,
|
|
71
|
+
int contextId,
|
|
72
|
+
float width,
|
|
73
|
+
float height
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@DoNotStrip
|
|
78
|
+
private native void onSurfaceDestroy(int contextId);
|
|
24
79
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
package com.webgpu;
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import androidx.annotation.Nullable;
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
6
4
|
|
|
7
5
|
import com.facebook.react.module.annotations.ReactModule;
|
|
8
6
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
@@ -13,6 +11,7 @@ public class WebGPUViewManager extends WebGPUViewManagerSpec<WebGPUView> {
|
|
|
13
11
|
|
|
14
12
|
public static final String NAME = "WebGPUView";
|
|
15
13
|
|
|
14
|
+
@NonNull
|
|
16
15
|
@Override
|
|
17
16
|
public String getName() {
|
|
18
17
|
return NAME;
|
|
@@ -24,8 +23,8 @@ public class WebGPUViewManager extends WebGPUViewManagerSpec<WebGPUView> {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
@Override
|
|
27
|
-
@ReactProp(name = "
|
|
28
|
-
public void
|
|
29
|
-
view.
|
|
26
|
+
@ReactProp(name = "contextId")
|
|
27
|
+
public void setContextId(WebGPUView view, int value) {
|
|
28
|
+
view.setContextId(value);
|
|
30
29
|
}
|
|
31
30
|
}
|
package/android/src/newarch/{WgpuViewManagerSpec.java → com/webgpu/WebGPUViewManagerSpec.java}
RENAMED
|
@@ -6,14 +6,14 @@ import androidx.annotation.Nullable;
|
|
|
6
6
|
|
|
7
7
|
import com.facebook.react.uimanager.SimpleViewManager;
|
|
8
8
|
import com.facebook.react.uimanager.ViewManagerDelegate;
|
|
9
|
-
import com.facebook.react.viewmanagers.
|
|
10
|
-
import com.facebook.react.viewmanagers.
|
|
9
|
+
import com.facebook.react.viewmanagers.WebGPUViewManagerDelegate;
|
|
10
|
+
import com.facebook.react.viewmanagers.WebGPUViewManagerInterface;
|
|
11
11
|
|
|
12
|
-
public abstract class
|
|
12
|
+
public abstract class WebGPUViewManagerSpec<T extends View> extends SimpleViewManager<T> implements WebGPUViewManagerInterface<T> {
|
|
13
13
|
private final ViewManagerDelegate<T> mDelegate;
|
|
14
14
|
|
|
15
|
-
public
|
|
16
|
-
mDelegate = new
|
|
15
|
+
public WebGPUViewManagerSpec() {
|
|
16
|
+
mDelegate = new WebGPUViewManagerDelegate(this);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@Nullable
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package com.webgpu;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
8
|
+
|
|
9
|
+
class NativeWebGPUModuleSpec extends ReactContextBaseJavaModule {
|
|
10
|
+
|
|
11
|
+
public static final String NAME = "WebGPUModule";
|
|
12
|
+
|
|
13
|
+
public NativeWebGPUModuleSpec(@Nullable ReactApplicationContext reactContext) {
|
|
14
|
+
super(reactContext);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@NonNull
|
|
18
|
+
@Override
|
|
19
|
+
public String getName() {
|
|
20
|
+
return NAME;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
package/android/src/oldarch/{WebGPUViewManagerSpec.java → com/webgpu/WebGPUViewManagerSpec.java}
RENAMED
|
@@ -7,5 +7,5 @@ import androidx.annotation.Nullable;
|
|
|
7
7
|
import com.facebook.react.uimanager.SimpleViewManager;
|
|
8
8
|
|
|
9
9
|
public abstract class WebGPUViewManagerSpec<T extends View> extends SimpleViewManager<T> {
|
|
10
|
-
public abstract void
|
|
10
|
+
public abstract void setContextId(T view, int contextId);
|
|
11
11
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#include <android/log.h>
|
|
12
12
|
#endif
|
|
13
13
|
|
|
14
|
-
#ifdef
|
|
14
|
+
#ifdef __APPLE__
|
|
15
15
|
#include <syslog.h>
|
|
16
16
|
#endif
|
|
17
17
|
|
|
@@ -27,10 +27,10 @@ public:
|
|
|
27
27
|
*/
|
|
28
28
|
static void logToConsole(std::string message) {
|
|
29
29
|
#if defined(ANDROID) || defined(__ANDROID__)
|
|
30
|
-
__android_log_write(ANDROID_LOG_INFO, "
|
|
30
|
+
__android_log_write(ANDROID_LOG_INFO, "WebGPU", message.c_str());
|
|
31
31
|
#endif
|
|
32
32
|
|
|
33
|
-
#ifdef
|
|
33
|
+
#ifdef __APPLE__
|
|
34
34
|
syslog(LOG_ERR, "%s\n", message.c_str());
|
|
35
35
|
#endif
|
|
36
36
|
}
|
|
@@ -47,10 +47,10 @@ public:
|
|
|
47
47
|
static char buffer[512];
|
|
48
48
|
vsnprintf(buffer, sizeof(buffer), fmt, args);
|
|
49
49
|
#if defined(ANDROID) || defined(__ANDROID__)
|
|
50
|
-
__android_log_write(ANDROID_LOG_INFO, "
|
|
50
|
+
__android_log_write(ANDROID_LOG_INFO, "WebGPU", buffer);
|
|
51
51
|
#endif
|
|
52
|
-
#ifdef
|
|
53
|
-
syslog(LOG_ERR, "
|
|
52
|
+
#ifdef __APPLE__
|
|
53
|
+
syslog(LOG_ERR, "WebGPU: %s\n", buffer);
|
|
54
54
|
#endif
|
|
55
55
|
va_end(args);
|
|
56
56
|
}
|
|
@@ -69,6 +69,13 @@ public:
|
|
|
69
69
|
warn.call(runtime, jsi::String::createFromUtf8(runtime, message));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
static void errorToJavascriptConsole(jsi::Runtime &runtime,
|
|
73
|
+
const std::string &message) {
|
|
74
|
+
auto console = Logger::getJavascriptConsole(runtime).asObject(runtime);
|
|
75
|
+
auto warn = console.getPropertyAsFunction(runtime, "error");
|
|
76
|
+
warn.call(runtime, jsi::String::createFromUtf8(runtime, message));
|
|
77
|
+
}
|
|
78
|
+
|
|
72
79
|
private:
|
|
73
80
|
static jsi::Value getJavascriptConsole(jsi::Runtime &runtime) {
|
|
74
81
|
auto console = runtime.global().getProperty(runtime, "console");
|
package/cpp/dawn/webgpu.h
CHANGED
|
@@ -124,6 +124,7 @@ typedef struct WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE;
|
|
|
124
124
|
typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE;
|
|
125
125
|
|
|
126
126
|
// Structure forward declarations
|
|
127
|
+
struct WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER;
|
|
127
128
|
struct WGPUAdapterInfo;
|
|
128
129
|
struct WGPUAdapterProperties;
|
|
129
130
|
struct WGPUAdapterPropertiesD3D;
|
|
@@ -482,6 +483,8 @@ typedef enum WGPUFeatureName {
|
|
|
482
483
|
WGPUFeatureName_RG11B10UfloatRenderable = 0x00000009,
|
|
483
484
|
WGPUFeatureName_BGRA8UnormStorage = 0x0000000A,
|
|
484
485
|
WGPUFeatureName_Float32Filterable = 0x0000000B,
|
|
486
|
+
WGPUFeatureName_Subgroups = 0x0000000C,
|
|
487
|
+
WGPUFeatureName_SubgroupsF16 = 0x0000000D,
|
|
485
488
|
WGPUFeatureName_DawnInternalUsages = 0x00050000,
|
|
486
489
|
WGPUFeatureName_DawnMultiPlanarFormats = 0x00050001,
|
|
487
490
|
WGPUFeatureName_DawnNative = 0x00050002,
|
|
@@ -1223,6 +1226,12 @@ typedef struct WGPUUncapturedErrorCallbackInfo2 {
|
|
|
1223
1226
|
/*.userdata2=*/nullptr WGPU_COMMA \
|
|
1224
1227
|
})
|
|
1225
1228
|
|
|
1229
|
+
typedef struct WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER {
|
|
1230
|
+
} WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER WGPU_STRUCTURE_ATTRIBUTE;
|
|
1231
|
+
|
|
1232
|
+
#define WGPU_INTERNAL__HAVE_EMDAWNWEBGPU_HEADER_INIT WGPU_MAKE_INIT_STRUCT(WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER, { \
|
|
1233
|
+
})
|
|
1234
|
+
|
|
1226
1235
|
typedef struct WGPUAdapterInfo {
|
|
1227
1236
|
WGPUChainedStructOut * nextInChain;
|
|
1228
1237
|
char const * vendor;
|
package/cpp/dawn/webgpu_cpp.h
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
26
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
27
|
#ifdef __EMSCRIPTEN__
|
|
28
|
-
#error "
|
|
28
|
+
#error "This header is for native Dawn. Use Dawn's or Emscripten's Emscripten bindings instead."
|
|
29
29
|
#endif
|
|
30
30
|
#ifndef WEBGPU_CPP_H_
|
|
31
31
|
#define WEBGPU_CPP_H_
|
|
@@ -303,6 +303,8 @@ enum class FeatureName : uint32_t {
|
|
|
303
303
|
RG11B10UfloatRenderable = WGPUFeatureName_RG11B10UfloatRenderable,
|
|
304
304
|
BGRA8UnormStorage = WGPUFeatureName_BGRA8UnormStorage,
|
|
305
305
|
Float32Filterable = WGPUFeatureName_Float32Filterable,
|
|
306
|
+
Subgroups = WGPUFeatureName_Subgroups,
|
|
307
|
+
SubgroupsF16 = WGPUFeatureName_SubgroupsF16,
|
|
306
308
|
DawnInternalUsages = WGPUFeatureName_DawnInternalUsages,
|
|
307
309
|
DawnMultiPlanarFormats = WGPUFeatureName_DawnMultiPlanarFormats,
|
|
308
310
|
DawnNative = WGPUFeatureName_DawnNative,
|
|
@@ -1080,6 +1082,7 @@ class SwapChain;
|
|
|
1080
1082
|
class Texture;
|
|
1081
1083
|
class TextureView;
|
|
1082
1084
|
|
|
1085
|
+
struct INTERNAL__HAVE_EMDAWNWEBGPU_HEADER;
|
|
1083
1086
|
struct AdapterInfo;
|
|
1084
1087
|
struct AdapterProperties;
|
|
1085
1088
|
struct AdapterPropertiesD3D;
|
|
@@ -1867,6 +1870,11 @@ static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sTyp
|
|
|
1867
1870
|
"offsetof mismatch for ChainedStruct::sType");
|
|
1868
1871
|
|
|
1869
1872
|
|
|
1873
|
+
struct INTERNAL__HAVE_EMDAWNWEBGPU_HEADER {
|
|
1874
|
+
inline operator const WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER&() const noexcept;
|
|
1875
|
+
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1870
1878
|
struct AdapterInfo {
|
|
1871
1879
|
inline AdapterInfo();
|
|
1872
1880
|
inline ~AdapterInfo();
|
|
@@ -1888,6 +1896,7 @@ struct AdapterInfo {
|
|
|
1888
1896
|
Bool const compatibilityMode = false;
|
|
1889
1897
|
|
|
1890
1898
|
private:
|
|
1899
|
+
inline void FreeMembers();
|
|
1891
1900
|
static inline void Reset(AdapterInfo& value);
|
|
1892
1901
|
};
|
|
1893
1902
|
|
|
@@ -1912,6 +1921,7 @@ struct AdapterProperties {
|
|
|
1912
1921
|
Bool const compatibilityMode = false;
|
|
1913
1922
|
|
|
1914
1923
|
private:
|
|
1924
|
+
inline void FreeMembers();
|
|
1915
1925
|
static inline void Reset(AdapterProperties& value);
|
|
1916
1926
|
};
|
|
1917
1927
|
|
|
@@ -2678,6 +2688,7 @@ struct SharedBufferMemoryEndAccessState {
|
|
|
2678
2688
|
uint64_t const * const signaledValues = {};
|
|
2679
2689
|
|
|
2680
2690
|
private:
|
|
2691
|
+
inline void FreeMembers();
|
|
2681
2692
|
static inline void Reset(SharedBufferMemoryEndAccessState& value);
|
|
2682
2693
|
};
|
|
2683
2694
|
|
|
@@ -2927,6 +2938,7 @@ struct SharedTextureMemoryEndAccessState {
|
|
|
2927
2938
|
uint64_t const * const signaledValues = {};
|
|
2928
2939
|
|
|
2929
2940
|
private:
|
|
2941
|
+
inline void FreeMembers();
|
|
2930
2942
|
static inline void Reset(SharedTextureMemoryEndAccessState& value);
|
|
2931
2943
|
};
|
|
2932
2944
|
|
|
@@ -3046,6 +3058,7 @@ struct SurfaceCapabilities {
|
|
|
3046
3058
|
CompositeAlphaMode const * const alphaModes = {};
|
|
3047
3059
|
|
|
3048
3060
|
private:
|
|
3061
|
+
inline void FreeMembers();
|
|
3049
3062
|
static inline void Reset(SurfaceCapabilities& value);
|
|
3050
3063
|
};
|
|
3051
3064
|
|
|
@@ -3312,6 +3325,7 @@ struct AdapterPropertiesMemoryHeaps : ChainedStructOut {
|
|
|
3312
3325
|
MemoryHeapInfo const * const heapInfo = {};
|
|
3313
3326
|
|
|
3314
3327
|
private:
|
|
3328
|
+
inline void FreeMembers();
|
|
3315
3329
|
static inline void Reset(AdapterPropertiesMemoryHeaps& value);
|
|
3316
3330
|
};
|
|
3317
3331
|
|
|
@@ -3394,6 +3408,7 @@ struct DrmFormatCapabilities : ChainedStructOut {
|
|
|
3394
3408
|
DrmFormatProperties const * const properties = {};
|
|
3395
3409
|
|
|
3396
3410
|
private:
|
|
3411
|
+
inline void FreeMembers();
|
|
3397
3412
|
static inline void Reset(DrmFormatCapabilities& value);
|
|
3398
3413
|
};
|
|
3399
3414
|
|
|
@@ -3726,13 +3741,19 @@ struct DeviceDescriptor : protected detail::DeviceDescriptor {
|
|
|
3726
3741
|
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
|
|
3727
3742
|
#endif
|
|
3728
3743
|
|
|
3744
|
+
// INTERNAL__HAVE_EMDAWNWEBGPU_HEADER implementation
|
|
3745
|
+
|
|
3746
|
+
INTERNAL__HAVE_EMDAWNWEBGPU_HEADER::operator const WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER&() const noexcept {
|
|
3747
|
+
return *reinterpret_cast<const WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER*>(this);
|
|
3748
|
+
}
|
|
3749
|
+
|
|
3750
|
+
static_assert(sizeof(INTERNAL__HAVE_EMDAWNWEBGPU_HEADER) == sizeof(WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER), "sizeof mismatch for INTERNAL__HAVE_EMDAWNWEBGPU_HEADER");
|
|
3751
|
+
static_assert(alignof(INTERNAL__HAVE_EMDAWNWEBGPU_HEADER) == alignof(WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER), "alignof mismatch for INTERNAL__HAVE_EMDAWNWEBGPU_HEADER");
|
|
3752
|
+
|
|
3729
3753
|
// AdapterInfo implementation
|
|
3730
3754
|
AdapterInfo::AdapterInfo() = default;
|
|
3731
3755
|
AdapterInfo::~AdapterInfo() {
|
|
3732
|
-
|
|
3733
|
-
wgpuAdapterInfoFreeMembers(
|
|
3734
|
-
*reinterpret_cast<WGPUAdapterInfo*>(this));
|
|
3735
|
-
}
|
|
3756
|
+
FreeMembers();
|
|
3736
3757
|
}
|
|
3737
3758
|
|
|
3738
3759
|
AdapterInfo::AdapterInfo(AdapterInfo&& rhs)
|
|
@@ -3752,7 +3773,7 @@ AdapterInfo& AdapterInfo::operator=(AdapterInfo&& rhs) {
|
|
|
3752
3773
|
if (&rhs == this) {
|
|
3753
3774
|
return *this;
|
|
3754
3775
|
}
|
|
3755
|
-
|
|
3776
|
+
FreeMembers();
|
|
3756
3777
|
::wgpu::detail::AsNonConstReference(this->vendor) = std::move(rhs.vendor);
|
|
3757
3778
|
::wgpu::detail::AsNonConstReference(this->architecture) = std::move(rhs.architecture);
|
|
3758
3779
|
::wgpu::detail::AsNonConstReference(this->device) = std::move(rhs.device);
|
|
@@ -3766,7 +3787,14 @@ AdapterInfo& AdapterInfo::operator=(AdapterInfo&& rhs) {
|
|
|
3766
3787
|
return *this;
|
|
3767
3788
|
}
|
|
3768
3789
|
|
|
3769
|
-
|
|
3790
|
+
void AdapterInfo::FreeMembers() {
|
|
3791
|
+
if (this->vendor != nullptr || this->architecture != nullptr || this->device != nullptr || this->description != nullptr) {
|
|
3792
|
+
wgpuAdapterInfoFreeMembers(
|
|
3793
|
+
*reinterpret_cast<WGPUAdapterInfo*>(this));
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
// static
|
|
3770
3798
|
void AdapterInfo::Reset(AdapterInfo& value) {
|
|
3771
3799
|
AdapterInfo defaultValue{};
|
|
3772
3800
|
::wgpu::detail::AsNonConstReference(value.vendor) = defaultValue.vendor;
|
|
@@ -3810,10 +3838,7 @@ static_assert(offsetof(AdapterInfo, compatibilityMode) == offsetof(WGPUAdapterIn
|
|
|
3810
3838
|
// AdapterProperties implementation
|
|
3811
3839
|
AdapterProperties::AdapterProperties() = default;
|
|
3812
3840
|
AdapterProperties::~AdapterProperties() {
|
|
3813
|
-
|
|
3814
|
-
wgpuAdapterPropertiesFreeMembers(
|
|
3815
|
-
*reinterpret_cast<WGPUAdapterProperties*>(this));
|
|
3816
|
-
}
|
|
3841
|
+
FreeMembers();
|
|
3817
3842
|
}
|
|
3818
3843
|
|
|
3819
3844
|
AdapterProperties::AdapterProperties(AdapterProperties&& rhs)
|
|
@@ -3833,7 +3858,7 @@ AdapterProperties& AdapterProperties::operator=(AdapterProperties&& rhs) {
|
|
|
3833
3858
|
if (&rhs == this) {
|
|
3834
3859
|
return *this;
|
|
3835
3860
|
}
|
|
3836
|
-
|
|
3861
|
+
FreeMembers();
|
|
3837
3862
|
::wgpu::detail::AsNonConstReference(this->vendorID) = std::move(rhs.vendorID);
|
|
3838
3863
|
::wgpu::detail::AsNonConstReference(this->vendorName) = std::move(rhs.vendorName);
|
|
3839
3864
|
::wgpu::detail::AsNonConstReference(this->architecture) = std::move(rhs.architecture);
|
|
@@ -3847,7 +3872,14 @@ AdapterProperties& AdapterProperties::operator=(AdapterProperties&& rhs) {
|
|
|
3847
3872
|
return *this;
|
|
3848
3873
|
}
|
|
3849
3874
|
|
|
3850
|
-
|
|
3875
|
+
void AdapterProperties::FreeMembers() {
|
|
3876
|
+
if (this->vendorName != nullptr || this->architecture != nullptr || this->name != nullptr || this->driverDescription != nullptr) {
|
|
3877
|
+
wgpuAdapterPropertiesFreeMembers(
|
|
3878
|
+
*reinterpret_cast<WGPUAdapterProperties*>(this));
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
|
|
3882
|
+
// static
|
|
3851
3883
|
void AdapterProperties::Reset(AdapterProperties& value) {
|
|
3852
3884
|
AdapterProperties defaultValue{};
|
|
3853
3885
|
::wgpu::detail::AsNonConstReference(value.vendorID) = defaultValue.vendorID;
|
|
@@ -5259,10 +5291,7 @@ static_assert(offsetof(SharedBufferMemoryDescriptor, label) == offsetof(WGPUShar
|
|
|
5259
5291
|
// SharedBufferMemoryEndAccessState implementation
|
|
5260
5292
|
SharedBufferMemoryEndAccessState::SharedBufferMemoryEndAccessState() = default;
|
|
5261
5293
|
SharedBufferMemoryEndAccessState::~SharedBufferMemoryEndAccessState() {
|
|
5262
|
-
|
|
5263
|
-
wgpuSharedBufferMemoryEndAccessStateFreeMembers(
|
|
5264
|
-
*reinterpret_cast<WGPUSharedBufferMemoryEndAccessState*>(this));
|
|
5265
|
-
}
|
|
5294
|
+
FreeMembers();
|
|
5266
5295
|
}
|
|
5267
5296
|
|
|
5268
5297
|
SharedBufferMemoryEndAccessState::SharedBufferMemoryEndAccessState(SharedBufferMemoryEndAccessState&& rhs)
|
|
@@ -5277,7 +5306,7 @@ SharedBufferMemoryEndAccessState& SharedBufferMemoryEndAccessState::operator=(Sh
|
|
|
5277
5306
|
if (&rhs == this) {
|
|
5278
5307
|
return *this;
|
|
5279
5308
|
}
|
|
5280
|
-
|
|
5309
|
+
FreeMembers();
|
|
5281
5310
|
::wgpu::detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized);
|
|
5282
5311
|
::wgpu::detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount);
|
|
5283
5312
|
::wgpu::detail::AsNonConstReference(this->fences) = std::move(rhs.fences);
|
|
@@ -5286,7 +5315,14 @@ SharedBufferMemoryEndAccessState& SharedBufferMemoryEndAccessState::operator=(Sh
|
|
|
5286
5315
|
return *this;
|
|
5287
5316
|
}
|
|
5288
5317
|
|
|
5289
|
-
|
|
5318
|
+
void SharedBufferMemoryEndAccessState::FreeMembers() {
|
|
5319
|
+
if (this->fences != nullptr || this->signaledValues != nullptr) {
|
|
5320
|
+
wgpuSharedBufferMemoryEndAccessStateFreeMembers(
|
|
5321
|
+
*reinterpret_cast<WGPUSharedBufferMemoryEndAccessState*>(this));
|
|
5322
|
+
}
|
|
5323
|
+
}
|
|
5324
|
+
|
|
5325
|
+
// static
|
|
5290
5326
|
void SharedBufferMemoryEndAccessState::Reset(SharedBufferMemoryEndAccessState& value) {
|
|
5291
5327
|
SharedBufferMemoryEndAccessState defaultValue{};
|
|
5292
5328
|
::wgpu::detail::AsNonConstReference(value.initialized) = defaultValue.initialized;
|
|
@@ -5713,10 +5749,7 @@ static_assert(offsetof(SharedTextureMemoryDmaBufPlane, stride) == offsetof(WGPUS
|
|
|
5713
5749
|
// SharedTextureMemoryEndAccessState implementation
|
|
5714
5750
|
SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState() = default;
|
|
5715
5751
|
SharedTextureMemoryEndAccessState::~SharedTextureMemoryEndAccessState() {
|
|
5716
|
-
|
|
5717
|
-
wgpuSharedTextureMemoryEndAccessStateFreeMembers(
|
|
5718
|
-
*reinterpret_cast<WGPUSharedTextureMemoryEndAccessState*>(this));
|
|
5719
|
-
}
|
|
5752
|
+
FreeMembers();
|
|
5720
5753
|
}
|
|
5721
5754
|
|
|
5722
5755
|
SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&& rhs)
|
|
@@ -5731,7 +5764,7 @@ SharedTextureMemoryEndAccessState& SharedTextureMemoryEndAccessState::operator=(
|
|
|
5731
5764
|
if (&rhs == this) {
|
|
5732
5765
|
return *this;
|
|
5733
5766
|
}
|
|
5734
|
-
|
|
5767
|
+
FreeMembers();
|
|
5735
5768
|
::wgpu::detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized);
|
|
5736
5769
|
::wgpu::detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount);
|
|
5737
5770
|
::wgpu::detail::AsNonConstReference(this->fences) = std::move(rhs.fences);
|
|
@@ -5740,7 +5773,14 @@ SharedTextureMemoryEndAccessState& SharedTextureMemoryEndAccessState::operator=(
|
|
|
5740
5773
|
return *this;
|
|
5741
5774
|
}
|
|
5742
5775
|
|
|
5743
|
-
|
|
5776
|
+
void SharedTextureMemoryEndAccessState::FreeMembers() {
|
|
5777
|
+
if (this->fences != nullptr || this->signaledValues != nullptr) {
|
|
5778
|
+
wgpuSharedTextureMemoryEndAccessStateFreeMembers(
|
|
5779
|
+
*reinterpret_cast<WGPUSharedTextureMemoryEndAccessState*>(this));
|
|
5780
|
+
}
|
|
5781
|
+
}
|
|
5782
|
+
|
|
5783
|
+
// static
|
|
5744
5784
|
void SharedTextureMemoryEndAccessState::Reset(SharedTextureMemoryEndAccessState& value) {
|
|
5745
5785
|
SharedTextureMemoryEndAccessState defaultValue{};
|
|
5746
5786
|
::wgpu::detail::AsNonConstReference(value.initialized) = defaultValue.initialized;
|
|
@@ -5951,10 +5991,7 @@ static_assert(offsetof(StorageTextureBindingLayout, viewDimension) == offsetof(W
|
|
|
5951
5991
|
// SurfaceCapabilities implementation
|
|
5952
5992
|
SurfaceCapabilities::SurfaceCapabilities() = default;
|
|
5953
5993
|
SurfaceCapabilities::~SurfaceCapabilities() {
|
|
5954
|
-
|
|
5955
|
-
wgpuSurfaceCapabilitiesFreeMembers(
|
|
5956
|
-
*reinterpret_cast<WGPUSurfaceCapabilities*>(this));
|
|
5957
|
-
}
|
|
5994
|
+
FreeMembers();
|
|
5958
5995
|
}
|
|
5959
5996
|
|
|
5960
5997
|
SurfaceCapabilities::SurfaceCapabilities(SurfaceCapabilities&& rhs)
|
|
@@ -5972,7 +6009,7 @@ SurfaceCapabilities& SurfaceCapabilities::operator=(SurfaceCapabilities&& rhs) {
|
|
|
5972
6009
|
if (&rhs == this) {
|
|
5973
6010
|
return *this;
|
|
5974
6011
|
}
|
|
5975
|
-
|
|
6012
|
+
FreeMembers();
|
|
5976
6013
|
::wgpu::detail::AsNonConstReference(this->usages) = std::move(rhs.usages);
|
|
5977
6014
|
::wgpu::detail::AsNonConstReference(this->formatCount) = std::move(rhs.formatCount);
|
|
5978
6015
|
::wgpu::detail::AsNonConstReference(this->formats) = std::move(rhs.formats);
|
|
@@ -5984,7 +6021,14 @@ SurfaceCapabilities& SurfaceCapabilities::operator=(SurfaceCapabilities&& rhs) {
|
|
|
5984
6021
|
return *this;
|
|
5985
6022
|
}
|
|
5986
6023
|
|
|
5987
|
-
|
|
6024
|
+
void SurfaceCapabilities::FreeMembers() {
|
|
6025
|
+
if (this->formats != nullptr || this->presentModes != nullptr || this->alphaModes != nullptr) {
|
|
6026
|
+
wgpuSurfaceCapabilitiesFreeMembers(
|
|
6027
|
+
*reinterpret_cast<WGPUSurfaceCapabilities*>(this));
|
|
6028
|
+
}
|
|
6029
|
+
}
|
|
6030
|
+
|
|
6031
|
+
// static
|
|
5988
6032
|
void SurfaceCapabilities::Reset(SurfaceCapabilities& value) {
|
|
5989
6033
|
SurfaceCapabilities defaultValue{};
|
|
5990
6034
|
::wgpu::detail::AsNonConstReference(value.usages) = defaultValue.usages;
|
|
@@ -6494,10 +6538,7 @@ AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps(AdapterPropertiesMemo
|
|
|
6494
6538
|
heapCount(std::move(init.heapCount)),
|
|
6495
6539
|
heapInfo(std::move(init.heapInfo)){}
|
|
6496
6540
|
AdapterPropertiesMemoryHeaps::~AdapterPropertiesMemoryHeaps() {
|
|
6497
|
-
|
|
6498
|
-
wgpuAdapterPropertiesMemoryHeapsFreeMembers(
|
|
6499
|
-
*reinterpret_cast<WGPUAdapterPropertiesMemoryHeaps*>(this));
|
|
6500
|
-
}
|
|
6541
|
+
FreeMembers();
|
|
6501
6542
|
}
|
|
6502
6543
|
|
|
6503
6544
|
AdapterPropertiesMemoryHeaps::AdapterPropertiesMemoryHeaps(AdapterPropertiesMemoryHeaps&& rhs)
|
|
@@ -6510,14 +6551,21 @@ AdapterPropertiesMemoryHeaps& AdapterPropertiesMemoryHeaps::operator=(AdapterPro
|
|
|
6510
6551
|
if (&rhs == this) {
|
|
6511
6552
|
return *this;
|
|
6512
6553
|
}
|
|
6513
|
-
|
|
6554
|
+
FreeMembers();
|
|
6514
6555
|
::wgpu::detail::AsNonConstReference(this->heapCount) = std::move(rhs.heapCount);
|
|
6515
6556
|
::wgpu::detail::AsNonConstReference(this->heapInfo) = std::move(rhs.heapInfo);
|
|
6516
6557
|
Reset(rhs);
|
|
6517
6558
|
return *this;
|
|
6518
6559
|
}
|
|
6519
6560
|
|
|
6520
|
-
|
|
6561
|
+
void AdapterPropertiesMemoryHeaps::FreeMembers() {
|
|
6562
|
+
if (this->heapInfo != nullptr) {
|
|
6563
|
+
wgpuAdapterPropertiesMemoryHeapsFreeMembers(
|
|
6564
|
+
*reinterpret_cast<WGPUAdapterPropertiesMemoryHeaps*>(this));
|
|
6565
|
+
}
|
|
6566
|
+
}
|
|
6567
|
+
|
|
6568
|
+
// static
|
|
6521
6569
|
void AdapterPropertiesMemoryHeaps::Reset(AdapterPropertiesMemoryHeaps& value) {
|
|
6522
6570
|
AdapterPropertiesMemoryHeaps defaultValue{};
|
|
6523
6571
|
::wgpu::detail::AsNonConstReference(value.heapCount) = defaultValue.heapCount;
|
|
@@ -6664,10 +6712,7 @@ DrmFormatCapabilities::DrmFormatCapabilities(DrmFormatCapabilities::Init&& init)
|
|
|
6664
6712
|
propertiesCount(std::move(init.propertiesCount)),
|
|
6665
6713
|
properties(std::move(init.properties)){}
|
|
6666
6714
|
DrmFormatCapabilities::~DrmFormatCapabilities() {
|
|
6667
|
-
|
|
6668
|
-
wgpuDrmFormatCapabilitiesFreeMembers(
|
|
6669
|
-
*reinterpret_cast<WGPUDrmFormatCapabilities*>(this));
|
|
6670
|
-
}
|
|
6715
|
+
FreeMembers();
|
|
6671
6716
|
}
|
|
6672
6717
|
|
|
6673
6718
|
DrmFormatCapabilities::DrmFormatCapabilities(DrmFormatCapabilities&& rhs)
|
|
@@ -6680,14 +6725,21 @@ DrmFormatCapabilities& DrmFormatCapabilities::operator=(DrmFormatCapabilities&&
|
|
|
6680
6725
|
if (&rhs == this) {
|
|
6681
6726
|
return *this;
|
|
6682
6727
|
}
|
|
6683
|
-
|
|
6728
|
+
FreeMembers();
|
|
6684
6729
|
::wgpu::detail::AsNonConstReference(this->propertiesCount) = std::move(rhs.propertiesCount);
|
|
6685
6730
|
::wgpu::detail::AsNonConstReference(this->properties) = std::move(rhs.properties);
|
|
6686
6731
|
Reset(rhs);
|
|
6687
6732
|
return *this;
|
|
6688
6733
|
}
|
|
6689
6734
|
|
|
6690
|
-
|
|
6735
|
+
void DrmFormatCapabilities::FreeMembers() {
|
|
6736
|
+
if (this->properties != nullptr) {
|
|
6737
|
+
wgpuDrmFormatCapabilitiesFreeMembers(
|
|
6738
|
+
*reinterpret_cast<WGPUDrmFormatCapabilities*>(this));
|
|
6739
|
+
}
|
|
6740
|
+
}
|
|
6741
|
+
|
|
6742
|
+
// static
|
|
6691
6743
|
void DrmFormatCapabilities::Reset(DrmFormatCapabilities& value) {
|
|
6692
6744
|
DrmFormatCapabilities defaultValue{};
|
|
6693
6745
|
::wgpu::detail::AsNonConstReference(value.propertiesCount) = defaultValue.propertiesCount;
|
|
@@ -610,6 +610,12 @@ namespace wgpu {
|
|
|
610
610
|
case FeatureName::Float32Filterable:
|
|
611
611
|
o << "FeatureName::Float32Filterable";
|
|
612
612
|
break;
|
|
613
|
+
case FeatureName::Subgroups:
|
|
614
|
+
o << "FeatureName::Subgroups";
|
|
615
|
+
break;
|
|
616
|
+
case FeatureName::SubgroupsF16:
|
|
617
|
+
o << "FeatureName::SubgroupsF16";
|
|
618
|
+
break;
|
|
613
619
|
case FeatureName::DawnInternalUsages:
|
|
614
620
|
o << "FeatureName::DawnInternalUsages";
|
|
615
621
|
break;
|