@nativescript/canvas 2.0.0-webgpu.3 → 2.0.0-webgpu.30
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 +4 -9
- package/Canvas/common.js +37 -126
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +0 -1
- package/Canvas/index.android.js +45 -38
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +11 -3
- package/Canvas/index.ios.js +49 -40
- 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 +1 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js +1 -0
- 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.js +77 -33
- 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/index.js +73 -31
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js +4 -4
- 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 +3 -2
- 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 +76 -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 +56 -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 +2 -1
- package/WebGPU/GPURenderPassEncoder.js +5 -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 +224 -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/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 +39 -10
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +7 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +227 -62
- 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 +1635 -151
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +57 -1
- 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 +57 -1
- 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 +690 -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 +78 -20
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +7 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +227 -62
- 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 +1635 -151
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +57 -1
- 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 +57 -1
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1635 -151
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +57 -1
- 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 +57 -1
- 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 +27 -27
- 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 +692 -646
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +730 -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 +208 -789
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +18 -28
- package/platforms/ios/src/cpp/ImageAssetImpl.h +3 -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 +1 -1
- 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/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 +42 -14
- 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 +1597 -674
- 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 +50 -13
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +43 -14
- 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 +39 -13
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +3 -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
|
@@ -24,6 +24,9 @@ export class GPUCanvasContext {
|
|
|
24
24
|
get native() {
|
|
25
25
|
return this[native_];
|
|
26
26
|
}
|
|
27
|
+
get canvas() {
|
|
28
|
+
return this._canvas;
|
|
29
|
+
}
|
|
27
30
|
configure(options) {
|
|
28
31
|
const opts = {
|
|
29
32
|
usage: GPUTextureUsage.RENDER_ATTACHMENT,
|
|
@@ -40,6 +43,42 @@ export class GPUCanvasContext {
|
|
|
40
43
|
if (!options.alphaMode) {
|
|
41
44
|
opts.alphaMode = capabilities.alphaModes[0];
|
|
42
45
|
}
|
|
46
|
+
else {
|
|
47
|
+
if (!capabilities.alphaModes.includes(options.alphaMode) && (options.alphaMode === 'opaque' || options.alphaMode === 'premultiplied')) {
|
|
48
|
+
if (__IOS__ && options.alphaMode === 'premultiplied') {
|
|
49
|
+
let index = capabilities.alphaModes.indexOf('premultiplied');
|
|
50
|
+
if (index === -1) {
|
|
51
|
+
index = capabilities.alphaModes.indexOf('postmultiplied');
|
|
52
|
+
}
|
|
53
|
+
if (index === -1) {
|
|
54
|
+
index = 0;
|
|
55
|
+
}
|
|
56
|
+
opts.alphaMode = capabilities.alphaModes[index];
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
opts.alphaMode = capabilities.alphaModes[0];
|
|
60
|
+
}
|
|
61
|
+
console.warn(`GPUCanvasContext: configure alphaMode ${options.alphaMode} unsupported falling back to ${opts.alphaMode}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (__ANDROID__ && !capabilities.format.includes(options.format) && (options.format === 'bgra8unorm' || options.format === 'bgra8unorm-srgb')) {
|
|
65
|
+
opts.format = capabilities.format[0];
|
|
66
|
+
// fallback to rgba8unorm ... Android 🤪
|
|
67
|
+
if (opts.format === 'rgba8unorm-srgb') {
|
|
68
|
+
opts.format = 'rgba8unorm';
|
|
69
|
+
}
|
|
70
|
+
console.warn(`GPUCanvasContext: configure format ${options.format} unsupported falling back to ${opts.format}`);
|
|
71
|
+
}
|
|
72
|
+
if (__IOS__ && !capabilities.format.includes(options.format)) {
|
|
73
|
+
opts.format = capabilities.format.filter((value) => {
|
|
74
|
+
return value.indexOf('srgb') === -1;
|
|
75
|
+
})[0];
|
|
76
|
+
console.warn(`GPUCanvasContext: configure format ${options.format} unsupported falling back to ${opts.format}`);
|
|
77
|
+
}
|
|
78
|
+
if (__IOS__ && opts.usage > capabilities.usages) {
|
|
79
|
+
opts.usage = capabilities.usages;
|
|
80
|
+
console.warn(`GPUCanvasContext: configure usage unsupported falling back to ${capabilities.usages}`);
|
|
81
|
+
}
|
|
43
82
|
}
|
|
44
83
|
opts.device = options?.device?.[native_];
|
|
45
84
|
this[native_].configure(opts);
|
|
@@ -52,19 +91,22 @@ export class GPUCanvasContext {
|
|
|
52
91
|
return this._currentTexture;
|
|
53
92
|
}
|
|
54
93
|
const texture = this[native_].getCurrentTexture();
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return
|
|
94
|
+
if (texture) {
|
|
95
|
+
this._currentTexture = GPUTexture.fromNative(texture);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this._currentTexture = null;
|
|
99
|
+
}
|
|
100
|
+
return this._currentTexture;
|
|
62
101
|
}
|
|
63
|
-
presentSurface(
|
|
64
|
-
if (this._currentTexture
|
|
102
|
+
presentSurface() {
|
|
103
|
+
if (this._currentTexture) {
|
|
104
|
+
this[native_].presentSurface(this._currentTexture[native_]);
|
|
65
105
|
this._currentTexture = null;
|
|
66
106
|
}
|
|
67
|
-
|
|
107
|
+
else {
|
|
108
|
+
console.warn('call getCurrentTexture: before presentSurface');
|
|
109
|
+
}
|
|
68
110
|
}
|
|
69
111
|
getCapabilities(adapter) {
|
|
70
112
|
return this[native_].getCapabilities(adapter[native_]);
|
|
@@ -1 +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,CAAC;YACtB,aAAa,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC;QACvD,CAAC;QAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;QAClD,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,8B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AED,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAED,cAAc;QACb,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC7B,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAC/D,CAAC;IACF,CAAC;IAED,eAAe,CAAC,OAAmB;QAMlC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;CACD;AA1IA;IACC,OAAO,CAAC,UAAU,EAAE,CAAC;AACtB,CAAC,GAAA,CAAA"}
|
|
@@ -1 +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;
|
|
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;IAG5B,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,aAAa;QAC9B,IAAI,aAAa,EAAE,CAAC;YACnB,MAAM,GAAG,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACnC,GAAG,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC;YAC7B,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -4,10 +4,11 @@ import { GPUCommandBuffer } from './GPUCommandBuffer';
|
|
|
4
4
|
import { GPUComputePassEncoder } from './GPUComputePassEncoder';
|
|
5
5
|
import { GPUQuerySet } from './GPUQuerySet';
|
|
6
6
|
import { GPURenderPassEncoder } from './GPURenderPassEncoder';
|
|
7
|
-
import { GPUImageCopyBuffer, GPUImageCopyTexture,
|
|
7
|
+
import { GPUImageCopyBuffer, GPUImageCopyTexture, GPURenderPassDescriptor } from './Interfaces';
|
|
8
8
|
import { GPUExtent3D } from './Types';
|
|
9
9
|
export declare class GPUCommandEncoder {
|
|
10
10
|
[native_]: any;
|
|
11
|
+
get label(): any;
|
|
11
12
|
static fromNative(encoder: any): GPUCommandEncoder;
|
|
12
13
|
beginComputePass(descriptor?: {
|
|
13
14
|
label?: string;
|
|
@@ -17,14 +18,7 @@ export declare class GPUCommandEncoder {
|
|
|
17
18
|
querySet: GPUQuerySet;
|
|
18
19
|
};
|
|
19
20
|
}): 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;
|
|
21
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
28
22
|
clearBuffer(buffer: GPUBuffer, offset?: number, size?: number): void;
|
|
29
23
|
copyBufferToBuffer(source: GPUBuffer, sourceOffset: number, destination: GPUBuffer, destinationOffset: number, size: number): void;
|
|
30
24
|
copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
|
|
@@ -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
|
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ED,eAAe,CAAC,QAAqB,EAAE,UAAkB,EAAE,UAAkB,EAAE,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;IAGj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C7C,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,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>;
|