@nativescript/canvas 2.0.0-beta.9 → 2.0.0-webgpu.1
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/Canvas/common.d.ts +24 -17
- package/Canvas/common.js +133 -66
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +5 -7
- package/Canvas/index.android.js +62 -133
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +4 -1
- package/Canvas/index.ios.d.ts +4 -5
- package/Canvas/index.ios.js +73 -82
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +8 -11
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.d.ts +14 -0
- package/Canvas2D/DOMMatrix/index.js +62 -0
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +4 -6
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/ImageAsset/index.d.ts +1 -0
- package/ImageAsset/index.js +49 -0
- package/ImageAsset/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
- package/WebGL/WebGLRenderingContext/index.js +86 -32
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
- package/WebGL2/WebGL2RenderingContext/index.js +2 -3
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.d.ts +36 -0
- package/WebGPU/Constants.js +42 -0
- package/WebGPU/Constants.js.map +1 -0
- package/WebGPU/Errors.d.ts +18 -0
- package/WebGPU/Errors.js +21 -0
- package/WebGPU/Errors.js.map +1 -0
- package/WebGPU/GPU.d.ts +13 -0
- package/WebGPU/GPU.js +35 -0
- package/WebGPU/GPU.js.map +1 -0
- package/WebGPU/GPUAdapter.d.ts +23 -0
- package/WebGPU/GPUAdapter.js +62 -0
- package/WebGPU/GPUAdapter.js.map +1 -0
- package/WebGPU/GPUAdapterInfo.d.ts +9 -0
- package/WebGPU/GPUAdapterInfo.js +24 -0
- package/WebGPU/GPUAdapterInfo.js.map +1 -0
- package/WebGPU/GPUBindGroup.d.ts +5 -0
- package/WebGPU/GPUBindGroup.js +12 -0
- package/WebGPU/GPUBindGroup.js.map +1 -0
- package/WebGPU/GPUBindGroupLayout.d.ts +5 -0
- package/WebGPU/GPUBindGroupLayout.js +12 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -0
- package/WebGPU/GPUBuffer.d.ts +15 -0
- package/WebGPU/GPUBuffer.js +54 -0
- package/WebGPU/GPUBuffer.js.map +1 -0
- package/WebGPU/GPUCanvasContext.d.ts +35 -0
- package/WebGPU/GPUCanvasContext.js +76 -0
- package/WebGPU/GPUCanvasContext.js.map +1 -0
- package/WebGPU/GPUCommandBuffer.d.ts +5 -0
- package/WebGPU/GPUCommandBuffer.js +12 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -0
- package/WebGPU/GPUCommandEncoder.d.ts +41 -0
- package/WebGPU/GPUCommandEncoder.js +110 -0
- package/WebGPU/GPUCommandEncoder.js.map +1 -0
- package/WebGPU/GPUComputePassEncoder.d.ts +16 -0
- package/WebGPU/GPUComputePassEncoder.js +50 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -0
- package/WebGPU/GPUComputePipeline.d.ts +7 -0
- package/WebGPU/GPUComputePipeline.js +16 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -0
- package/WebGPU/GPUDevice.d.ts +173 -0
- package/WebGPU/GPUDevice.js +356 -0
- package/WebGPU/GPUDevice.js.map +1 -0
- package/WebGPU/GPUDeviceLostInfo.d.ts +1 -0
- package/WebGPU/GPUDeviceLostInfo.js +10 -0
- package/WebGPU/GPUDeviceLostInfo.js.map +1 -0
- package/WebGPU/GPUExternalTexture.d.ts +5 -0
- package/WebGPU/GPUExternalTexture.js +12 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -0
- package/WebGPU/GPUPipelineLayout.d.ts +5 -0
- package/WebGPU/GPUPipelineLayout.js +12 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -0
- package/WebGPU/GPUQuerySet.d.ts +5 -0
- package/WebGPU/GPUQuerySet.js +12 -0
- package/WebGPU/GPUQuerySet.js.map +1 -0
- package/WebGPU/GPUQueue.d.ts +14 -0
- package/WebGPU/GPUQueue.js +77 -0
- package/WebGPU/GPUQueue.js.map +1 -0
- package/WebGPU/GPURenderBundle.d.ts +5 -0
- package/WebGPU/GPURenderBundle.js +12 -0
- package/WebGPU/GPURenderBundle.js.map +1 -0
- package/WebGPU/GPURenderBundleEncoder.d.ts +20 -0
- package/WebGPU/GPURenderBundleEncoder.js +61 -0
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
- package/WebGPU/GPURenderPassEncoder.d.ts +29 -0
- package/WebGPU/GPURenderPassEncoder.js +94 -0
- package/WebGPU/GPURenderPassEncoder.js.map +1 -0
- package/WebGPU/GPURenderPipeline.d.ts +7 -0
- package/WebGPU/GPURenderPipeline.js +16 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -0
- package/WebGPU/GPUSampler.d.ts +5 -0
- package/WebGPU/GPUSampler.js +12 -0
- package/WebGPU/GPUSampler.js.map +1 -0
- package/WebGPU/GPUShaderModule.d.ts +6 -0
- package/WebGPU/GPUShaderModule.js +15 -0
- package/WebGPU/GPUShaderModule.js.map +1 -0
- package/WebGPU/GPUTexture.d.ts +17 -0
- package/WebGPU/GPUTexture.js +44 -0
- package/WebGPU/GPUTexture.js.map +1 -0
- package/WebGPU/GPUTextureView.d.ts +5 -0
- package/WebGPU/GPUTextureView.js +12 -0
- package/WebGPU/GPUTextureView.js.map +1 -0
- package/WebGPU/Interfaces.d.ts +155 -0
- package/WebGPU/Interfaces.js +2 -0
- package/WebGPU/Interfaces.js.map +1 -0
- package/WebGPU/Types.d.ts +39 -0
- package/WebGPU/Types.js +2 -0
- package/WebGPU/Types.js.map +1 -0
- package/WebGPU/Utils.d.ts +1 -0
- package/WebGPU/Utils.js +75 -0
- package/WebGPU/Utils.js.map +1 -0
- package/WebGPU/index.d.ts +28 -0
- package/WebGPU/index.js +29 -0
- package/WebGPU/index.js.map +1 -0
- package/common.d.ts +0 -3
- package/common.js +1 -5
- package/common.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +22 -1
- package/index.js.map +1 -1
- package/package.json +1 -4
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +23 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +41 -8
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2318 -103
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1563 -3729
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +602 -663
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +46 -46
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +41 -8
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2318 -103
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1563 -3729
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1563 -3729
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +31 -31
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +604 -662
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +638 -641
- package/platforms/ios/build.xcconfig +3 -1
- package/platforms/ios/src/cpp/Caches.h +69 -1
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +320 -395
- package/platforms/ios/src/cpp/CanvasJSIModule.h +7 -1
- package/platforms/ios/src/cpp/Helpers.h +43 -8
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +35 -37
- package/platforms/ios/src/cpp/ImageAssetImpl.h +14 -10
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +2 -2
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +1 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +0 -10
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +41 -4
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +409 -3
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +27 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +131 -149
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1766 -1659
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +302 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +63 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +174 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +58 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +229 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +59 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +317 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +54 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1222 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +69 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +260 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +62 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +84 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +2750 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +95 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +186 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +54 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +46 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +137 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +521 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +56 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +469 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +71 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +623 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +85 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +84 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +56 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +1304 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +288 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +360 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +75 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +245 -0
- package/SVG/Circle.d.ts +0 -11
- package/SVG/Circle.js +0 -21
- package/SVG/Circle.js.map +0 -1
- package/SVG/ClipPath.d.ts +0 -4
- package/SVG/ClipPath.js +0 -9
- package/SVG/ClipPath.js.map +0 -1
- package/SVG/Defs.d.ts +0 -4
- package/SVG/Defs.js +0 -9
- package/SVG/Defs.js.map +0 -1
- package/SVG/Ellipse.d.ts +0 -13
- package/SVG/Ellipse.js +0 -26
- package/SVG/Ellipse.js.map +0 -1
- package/SVG/G.d.ts +0 -7
- package/SVG/G.js +0 -9
- package/SVG/G.js.map +0 -1
- package/SVG/Image.d.ts +0 -11
- package/SVG/Image.js +0 -40
- package/SVG/Image.js.map +0 -1
- package/SVG/Line.d.ts +0 -13
- package/SVG/Line.js +0 -26
- package/SVG/Line.js.map +0 -1
- package/SVG/LinearGradient.d.ts +0 -10
- package/SVG/LinearGradient.js +0 -13
- package/SVG/LinearGradient.js.map +0 -1
- package/SVG/Path.d.ts +0 -7
- package/SVG/Path.js +0 -14
- package/SVG/Path.js.map +0 -1
- package/SVG/Pattern.d.ts +0 -4
- package/SVG/Pattern.js +0 -9
- package/SVG/Pattern.js.map +0 -1
- package/SVG/Polygon.d.ts +0 -7
- package/SVG/Polygon.js +0 -14
- package/SVG/Polygon.js.map +0 -1
- package/SVG/Polyline.d.ts +0 -7
- package/SVG/Polyline.js +0 -14
- package/SVG/Polyline.js.map +0 -1
- package/SVG/Rect.d.ts +0 -8
- package/SVG/Rect.js +0 -13
- package/SVG/Rect.js.map +0 -1
- package/SVG/SVG.d.ts +0 -32
- package/SVG/SVG.js +0 -204
- package/SVG/SVG.js.map +0 -1
- package/SVG/SVGItem.d.ts +0 -5
- package/SVG/SVGItem.js +0 -8
- package/SVG/SVGItem.js.map +0 -1
- package/SVG/Stop.d.ts +0 -5
- package/SVG/Stop.js +0 -9
- package/SVG/Stop.js.map +0 -1
- package/SVG/Symbol.d.ts +0 -4
- package/SVG/Symbol.js +0 -9
- package/SVG/Symbol.js.map +0 -1
- package/SVG/Text.d.ts +0 -14
- package/SVG/Text.js +0 -26
- package/SVG/Text.js.map +0 -1
- package/SVG/Use.d.ts +0 -4
- package/SVG/Use.js +0 -9
- package/SVG/Use.js.map +0 -1
- package/SVG/index.d.ts +0 -18
- package/SVG/index.js +0 -19
- package/SVG/index.js.map +0 -1
- package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
- package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
- package/platforms/ios/src/cpp/URLImpl.cpp +0 -464
- package/platforms/ios/src/cpp/URLImpl.h +0 -121
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Helpers } from '../helpers';
|
|
2
|
+
import { adapter_, contextPtr_, GPUTextureUsage, native_ } from './Constants';
|
|
3
|
+
import { GPUTexture } from './GPUTexture';
|
|
4
|
+
export class GPUCanvasContext {
|
|
5
|
+
constructor(context, contextOptions) {
|
|
6
|
+
let nativeContext = '0';
|
|
7
|
+
if (global.isAndroid) {
|
|
8
|
+
nativeContext = context.getNativeContext().toString();
|
|
9
|
+
}
|
|
10
|
+
if (global.isIOS) {
|
|
11
|
+
nativeContext = context.nativeContext.toString();
|
|
12
|
+
}
|
|
13
|
+
const ctxPtr = BigInt(nativeContext);
|
|
14
|
+
this[native_] = global.CanvasModule.createWebGPUContextWithPointer(ctxPtr);
|
|
15
|
+
this[contextPtr_] = context;
|
|
16
|
+
this._type = 'webgpu';
|
|
17
|
+
}
|
|
18
|
+
get context() {
|
|
19
|
+
return this[native_];
|
|
20
|
+
}
|
|
21
|
+
get contextPtr() {
|
|
22
|
+
return this[contextPtr_];
|
|
23
|
+
}
|
|
24
|
+
get native() {
|
|
25
|
+
return this[native_];
|
|
26
|
+
}
|
|
27
|
+
configure(options) {
|
|
28
|
+
const opts = {
|
|
29
|
+
usage: GPUTextureUsage.RENDER_ATTACHMENT,
|
|
30
|
+
colorSpace: 'srgb',
|
|
31
|
+
alphaMode: 'opaque',
|
|
32
|
+
presentMode: 'fifo',
|
|
33
|
+
...options,
|
|
34
|
+
};
|
|
35
|
+
if (__ANDROID__ || __IOS__) {
|
|
36
|
+
const capabilities = this.getCapabilities(options?.device?.[adapter_]);
|
|
37
|
+
if (!options.presentMode) {
|
|
38
|
+
opts.presentMode = capabilities.presentModes[0];
|
|
39
|
+
}
|
|
40
|
+
if (!options.alphaMode) {
|
|
41
|
+
opts.alphaMode = capabilities.alphaModes[0];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
opts.device = options?.device?.[native_];
|
|
45
|
+
this[native_].configure(opts);
|
|
46
|
+
}
|
|
47
|
+
unconfigure() {
|
|
48
|
+
this[native_].unconfigure();
|
|
49
|
+
}
|
|
50
|
+
getCurrentTexture() {
|
|
51
|
+
if (this._currentTexture) {
|
|
52
|
+
return this._currentTexture;
|
|
53
|
+
}
|
|
54
|
+
const texture = this[native_].getCurrentTexture();
|
|
55
|
+
// if (texture) {
|
|
56
|
+
// this._currentTexture = GPUTexture.fromNative(texture);
|
|
57
|
+
// } else {
|
|
58
|
+
// this._currentTexture = null;
|
|
59
|
+
// }
|
|
60
|
+
// return this._currentTexture;
|
|
61
|
+
return GPUTexture.fromNative(texture);
|
|
62
|
+
}
|
|
63
|
+
presentSurface(texture) {
|
|
64
|
+
if (this._currentTexture === texture) {
|
|
65
|
+
this._currentTexture = null;
|
|
66
|
+
}
|
|
67
|
+
this[native_].presentSurface(texture?.[native_]);
|
|
68
|
+
}
|
|
69
|
+
getCapabilities(adapter) {
|
|
70
|
+
return this[native_].getCapabilities(adapter[native_]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
(() => {
|
|
74
|
+
Helpers.initialize();
|
|
75
|
+
})();
|
|
76
|
+
//# sourceMappingURL=GPUCanvasContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GPUCanvasContext.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUCanvasContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,OAAO,gBAAgB;IAU5B,YAAY,OAAY,EAAE,cAAc;QACvC,IAAI,aAAa,GAAG,GAAG,CAAC;QACxB,IAAI,MAAM,CAAC,SAAS,EAAE;YACrB,aAAa,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC;SACtD;QAED,IAAI,MAAM,CAAC,KAAK,EAAE;YACjB,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;SACjD;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC;QAC3E,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,OAAsO;QAC/O,MAAM,IAAI,GAAG;YACZ,KAAK,EAAE,eAAe,CAAC,iBAAiB;YACxC,U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C,CAAC,CAAC;IAClD,CAAC;IAED,eAAe,CAAC,OAAmB;QAMlC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;CACD;AA/FA;IACC,OAAO,CAAC,UAAU,EAAE,CAAC;AACtB,CAAC,GAAA,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { native_ } from './Constants';
|
|
2
|
+
export class GPUCommandBuffer {
|
|
3
|
+
static fromNative(commandBuffer) {
|
|
4
|
+
if (commandBuffer) {
|
|
5
|
+
const ret = new GPUCommandBuffer();
|
|
6
|
+
ret[native_] = commandBuffer;
|
|
7
|
+
return ret;
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=GPUCommandBuffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GPUCommandBuffer.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUCommandBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,OAAO,gBAAgB;IAE5B,MAAM,CAAC,UAAU,CAAC,aAAa;QAC9B,IAAI,aAAa,EAAE;YAClB,MAAM,GAAG,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACnC,GAAG,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC;YAC7B,OAAO,GAAG,CAAC;SACX;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { native_ } from './Constants';
|
|
2
|
+
import { GPUBuffer } from './GPUBuffer';
|
|
3
|
+
import { GPUCommandBuffer } from './GPUCommandBuffer';
|
|
4
|
+
import { GPUComputePassEncoder } from './GPUComputePassEncoder';
|
|
5
|
+
import { GPUQuerySet } from './GPUQuerySet';
|
|
6
|
+
import { GPURenderPassEncoder } from './GPURenderPassEncoder';
|
|
7
|
+
import { GPUImageCopyBuffer, GPUImageCopyTexture, GPURenderPassColorAttachment, GPURenderPassDepthStencilAttachment, GPURenderPassTimestampWrites } from './Interfaces';
|
|
8
|
+
import { GPUExtent3D } from './Types';
|
|
9
|
+
export declare class GPUCommandEncoder {
|
|
10
|
+
[native_]: any;
|
|
11
|
+
static fromNative(encoder: any): GPUCommandEncoder;
|
|
12
|
+
beginComputePass(descriptor?: {
|
|
13
|
+
label?: string;
|
|
14
|
+
timestampWrites?: {
|
|
15
|
+
beginningOfPassWriteIndex: number;
|
|
16
|
+
endOfPassWriteIndex: number;
|
|
17
|
+
querySet: GPUQuerySet;
|
|
18
|
+
};
|
|
19
|
+
}): GPUComputePassEncoder;
|
|
20
|
+
beginRenderPass(descriptor: {
|
|
21
|
+
colorAttachments: (null | GPURenderPassColorAttachment)[];
|
|
22
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
23
|
+
label?: string;
|
|
24
|
+
maxDrawCount?: number;
|
|
25
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
26
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
27
|
+
}): GPURenderPassEncoder;
|
|
28
|
+
clearBuffer(buffer: GPUBuffer, offset?: number, size?: number): void;
|
|
29
|
+
copyBufferToBuffer(source: GPUBuffer, sourceOffset: number, destination: GPUBuffer, destinationOffset: number, size: number): void;
|
|
30
|
+
copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
|
|
31
|
+
copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D): void;
|
|
32
|
+
copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
|
|
33
|
+
finish(descriptor?: {
|
|
34
|
+
label?: string;
|
|
35
|
+
}): GPUCommandBuffer;
|
|
36
|
+
insertDebugMarker(markerLabel: string): void;
|
|
37
|
+
popDebugGroup(): void;
|
|
38
|
+
pushDebugGroup(groupLabel: string): void;
|
|
39
|
+
resolveQuerySet(querySet: GPUQuerySet, firstQuery: number, queryCount: number, destination: GPUBuffer, destinationOffset: number): void;
|
|
40
|
+
writeTimestamp(querySet: GPUQuerySet, queryIndex: number): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { native_ } from './Constants';
|
|
2
|
+
import { GPUCommandBuffer } from './GPUCommandBuffer';
|
|
3
|
+
import { GPUComputePassEncoder } from './GPUComputePassEncoder';
|
|
4
|
+
import { GPURenderPassEncoder } from './GPURenderPassEncoder';
|
|
5
|
+
export class GPUCommandEncoder {
|
|
6
|
+
static fromNative(encoder) {
|
|
7
|
+
if (encoder) {
|
|
8
|
+
const ret = new GPUCommandEncoder();
|
|
9
|
+
ret[native_] = encoder;
|
|
10
|
+
return ret;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
beginComputePass(descriptor) {
|
|
15
|
+
if (descriptor?.timestampWrites) {
|
|
16
|
+
descriptor.timestampWrites.querySet = descriptor.timestampWrites.querySet[native_];
|
|
17
|
+
}
|
|
18
|
+
return GPUComputePassEncoder.fromNative(this[native_].beginComputePass(descriptor));
|
|
19
|
+
}
|
|
20
|
+
beginRenderPass(descriptor) {
|
|
21
|
+
descriptor.colorAttachments = descriptor.colorAttachments.map((attachment) => {
|
|
22
|
+
if (Array.isArray(attachment.clearValue)) {
|
|
23
|
+
attachment.clearValue = { r: attachment.clearValue[0], g: attachment.clearValue[1], b: attachment.clearValue[2], a: attachment.clearValue[3] };
|
|
24
|
+
}
|
|
25
|
+
if (attachment.view) {
|
|
26
|
+
attachment.view = attachment.view[native_];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
/// ???
|
|
30
|
+
}
|
|
31
|
+
if (attachment.resolveTarget) {
|
|
32
|
+
attachment.resolveTarget = attachment.resolveTarget[native_];
|
|
33
|
+
}
|
|
34
|
+
return attachment;
|
|
35
|
+
});
|
|
36
|
+
if (descriptor?.depthStencilAttachment?.view?.[native_]) {
|
|
37
|
+
descriptor.depthStencilAttachment.view = descriptor.depthStencilAttachment.view[native_];
|
|
38
|
+
}
|
|
39
|
+
if (descriptor?.occlusionQuerySet) {
|
|
40
|
+
descriptor.occlusionQuerySet = descriptor.occlusionQuerySet[native_];
|
|
41
|
+
}
|
|
42
|
+
if (descriptor?.timestampWrites?.querySet) {
|
|
43
|
+
descriptor.timestampWrites.querySet = descriptor.timestampWrites.querySet[native_];
|
|
44
|
+
}
|
|
45
|
+
const passEncoder = this[native_].beginRenderPass(descriptor);
|
|
46
|
+
return GPURenderPassEncoder.fromNative(passEncoder);
|
|
47
|
+
}
|
|
48
|
+
clearBuffer(buffer, offset, size) {
|
|
49
|
+
this[native_].clearBuffer(buffer[native_], offset ?? -1, size ?? -1);
|
|
50
|
+
}
|
|
51
|
+
copyBufferToBuffer(source, sourceOffset, destination, destinationOffset, size) {
|
|
52
|
+
this[native_].copyBufferToBuffer(source[native_], sourceOffset, destination[native_], destinationOffset, size);
|
|
53
|
+
}
|
|
54
|
+
copyBufferToTexture(source, destination, copySize) {
|
|
55
|
+
source.buffer = source.buffer[native_];
|
|
56
|
+
destination.texture = destination.texture[native_];
|
|
57
|
+
if (Array.isArray(copySize)) {
|
|
58
|
+
copySize = {
|
|
59
|
+
width: copySize[0],
|
|
60
|
+
height: copySize[1] ?? 1,
|
|
61
|
+
depthOrArrayLayers: copySize[2] ?? 1,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
this[native_].copyBufferToTexture(source, destination, copySize);
|
|
65
|
+
}
|
|
66
|
+
copyTextureToBuffer(source, destination, copySize) {
|
|
67
|
+
source.texture = source.texture[native_];
|
|
68
|
+
destination.buffer = destination.buffer[native_];
|
|
69
|
+
if (Array.isArray(copySize)) {
|
|
70
|
+
copySize = {
|
|
71
|
+
width: copySize[0],
|
|
72
|
+
height: copySize[1] ?? 1,
|
|
73
|
+
depthOrArrayLayers: copySize[2] ?? 1,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
this[native_].copyTextureToBuffer(source, destination, copySize);
|
|
77
|
+
}
|
|
78
|
+
copyTextureToTexture(source, destination, copySize) {
|
|
79
|
+
source.texture = source.texture[native_];
|
|
80
|
+
destination.texture = destination.texture[native_];
|
|
81
|
+
if (Array.isArray(copySize)) {
|
|
82
|
+
copySize = {
|
|
83
|
+
width: copySize[0],
|
|
84
|
+
height: copySize[1] ?? 1,
|
|
85
|
+
depthOrArrayLayers: copySize[2] ?? 1,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
this[native_].copyTextureToTexture(source, destination, copySize);
|
|
89
|
+
}
|
|
90
|
+
finish(descriptor) {
|
|
91
|
+
const ret = this[native_].finish(descriptor);
|
|
92
|
+
return GPUCommandBuffer.fromNative(ret);
|
|
93
|
+
}
|
|
94
|
+
insertDebugMarker(markerLabel) {
|
|
95
|
+
this[native_].insertDebugMarker(markerLabel);
|
|
96
|
+
}
|
|
97
|
+
popDebugGroup() {
|
|
98
|
+
this[native_].popDebugGroup();
|
|
99
|
+
}
|
|
100
|
+
pushDebugGroup(groupLabel) {
|
|
101
|
+
this[native_].pushDebugGroup(groupLabel);
|
|
102
|
+
}
|
|
103
|
+
resolveQuerySet(querySet, firstQuery, queryCount, destination, destinationOffset) {
|
|
104
|
+
this[native_].resolveQuerySet(querySet[native_], firstQuery, queryCount, destination[native_], destinationOffset);
|
|
105
|
+
}
|
|
106
|
+
writeTimestamp(querySet, queryIndex) {
|
|
107
|
+
this[native_].writeTimestamp(querySet[native_], queryIndex);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=GPUCommandEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GPUCommandEncoder.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUCommandEncoder.ts"],"names":[],"mappings":"AAAA,OAA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AAC;IAED,cAAc,CAAC,QAAqB,EAAE,UAAkB;QACvD,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;CACD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { native_ } from './Constants';
|
|
2
|
+
import { GPUBindGroup } from './GPUBindGroup';
|
|
3
|
+
import { GPUBuffer } from './GPUBuffer';
|
|
4
|
+
import { GPUComputePipeline } from './GPUComputePipeline';
|
|
5
|
+
export declare class GPUComputePassEncoder {
|
|
6
|
+
[native_]: any;
|
|
7
|
+
dispatchWorkgroups(workgroupCountX: number, workgroupCountY?: number, workgroupCountZ?: number): void;
|
|
8
|
+
dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;
|
|
9
|
+
end(): void;
|
|
10
|
+
insertDebugMarker(markerLabel: string): void;
|
|
11
|
+
popDebugGroup(): void;
|
|
12
|
+
pushDebugGroup(groupLabel: string): void;
|
|
13
|
+
setBindGroup(index: number, bindGroup: GPUBindGroup, dynamicOffsetsData?: number[] | Uint32Array, dynamicOffsetsDataStart?: number, dynamicOffsetsDataLength?: number): void;
|
|
14
|
+
setPipeline(renderPipeline: GPUComputePipeline): void;
|
|
15
|
+
static fromNative(pass: any): GPUComputePassEncoder;
|
|
16
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { native_ } from './Constants';
|
|
2
|
+
export class GPUComputePassEncoder {
|
|
3
|
+
dispatchWorkgroups(workgroupCountX, workgroupCountY = 1, workgroupCountZ = 1) {
|
|
4
|
+
this[native_].dispatchWorkgroups(workgroupCountX, workgroupCountY ?? 1, workgroupCountZ ?? 1);
|
|
5
|
+
}
|
|
6
|
+
dispatchWorkgroupsIndirect(indirectBuffer, indirectOffset) {
|
|
7
|
+
this[native_].dispatchWorkgroupsIndirect(indirectBuffer[native_], indirectOffset);
|
|
8
|
+
}
|
|
9
|
+
end() {
|
|
10
|
+
this[native_].end();
|
|
11
|
+
this[native_] = null;
|
|
12
|
+
}
|
|
13
|
+
insertDebugMarker(markerLabel) {
|
|
14
|
+
this[native_].insertDebugMarker(markerLabel);
|
|
15
|
+
}
|
|
16
|
+
popDebugGroup() {
|
|
17
|
+
this[native_].popDebugGroup();
|
|
18
|
+
}
|
|
19
|
+
pushDebugGroup(groupLabel) {
|
|
20
|
+
this[native_].pushDebugGroup(groupLabel);
|
|
21
|
+
}
|
|
22
|
+
setBindGroup(index, bindGroup, dynamicOffsetsData, dynamicOffsetsDataStart, dynamicOffsetsDataLength) {
|
|
23
|
+
const group = bindGroup?.[native_];
|
|
24
|
+
if (!group) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(dynamicOffsetsData)) {
|
|
28
|
+
const data = new Uint32Array(dynamicOffsetsData);
|
|
29
|
+
this[native_].setBindGroup(index, group, data, 0, data.length);
|
|
30
|
+
}
|
|
31
|
+
else if (dynamicOffsetsData instanceof Uint32Array) {
|
|
32
|
+
this[native_].setBindGroup(index, group, dynamicOffsetsData, dynamicOffsetsDataStart, dynamicOffsetsDataLength);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this[native_].setBindGroup(index, group);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
setPipeline(renderPipeline) {
|
|
39
|
+
this[native_].setPipeline(renderPipeline[native_]);
|
|
40
|
+
}
|
|
41
|
+
static fromNative(pass) {
|
|
42
|
+
if (pass) {
|
|
43
|
+
const ret = new GPUComputePassEncoder();
|
|
44
|
+
ret[native_] = pass;
|
|
45
|
+
return ret;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=GPUComputePassEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GPUComputePassEncoder.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUComputePassEnc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EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SAC/D;aAAM,IAAI,kBAAkB,YAAY,WAAW,EAAE;YACrD,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,wBAAwB,CAAC,CAAC;SAChH;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACzC;IACF,CAAC;IAED,WAAW,CAAC,cAAkC;QAC7C,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,IAAI;QACrB,IAAI,IAAI,EAAE;YACT,MAAM,GAAG,GAAG,IAAI,qBAAqB,EAAE,CAAC;YACxC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YACpB,OAAO,GAAG,CAAC;SACX;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { native_ } from './Constants';
|
|
2
|
+
import { GPUBindGroupLayout } from './GPUBindGroupLayout';
|
|
3
|
+
export declare class GPUComputePipeline {
|
|
4
|
+
[native_]: any;
|
|
5
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
6
|
+
static fromNative(pipeline: any): GPUComputePipeline;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { native_ } from './Constants';
|
|
2
|
+
import { GPUBindGroupLayout } from './GPUBindGroupLayout';
|
|
3
|
+
export class GPUComputePipeline {
|
|
4
|
+
getBindGroupLayout(index) {
|
|
5
|
+
return GPUBindGroupLayout.fromNative(this[native_].getBindGroupLayout(index));
|
|
6
|
+
}
|
|
7
|
+
static fromNative(pipeline) {
|
|
8
|
+
if (pipeline) {
|
|
9
|
+
const ret = new GPUComputePipeline();
|
|
10
|
+
ret[native_] = pipeline;
|
|
11
|
+
return ret;
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=GPUComputePipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GPUComputePipeline.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUComputePipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,kBAAkB;IAG9B,kBAAkB,CAAC,KAAa;QAC/B,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ;QACzB,IAAI,QAAQ,EAAE;YACb,MAAM,GAAG,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACrC,GAAG,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;YACxB,OAAO,GAAG,CAAC;SACX;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Observable } from '@nativescript/core';
|
|
2
|
+
import { GPUBuffer } from './GPUBuffer';
|
|
3
|
+
import { GPUTexture } from './GPUTexture';
|
|
4
|
+
import { native_ } from './Constants';
|
|
5
|
+
import { GPUShaderModule } from './GPUShaderModule';
|
|
6
|
+
import { GPUQueue } from './GPUQueue';
|
|
7
|
+
import { GPUPipelineLayout } from './GPUPipelineLayout';
|
|
8
|
+
import { GPURenderPipeline } from './GPURenderPipeline';
|
|
9
|
+
import { GPUCommandEncoder } from './GPUCommandEncoder';
|
|
10
|
+
import { GPUDeviceLostInfo } from './Errors';
|
|
11
|
+
import { GPUBindGroup } from './GPUBindGroup';
|
|
12
|
+
import { GPUBindGroupLayout } from './GPUBindGroupLayout';
|
|
13
|
+
import { GPUTextureView } from './GPUTextureView';
|
|
14
|
+
import { GPUSampler } from './GPUSampler';
|
|
15
|
+
import { GPUExternalTexture } from './GPUExternalTexture';
|
|
16
|
+
import type { GPUAddressMode, GPUCompareFunction, GPUErrorFilter, GPUFilterMode, GPUMipmapFilterMode, GPUQueryType, GPUTextureFormat, GPUTextureSampleType, GPUTextureViewDimension } from './Types';
|
|
17
|
+
import type { GPUDepthStencilState, GPUExternalTextureBindingLayout, GPUFragmentState, GPUMultisampleState, GPUPrimitiveState, GPUProgrammableStage, GPUVertexState } from './Interfaces';
|
|
18
|
+
import { GPUComputePipeline } from './GPUComputePipeline';
|
|
19
|
+
import { GPUQuerySet } from './GPUQuerySet';
|
|
20
|
+
import { GPURenderBundleEncoder } from './GPURenderBundleEncoder';
|
|
21
|
+
import { GPUAdapter } from './GPUAdapter';
|
|
22
|
+
export declare class EventTarget {
|
|
23
|
+
_emitter?: WeakRef<Observable>;
|
|
24
|
+
addEventListener(event: string, handler: any, options?: AddEventListenerOptions): void;
|
|
25
|
+
removeEventListener(event: string, handler?: any): void;
|
|
26
|
+
dispatchEvent(event: any): void;
|
|
27
|
+
}
|
|
28
|
+
interface GPUExtent3DDict {
|
|
29
|
+
width: number;
|
|
30
|
+
height?: number;
|
|
31
|
+
depthOrArrayLayers?: number;
|
|
32
|
+
}
|
|
33
|
+
declare type GPUExtent3D = [number, number, number] | [number, number] | GPUExtent3DDict;
|
|
34
|
+
export declare class GPUDevice extends EventTarget {
|
|
35
|
+
[native_]: any;
|
|
36
|
+
label: string;
|
|
37
|
+
_lostPromise: Promise<GPUDeviceLostInfo>;
|
|
38
|
+
_observerable: Observable;
|
|
39
|
+
constructor();
|
|
40
|
+
private _uncapturederror;
|
|
41
|
+
static fromNative(device: any, adapter: GPUAdapter): GPUDevice;
|
|
42
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
43
|
+
get native(): any;
|
|
44
|
+
get limits(): any;
|
|
45
|
+
get features(): any;
|
|
46
|
+
destroy(): void;
|
|
47
|
+
createBindGroup(descriptor: {
|
|
48
|
+
label?: string;
|
|
49
|
+
layout: GPUBindGroupLayout;
|
|
50
|
+
entries: {
|
|
51
|
+
binding: number;
|
|
52
|
+
resource: GPUTextureView | GPUSampler | GPUExternalTexture | {
|
|
53
|
+
buffer: GPUBuffer;
|
|
54
|
+
offset?: number;
|
|
55
|
+
size?: number;
|
|
56
|
+
};
|
|
57
|
+
}[];
|
|
58
|
+
}): GPUBindGroup;
|
|
59
|
+
createBindGroupLayout(descriptor: {
|
|
60
|
+
label?: string;
|
|
61
|
+
entries: {
|
|
62
|
+
binding: number;
|
|
63
|
+
visibility: number;
|
|
64
|
+
buffer?: {
|
|
65
|
+
hasDynamicOffset?: boolean;
|
|
66
|
+
minBindingSize?: number;
|
|
67
|
+
type?: 'uniform' | 'storage' | 'read-only-storage';
|
|
68
|
+
};
|
|
69
|
+
externalTexture?: GPUExternalTextureBindingLayout;
|
|
70
|
+
sampler?: {
|
|
71
|
+
type?: 'filtering' | 'non-filtering' | 'comparison';
|
|
72
|
+
};
|
|
73
|
+
storageTexture?: {
|
|
74
|
+
access?: 'write-only' | 'read-only' | 'read-write';
|
|
75
|
+
format: GPUTextureFormat;
|
|
76
|
+
viewDimension?: GPUTextureViewDimension;
|
|
77
|
+
};
|
|
78
|
+
texture?: {
|
|
79
|
+
multisampled?: boolean;
|
|
80
|
+
sampleType?: GPUTextureSampleType;
|
|
81
|
+
viewDimension?: GPUTextureViewDimension;
|
|
82
|
+
};
|
|
83
|
+
}[];
|
|
84
|
+
}): GPUBindGroupLayout;
|
|
85
|
+
createBuffer(descriptor: {
|
|
86
|
+
label?: string;
|
|
87
|
+
mappedAtCreation?: boolean;
|
|
88
|
+
size: number;
|
|
89
|
+
usage: number;
|
|
90
|
+
}): GPUBuffer;
|
|
91
|
+
createCommandEncoder(descriptor?: {
|
|
92
|
+
label?: string;
|
|
93
|
+
}): GPUCommandEncoder;
|
|
94
|
+
createComputePipeline(descriptor: {
|
|
95
|
+
compute: GPUProgrammableStage;
|
|
96
|
+
label?: string;
|
|
97
|
+
layout: GPUPipelineLayout | 'auto';
|
|
98
|
+
}): GPUComputePipeline;
|
|
99
|
+
createComputePipelineAsync(descriptor: {
|
|
100
|
+
compute: GPUProgrammableStage;
|
|
101
|
+
label?: string;
|
|
102
|
+
layout: GPUPipelineLayout | 'auto';
|
|
103
|
+
}): Promise<unknown>;
|
|
104
|
+
createPipelineLayout(descriptor: {
|
|
105
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
106
|
+
label?: string;
|
|
107
|
+
}): GPUPipelineLayout;
|
|
108
|
+
createQuerySet(descriptor: {
|
|
109
|
+
count: number;
|
|
110
|
+
label?: string;
|
|
111
|
+
type: GPUQueryType;
|
|
112
|
+
}): GPUQuerySet;
|
|
113
|
+
createRenderBundleEncoder(descriptor: {
|
|
114
|
+
colorFormats: (null | GPUTextureFormat)[];
|
|
115
|
+
depthReadOnly?: boolean;
|
|
116
|
+
depthStencilFormat?: GPUTextureFormat;
|
|
117
|
+
label?: string;
|
|
118
|
+
sampleCount?: number;
|
|
119
|
+
stencilReadOnly?: boolean;
|
|
120
|
+
}): GPURenderBundleEncoder;
|
|
121
|
+
createRenderPipeline(descriptor: {
|
|
122
|
+
depthStencil?: GPUDepthStencilState;
|
|
123
|
+
fragment?: GPUFragmentState;
|
|
124
|
+
label?: string;
|
|
125
|
+
layout: GPUPipelineLayout | 'auto';
|
|
126
|
+
multisample?: GPUMultisampleState;
|
|
127
|
+
primitive?: GPUPrimitiveState;
|
|
128
|
+
vertex: GPUVertexState;
|
|
129
|
+
}): GPURenderPipeline;
|
|
130
|
+
createRenderPipelineAsync(descriptor: {
|
|
131
|
+
depthStencil?: GPUDepthStencilState;
|
|
132
|
+
fragment?: GPUFragmentState;
|
|
133
|
+
label?: string;
|
|
134
|
+
layout: GPUPipelineLayout | 'auto';
|
|
135
|
+
multisample?: GPUMultisampleState;
|
|
136
|
+
primitive?: GPUPrimitiveState;
|
|
137
|
+
vertex: GPUVertexState;
|
|
138
|
+
}): Promise<unknown>;
|
|
139
|
+
createSampler(descriptor?: {
|
|
140
|
+
addressModeU?: GPUAddressMode;
|
|
141
|
+
addressModeV?: GPUAddressMode;
|
|
142
|
+
addressModeW?: GPUAddressMode;
|
|
143
|
+
compare?: GPUCompareFunction;
|
|
144
|
+
label?: string;
|
|
145
|
+
lodMaxClamp?: number;
|
|
146
|
+
lodMinClamp?: number;
|
|
147
|
+
magFilter?: GPUFilterMode;
|
|
148
|
+
maxAnisotropy?: number;
|
|
149
|
+
minFilter?: GPUFilterMode;
|
|
150
|
+
mipmapFilter?: GPUMipmapFilterMode;
|
|
151
|
+
}): GPUSampler;
|
|
152
|
+
createShaderModule(desc: {
|
|
153
|
+
label?: string;
|
|
154
|
+
code: string;
|
|
155
|
+
sourceMap?: object;
|
|
156
|
+
compilationHints?: any[];
|
|
157
|
+
}): GPUShaderModule;
|
|
158
|
+
createTexture(descriptor: {
|
|
159
|
+
label?: string;
|
|
160
|
+
size: GPUExtent3D;
|
|
161
|
+
mipLevelCount?: number;
|
|
162
|
+
sampleCount?: number;
|
|
163
|
+
dimension?: '1d' | '2d' | '3d';
|
|
164
|
+
format: any;
|
|
165
|
+
usage: any;
|
|
166
|
+
viewFormats?: any[];
|
|
167
|
+
}): GPUTexture;
|
|
168
|
+
popErrorScope(): Promise<unknown>;
|
|
169
|
+
pushErrorScope(filter: GPUErrorFilter): void;
|
|
170
|
+
private _queue;
|
|
171
|
+
get queue(): GPUQueue;
|
|
172
|
+
}
|
|
173
|
+
export {};
|