@nativescript/canvas 2.0.0-webgpu.4 → 2.0.0-webgpu.41
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 +5 -10
- package/Canvas/common.js +61 -144
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +6 -5
- package/Canvas/index.android.js +63 -42
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +13 -3
- package/Canvas/index.ios.d.ts +9 -1
- package/Canvas/index.ios.js +117 -66
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas/utils.d.ts +3 -0
- package/Canvas/utils.js +85 -0
- package/Canvas/utils.js.map +1 -0
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +3 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +2 -4
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Dom/Group.d.ts +1 -2
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.js +0 -1
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.d.ts +1 -1
- package/Dom/shapes/Path.d.ts +1 -1
- package/ImageAsset/index.d.ts +4 -2
- package/ImageAsset/index.js +151 -37
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +107 -20
- package/ImageBitmap/index.js.map +1 -1
- package/README.md +2 -4
- package/WebGL/WebGLRenderingContext/common.d.ts +1 -1
- package/WebGL/WebGLRenderingContext/index.js +76 -32
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js +5 -5
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/GPU.js +4 -3
- package/WebGPU/GPU.js.map +1 -1
- package/WebGPU/GPUAdapter.d.ts +6 -3
- package/WebGPU/GPUAdapter.js +31 -0
- package/WebGPU/GPUAdapter.js.map +1 -1
- package/WebGPU/GPUBindGroup.d.ts +1 -0
- package/WebGPU/GPUBindGroup.js +3 -0
- package/WebGPU/GPUBindGroup.js.map +1 -1
- package/WebGPU/GPUBindGroupLayout.d.ts +1 -0
- package/WebGPU/GPUBindGroupLayout.js +3 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -1
- package/WebGPU/GPUBuffer.js +10 -2
- package/WebGPU/GPUBuffer.js.map +1 -1
- package/WebGPU/GPUCanvasContext.d.ts +5 -3
- package/WebGPU/GPUCanvasContext.js +52 -10
- package/WebGPU/GPUCanvasContext.js.map +1 -1
- package/WebGPU/GPUCommandBuffer.d.ts +1 -0
- package/WebGPU/GPUCommandBuffer.js +3 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -1
- package/WebGPU/GPUCommandEncoder.d.ts +3 -9
- package/WebGPU/GPUCommandEncoder.js +94 -41
- package/WebGPU/GPUCommandEncoder.js.map +1 -1
- package/WebGPU/GPUComputePassEncoder.d.ts +1 -0
- package/WebGPU/GPUComputePassEncoder.js +3 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -1
- package/WebGPU/GPUComputePipeline.d.ts +1 -0
- package/WebGPU/GPUComputePipeline.js +3 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -1
- package/WebGPU/GPUDevice.d.ts +17 -79
- package/WebGPU/GPUDevice.js +75 -91
- package/WebGPU/GPUDevice.js.map +1 -1
- package/WebGPU/GPUExternalTexture.d.ts +1 -0
- package/WebGPU/GPUExternalTexture.js +3 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -1
- package/WebGPU/GPUPipelineLayout.d.ts +1 -0
- package/WebGPU/GPUPipelineLayout.js +3 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -1
- package/WebGPU/GPUQuerySet.d.ts +1 -0
- package/WebGPU/GPUQuerySet.js +3 -0
- package/WebGPU/GPUQuerySet.js.map +1 -1
- package/WebGPU/GPUQueue.d.ts +1 -0
- package/WebGPU/GPUQueue.js +65 -14
- package/WebGPU/GPUQueue.js.map +1 -1
- package/WebGPU/GPURenderBundle.d.ts +1 -0
- package/WebGPU/GPURenderBundle.js +3 -0
- package/WebGPU/GPURenderBundle.js.map +1 -1
- package/WebGPU/GPURenderBundleEncoder.d.ts +4 -2
- package/WebGPU/GPURenderBundleEncoder.js +7 -3
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
- package/WebGPU/GPURenderPassEncoder.d.ts +5 -1
- package/WebGPU/GPURenderPassEncoder.js +14 -2
- package/WebGPU/GPURenderPassEncoder.js.map +1 -1
- package/WebGPU/GPURenderPipeline.d.ts +1 -0
- package/WebGPU/GPURenderPipeline.js +3 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -1
- package/WebGPU/GPUSampler.d.ts +1 -0
- package/WebGPU/GPUSampler.js +3 -0
- package/WebGPU/GPUSampler.js.map +1 -1
- package/WebGPU/GPUShaderModule.d.ts +1 -1
- package/WebGPU/GPUShaderModule.js +2 -2
- package/WebGPU/GPUShaderModule.js.map +1 -1
- package/WebGPU/GPUTexture.d.ts +1 -0
- package/WebGPU/GPUTexture.js +3 -0
- package/WebGPU/GPUTexture.js.map +1 -1
- package/WebGPU/GPUTextureView.d.ts +1 -0
- package/WebGPU/GPUTextureView.js +3 -0
- package/WebGPU/GPUTextureView.js.map +1 -1
- package/WebGPU/Interfaces.d.ts +95 -4
- package/WebGPU/Types.d.ts +9 -1
- package/WebGPU/Utils.d.ts +6 -0
- package/WebGPU/Utils.js +226 -0
- package/WebGPU/Utils.js.map +1 -1
- package/angular/esm2022/index.mjs +4 -4
- package/angular/fesm2022/nativescript-canvas-angular.mjs +4 -4
- package/angular/fesm2022/nativescript-canvas-angular.mjs.map +1 -1
- package/common.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +3 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- 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 +61 -30
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +144 -176
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +342 -72
- 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 +1928 -630
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +85 -23
- 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 +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
- 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 +681 -644
- 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 +122 -60
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +144 -176
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +342 -72
- 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 +1928 -630
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +85 -23
- 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 +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1928 -630
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +85 -23
- 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 +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +40 -29
- 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 +683 -646
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +736 -684
- package/platforms/ios/src/NSOperationQueueWrapper.h +1 -1
- package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
- package/platforms/ios/src/cpp/AsyncCallback.h +16 -8
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +310 -801
- package/platforms/ios/src/cpp/CanvasJSIModule.h +2 -0
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +578 -413
- package/platforms/ios/src/cpp/ImageAssetImpl.h +7 -3
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +60 -3
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +10 -3
- package/platforms/ios/src/cpp/PromiseCallback.h +1 -2
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +7 -11
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +5 -5
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +106 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +6 -6
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +26 -23
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +31 -5
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +41 -7
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -5
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +28 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +75 -79
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +4 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +56 -23
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +25 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +2 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1606 -681
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +2 -1
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +3 -1
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -2
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +83 -14
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +66 -34
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +25 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +151 -52
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +7 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +25 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +24 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +34 -8
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +2 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
- package/utils.d.ts +1 -1
|
@@ -2,7 +2,11 @@ import { native_ } from './Constants';
|
|
|
2
2
|
import { GPUCommandBuffer } from './GPUCommandBuffer';
|
|
3
3
|
import { GPUComputePassEncoder } from './GPUComputePassEncoder';
|
|
4
4
|
import { GPURenderPassEncoder } from './GPURenderPassEncoder';
|
|
5
|
+
import { parseComputePassDescriptor, parseRenderPassDescriptor } from './Utils';
|
|
5
6
|
export class GPUCommandEncoder {
|
|
7
|
+
get label() {
|
|
8
|
+
return this[native_]?.label ?? '';
|
|
9
|
+
}
|
|
6
10
|
static fromNative(encoder) {
|
|
7
11
|
if (encoder) {
|
|
8
12
|
const ret = new GPUCommandEncoder();
|
|
@@ -12,37 +16,12 @@ export class GPUCommandEncoder {
|
|
|
12
16
|
return null;
|
|
13
17
|
}
|
|
14
18
|
beginComputePass(descriptor) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return GPUComputePassEncoder.fromNative(this[native_].beginComputePass(descriptor));
|
|
19
|
+
const desc = parseComputePassDescriptor(descriptor);
|
|
20
|
+
return GPUComputePassEncoder.fromNative(this[native_].beginComputePass(desc));
|
|
19
21
|
}
|
|
20
22
|
beginRenderPass(descriptor) {
|
|
21
|
-
|
|
22
|
-
|
|
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);
|
|
23
|
+
const desc = parseRenderPassDescriptor(descriptor);
|
|
24
|
+
const passEncoder = this[native_].beginRenderPass(desc);
|
|
46
25
|
return GPURenderPassEncoder.fromNative(passEncoder);
|
|
47
26
|
}
|
|
48
27
|
clearBuffer(buffer, offset, size) {
|
|
@@ -52,40 +31,114 @@ export class GPUCommandEncoder {
|
|
|
52
31
|
this[native_].copyBufferToBuffer(source[native_], sourceOffset, destination[native_], destinationOffset, size);
|
|
53
32
|
}
|
|
54
33
|
copyBufferToTexture(source, destination, copySize) {
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
const src = {
|
|
35
|
+
buffer: source.buffer[native_],
|
|
36
|
+
bytesPerRow: source.bytesPerRow,
|
|
37
|
+
};
|
|
38
|
+
if (typeof source.offset === 'number') {
|
|
39
|
+
src.offset = source.offset;
|
|
40
|
+
}
|
|
41
|
+
if (typeof source.rowsPerImage === 'number') {
|
|
42
|
+
src.rowsPerImage = source.rowsPerImage;
|
|
43
|
+
}
|
|
44
|
+
const dst = {
|
|
45
|
+
texture: destination.texture[native_],
|
|
46
|
+
};
|
|
47
|
+
if (destination.aspect) {
|
|
48
|
+
dst.aspect = destination.aspect;
|
|
49
|
+
}
|
|
50
|
+
if (typeof destination.mipLevel === 'number') {
|
|
51
|
+
dst.mipLevel = destination.mipLevel;
|
|
52
|
+
}
|
|
53
|
+
if (destination.origin) {
|
|
54
|
+
dst.origin = destination.origin;
|
|
55
|
+
}
|
|
56
|
+
let size;
|
|
57
57
|
if (Array.isArray(copySize)) {
|
|
58
|
-
|
|
58
|
+
size = {
|
|
59
59
|
width: copySize[0],
|
|
60
60
|
height: copySize[1] ?? 1,
|
|
61
61
|
depthOrArrayLayers: copySize[2] ?? 1,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
else {
|
|
65
|
+
size = { ...copySize };
|
|
66
|
+
}
|
|
67
|
+
this[native_].copyBufferToTexture(src, dst, size);
|
|
65
68
|
}
|
|
66
69
|
copyTextureToBuffer(source, destination, copySize) {
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
const src = {
|
|
71
|
+
texture: source.texture[native_],
|
|
72
|
+
};
|
|
73
|
+
if (source.aspect) {
|
|
74
|
+
src.aspect = source.aspect;
|
|
75
|
+
}
|
|
76
|
+
if (typeof source.mipLevel === 'number') {
|
|
77
|
+
src.mipLevel = source.mipLevel;
|
|
78
|
+
}
|
|
79
|
+
if (source.origin) {
|
|
80
|
+
src.origin = source.origin;
|
|
81
|
+
}
|
|
82
|
+
const dst = {
|
|
83
|
+
buffer: destination.buffer[native_],
|
|
84
|
+
bytesPerRow: destination.bytesPerRow,
|
|
85
|
+
};
|
|
86
|
+
if (typeof destination.offset === 'number') {
|
|
87
|
+
dst.offset = destination.offset;
|
|
88
|
+
}
|
|
89
|
+
if (typeof destination.rowsPerImage === 'number') {
|
|
90
|
+
dst.rowsPerImage = destination.rowsPerImage;
|
|
91
|
+
}
|
|
92
|
+
let size;
|
|
69
93
|
if (Array.isArray(copySize)) {
|
|
70
|
-
|
|
94
|
+
size = {
|
|
71
95
|
width: copySize[0],
|
|
72
96
|
height: copySize[1] ?? 1,
|
|
73
97
|
depthOrArrayLayers: copySize[2] ?? 1,
|
|
74
98
|
};
|
|
75
99
|
}
|
|
76
|
-
|
|
100
|
+
else {
|
|
101
|
+
size = { ...copySize };
|
|
102
|
+
}
|
|
103
|
+
this[native_].copyTextureToBuffer(src, dst, size);
|
|
77
104
|
}
|
|
78
105
|
copyTextureToTexture(source, destination, copySize) {
|
|
79
|
-
|
|
80
|
-
|
|
106
|
+
const src = {
|
|
107
|
+
texture: source.texture[native_],
|
|
108
|
+
};
|
|
109
|
+
if (source.aspect) {
|
|
110
|
+
src.aspect = source.aspect;
|
|
111
|
+
}
|
|
112
|
+
if (typeof source.mipLevel === 'number') {
|
|
113
|
+
src.mipLevel = source.mipLevel;
|
|
114
|
+
}
|
|
115
|
+
if (source.origin) {
|
|
116
|
+
src.origin = source.origin;
|
|
117
|
+
}
|
|
118
|
+
const dst = {
|
|
119
|
+
texture: destination.texture[native_],
|
|
120
|
+
};
|
|
121
|
+
if (destination.aspect) {
|
|
122
|
+
dst.aspect = destination.aspect;
|
|
123
|
+
}
|
|
124
|
+
if (typeof destination.mipLevel === 'number') {
|
|
125
|
+
dst.mipLevel = destination.mipLevel;
|
|
126
|
+
}
|
|
127
|
+
if (destination.origin) {
|
|
128
|
+
dst.origin = destination.origin;
|
|
129
|
+
}
|
|
130
|
+
let size;
|
|
81
131
|
if (Array.isArray(copySize)) {
|
|
82
|
-
|
|
132
|
+
size = {
|
|
83
133
|
width: copySize[0],
|
|
84
134
|
height: copySize[1] ?? 1,
|
|
85
135
|
depthOrArrayLayers: copySize[2] ?? 1,
|
|
86
136
|
};
|
|
87
137
|
}
|
|
88
|
-
|
|
138
|
+
else {
|
|
139
|
+
size = { ...copySize };
|
|
140
|
+
}
|
|
141
|
+
this[native_].copyTextureToTexture(src, dst, size);
|
|
89
142
|
}
|
|
90
143
|
finish(descriptor) {
|
|
91
144
|
const ret = this[native_].finish(descriptor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUCommandEncoder.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUCommandEncoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"GPUCommandEncoder.js","sourceRoot":"","sources":["../../../../packages/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WAAsB,EAAE,iBAAyB;QAC/H,IAAI,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC;IACnH,CAAC;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"}
|
|
@@ -4,6 +4,7 @@ import { GPUBuffer } from './GPUBuffer';
|
|
|
4
4
|
import { GPUComputePipeline } from './GPUComputePipeline';
|
|
5
5
|
export declare class GPUComputePassEncoder {
|
|
6
6
|
[native_]: any;
|
|
7
|
+
get label(): any;
|
|
7
8
|
dispatchWorkgroups(workgroupCountX: number, workgroupCountY?: number, workgroupCountZ?: number): void;
|
|
8
9
|
dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;
|
|
9
10
|
end(): void;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { native_ } from './Constants';
|
|
2
2
|
export class GPUComputePassEncoder {
|
|
3
|
+
get label() {
|
|
4
|
+
return this[native_]?.label ?? '';
|
|
5
|
+
}
|
|
3
6
|
dispatchWorkgroups(workgroupCountX, workgroupCountY = 1, workgroupCountZ = 1) {
|
|
4
7
|
this[native_].dispatchWorkgroups(workgroupCountX, workgroupCountY ?? 1, workgroupCountZ ?? 1);
|
|
5
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUComputePassEncoder.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUComputePassEncoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKtC,MAAM,OAAO,qBAAqB;IAGjC,kBAAkB,CAAC,eAAuB,EAAE,kBAA0B,CAAC,EAAE,kBA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AAC,OAAO,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,IAAI;QACrB,IAAI,IAAI,EAAE,CAAC;YACV,MAAM,GAAG,GAAG,IAAI,qBAAqB,EAAE,CAAC;YACxC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YACpB,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -2,6 +2,7 @@ import { native_ } from './Constants';
|
|
|
2
2
|
import { GPUBindGroupLayout } from './GPUBindGroupLayout';
|
|
3
3
|
export declare class GPUComputePipeline {
|
|
4
4
|
[native_]: any;
|
|
5
|
+
get label(): any;
|
|
5
6
|
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
6
7
|
static fromNative(pipeline: any): GPUComputePipeline;
|
|
7
8
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { native_ } from './Constants';
|
|
2
2
|
import { GPUBindGroupLayout } from './GPUBindGroupLayout';
|
|
3
3
|
export class GPUComputePipeline {
|
|
4
|
+
get label() {
|
|
5
|
+
return this[native_]?.label ?? '';
|
|
6
|
+
}
|
|
4
7
|
getBindGroupLayout(index) {
|
|
5
8
|
return GPUBindGroupLayout.fromNative(this[native_].getBindGroupLayout(index));
|
|
6
9
|
}
|
|
@@ -1 +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,CAAC;YACd,MAAM,GAAG,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACrC,GAAG,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;YACxB,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
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,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,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,CAAC;YACd,MAAM,GAAG,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACrC,GAAG,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;YACxB,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
package/WebGPU/GPUDevice.d.ts
CHANGED
|
@@ -10,17 +10,15 @@ import { GPUCommandEncoder } from './GPUCommandEncoder';
|
|
|
10
10
|
import { GPUDeviceLostInfo } from './Errors';
|
|
11
11
|
import { GPUBindGroup } from './GPUBindGroup';
|
|
12
12
|
import { GPUBindGroupLayout } from './GPUBindGroupLayout';
|
|
13
|
-
import { GPUTextureView } from './GPUTextureView';
|
|
14
13
|
import { GPUSampler } from './GPUSampler';
|
|
15
|
-
import {
|
|
16
|
-
import type {
|
|
17
|
-
import type { GPUDepthStencilState, GPUExternalTextureBindingLayout, GPUFragmentState, GPUMultisampleState, GPUPrimitiveState, GPUProgrammableStage, GPUVertexState } from './Interfaces';
|
|
14
|
+
import type { GPUAddressMode, GPUCompareFunction, GPUErrorFilter, GPUFilterMode, GPUMipmapFilterMode, GPUQueryType, GPUTextureFormat } from './Types';
|
|
15
|
+
import type { GPUBindGroupDescriptor, GPUBindGroupLayoutEntry, GPUComputePipelineDescriptor, GPURenderPipelineDescriptor } from './Interfaces';
|
|
18
16
|
import { GPUComputePipeline } from './GPUComputePipeline';
|
|
19
17
|
import { GPUQuerySet } from './GPUQuerySet';
|
|
20
18
|
import { GPURenderBundleEncoder } from './GPURenderBundleEncoder';
|
|
21
|
-
import { GPUAdapter } from './GPUAdapter';
|
|
19
|
+
import { GPUAdapter, GPUSupportedFeatures } from './GPUAdapter';
|
|
22
20
|
export declare class EventTarget {
|
|
23
|
-
_emitter?: WeakRef<Observable>;
|
|
21
|
+
protected _emitter?: WeakRef<Observable>;
|
|
24
22
|
addEventListener(event: string, handler: any, options?: AddEventListenerOptions): void;
|
|
25
23
|
removeEventListener(event: string, handler?: any): void;
|
|
26
24
|
dispatchEvent(event: any): void;
|
|
@@ -33,55 +31,19 @@ interface GPUExtent3DDict {
|
|
|
33
31
|
type GPUExtent3D = [number, number, number] | [number, number] | GPUExtent3DDict;
|
|
34
32
|
export declare class GPUDevice extends EventTarget {
|
|
35
33
|
[native_]: any;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_observerable: Observable;
|
|
34
|
+
private _lost;
|
|
35
|
+
private _observerable;
|
|
39
36
|
constructor();
|
|
40
37
|
private _uncapturederror;
|
|
41
38
|
static fromNative(device: any, adapter: GPUAdapter): GPUDevice;
|
|
39
|
+
get label(): any;
|
|
42
40
|
get lost(): Promise<GPUDeviceLostInfo>;
|
|
43
41
|
get native(): any;
|
|
44
42
|
get limits(): any;
|
|
45
|
-
get features():
|
|
43
|
+
get features(): GPUSupportedFeatures;
|
|
46
44
|
destroy(): void;
|
|
47
|
-
createBindGroup(descriptor:
|
|
48
|
-
|
|
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;
|
|
45
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
46
|
+
createBindGroupLayout(descriptor: GPUBindGroupLayoutEntry): GPUBindGroupLayout;
|
|
85
47
|
createBuffer(descriptor: {
|
|
86
48
|
label?: string;
|
|
87
49
|
mappedAtCreation?: boolean;
|
|
@@ -91,16 +53,8 @@ export declare class GPUDevice extends EventTarget {
|
|
|
91
53
|
createCommandEncoder(descriptor?: {
|
|
92
54
|
label?: string;
|
|
93
55
|
}): GPUCommandEncoder;
|
|
94
|
-
createComputePipeline(descriptor:
|
|
95
|
-
|
|
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>;
|
|
56
|
+
createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline;
|
|
57
|
+
createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise<unknown>;
|
|
104
58
|
createPipelineLayout(descriptor: {
|
|
105
59
|
bindGroupLayouts: GPUBindGroupLayout[];
|
|
106
60
|
label?: string;
|
|
@@ -118,24 +72,8 @@ export declare class GPUDevice extends EventTarget {
|
|
|
118
72
|
sampleCount?: number;
|
|
119
73
|
stencilReadOnly?: boolean;
|
|
120
74
|
}): GPURenderBundleEncoder;
|
|
121
|
-
createRenderPipeline(descriptor:
|
|
122
|
-
|
|
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>;
|
|
75
|
+
createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
|
|
76
|
+
createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<unknown>;
|
|
139
77
|
createSampler(descriptor?: {
|
|
140
78
|
addressModeU?: GPUAddressMode;
|
|
141
79
|
addressModeV?: GPUAddressMode;
|
|
@@ -149,7 +87,7 @@ export declare class GPUDevice extends EventTarget {
|
|
|
149
87
|
minFilter?: GPUFilterMode;
|
|
150
88
|
mipmapFilter?: GPUMipmapFilterMode;
|
|
151
89
|
}): GPUSampler;
|
|
152
|
-
createShaderModule(
|
|
90
|
+
createShaderModule(descriptor: {
|
|
153
91
|
label?: string;
|
|
154
92
|
code: string;
|
|
155
93
|
sourceMap?: object;
|
|
@@ -161,8 +99,8 @@ export declare class GPUDevice extends EventTarget {
|
|
|
161
99
|
mipLevelCount?: number;
|
|
162
100
|
sampleCount?: number;
|
|
163
101
|
dimension?: '1d' | '2d' | '3d';
|
|
164
|
-
format:
|
|
165
|
-
usage:
|
|
102
|
+
format: GPUTextureFormat;
|
|
103
|
+
usage: number;
|
|
166
104
|
viewFormats?: any[];
|
|
167
105
|
}): GPUTexture;
|
|
168
106
|
popErrorScope(): Promise<unknown>;
|