@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
|
@@ -17,7 +17,7 @@ const CanvasGPUComputePassEncoder *GPUComputePassEncoderImpl::GetComputePass() {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
void GPUComputePassEncoderImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate) {
|
|
20
|
+
void GPUComputePassEncoderImpl::Init(v8::Local <v8::Object> canvasModule, v8::Isolate *isolate) {
|
|
21
21
|
v8::Locker locker(isolate);
|
|
22
22
|
v8::Isolate::Scope isolate_scope(isolate);
|
|
23
23
|
v8::HandleScope handle_scope(isolate);
|
|
@@ -26,11 +26,12 @@ void GPUComputePassEncoderImpl::Init(v8::Local<v8::Object> canvasModule, v8::Iso
|
|
|
26
26
|
auto context = isolate->GetCurrentContext();
|
|
27
27
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
28
28
|
|
|
29
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePassEncoder"),
|
|
29
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePassEncoder"),
|
|
30
|
+
func).FromJust();
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
GPUComputePassEncoderImpl *
|
|
33
|
-
GPUComputePassEncoderImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
34
|
+
GPUComputePassEncoderImpl::GetPointer(const v8::Local <v8::Object> &object) {
|
|
34
35
|
auto ptr = object->GetAlignedPointerFromInternalField(0);
|
|
35
36
|
if (ptr == nullptr) {
|
|
36
37
|
return nullptr;
|
|
@@ -38,20 +39,25 @@ GPUComputePassEncoderImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
|
38
39
|
return static_cast<GPUComputePassEncoderImpl *>(ptr);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
v8::Local<v8::FunctionTemplate> GPUComputePassEncoderImpl::GetCtor(v8::Isolate *isolate) {
|
|
42
|
+
v8::Local <v8::FunctionTemplate> GPUComputePassEncoderImpl::GetCtor(v8::Isolate *isolate) {
|
|
42
43
|
auto cache = Caches::Get(isolate);
|
|
43
44
|
auto ctor = cache->GPUComputePassEncoderTmpl.get();
|
|
44
45
|
if (ctor != nullptr) {
|
|
45
46
|
return ctor->Get(isolate);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
49
|
+
v8::Local <v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
49
50
|
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(2);
|
|
50
51
|
ctorTmpl->SetClassName(ConvertToV8String(isolate, "GPUComputePassEncoder"));
|
|
51
52
|
|
|
52
53
|
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
53
54
|
tmpl->SetInternalFieldCount(2);
|
|
54
55
|
|
|
56
|
+
tmpl->SetLazyDataProperty(
|
|
57
|
+
ConvertToV8String(isolate, "label"),
|
|
58
|
+
GetLabel
|
|
59
|
+
);
|
|
60
|
+
|
|
55
61
|
tmpl->Set(
|
|
56
62
|
ConvertToV8String(isolate, "dispatchWorkgroups"),
|
|
57
63
|
v8::FunctionTemplate::New(isolate, &DispatchWorkgroups));
|
|
@@ -86,12 +92,34 @@ v8::Local<v8::FunctionTemplate> GPUComputePassEncoderImpl::GetCtor(v8::Isolate *
|
|
|
86
92
|
|
|
87
93
|
|
|
88
94
|
cache->GPUComputePassEncoderTmpl =
|
|
89
|
-
std::make_unique<v8::Persistent<v8::FunctionTemplate>>
|
|
95
|
+
std::make_unique<v8::Persistent < v8::FunctionTemplate>>
|
|
96
|
+
(isolate, ctorTmpl);
|
|
90
97
|
return ctorTmpl;
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
void
|
|
94
|
-
GPUComputePassEncoderImpl::
|
|
101
|
+
GPUComputePassEncoderImpl::GetLabel(v8::Local <v8::Name> name,
|
|
102
|
+
const v8::PropertyCallbackInfo <v8::Value> &info) {
|
|
103
|
+
auto ptr = GetPointer(info.This());
|
|
104
|
+
if (ptr != nullptr) {
|
|
105
|
+
auto label = canvas_native_webgpu_compute_pass_encoder_get_label(ptr->computePass_);
|
|
106
|
+
if (label == nullptr) {
|
|
107
|
+
info.GetReturnValue().SetEmptyString();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
info.GetReturnValue().Set(
|
|
111
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
112
|
+
);
|
|
113
|
+
canvas_native_string_destroy(label);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
info.GetReturnValue().SetEmptyString();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
void
|
|
122
|
+
GPUComputePassEncoderImpl::DispatchWorkgroups(const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
95
123
|
auto *ptr = GetPointer(args.This());
|
|
96
124
|
if (ptr == nullptr) {
|
|
97
125
|
return;
|
|
@@ -126,7 +154,7 @@ GPUComputePassEncoderImpl::DispatchWorkgroups(const v8::FunctionCallbackInfo<v8:
|
|
|
126
154
|
}
|
|
127
155
|
|
|
128
156
|
void GPUComputePassEncoderImpl::DispatchWorkgroupsIndirect(
|
|
129
|
-
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
157
|
+
const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
130
158
|
auto *ptr = GetPointer(args.This());
|
|
131
159
|
if (ptr == nullptr) {
|
|
132
160
|
return;
|
|
@@ -150,7 +178,7 @@ void GPUComputePassEncoderImpl::DispatchWorkgroupsIndirect(
|
|
|
150
178
|
}
|
|
151
179
|
|
|
152
180
|
|
|
153
|
-
void GPUComputePassEncoderImpl::End(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
181
|
+
void GPUComputePassEncoderImpl::End(const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
154
182
|
auto *ptr = GetPointer(args.This());
|
|
155
183
|
if (ptr == nullptr) {
|
|
156
184
|
return;
|
|
@@ -160,7 +188,7 @@ void GPUComputePassEncoderImpl::End(const v8::FunctionCallbackInfo<v8::Value> &a
|
|
|
160
188
|
}
|
|
161
189
|
|
|
162
190
|
void
|
|
163
|
-
GPUComputePassEncoderImpl::InsertDebugMarker(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
191
|
+
GPUComputePassEncoderImpl::InsertDebugMarker(const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
164
192
|
auto *ptr = GetPointer(args.This());
|
|
165
193
|
if (ptr == nullptr) {
|
|
166
194
|
return;
|
|
@@ -176,7 +204,7 @@ GPUComputePassEncoderImpl::InsertDebugMarker(const v8::FunctionCallbackInfo<v8::
|
|
|
176
204
|
}
|
|
177
205
|
}
|
|
178
206
|
|
|
179
|
-
void GPUComputePassEncoderImpl::PopDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
207
|
+
void GPUComputePassEncoderImpl::PopDebugGroup(const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
180
208
|
auto *ptr = GetPointer(args.This());
|
|
181
209
|
if (ptr == nullptr) {
|
|
182
210
|
return;
|
|
@@ -185,7 +213,7 @@ void GPUComputePassEncoderImpl::PopDebugGroup(const v8::FunctionCallbackInfo<v8:
|
|
|
185
213
|
canvas_native_webgpu_compute_pass_encoder_pop_debug_group(ptr->GetComputePass());
|
|
186
214
|
}
|
|
187
215
|
|
|
188
|
-
void GPUComputePassEncoderImpl::PushDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
216
|
+
void GPUComputePassEncoderImpl::PushDebugGroup(const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
189
217
|
auto *ptr = GetPointer(args.This());
|
|
190
218
|
if (ptr == nullptr) {
|
|
191
219
|
return;
|
|
@@ -201,7 +229,7 @@ void GPUComputePassEncoderImpl::PushDebugGroup(const v8::FunctionCallbackInfo<v8
|
|
|
201
229
|
}
|
|
202
230
|
}
|
|
203
231
|
|
|
204
|
-
void GPUComputePassEncoderImpl::SetBindGroup(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
232
|
+
void GPUComputePassEncoderImpl::SetBindGroup(const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
205
233
|
auto *ptr = GetPointer(args.This());
|
|
206
234
|
if (ptr == nullptr) {
|
|
207
235
|
return;
|
|
@@ -243,7 +271,7 @@ void GPUComputePassEncoderImpl::SetBindGroup(const v8::FunctionCallbackInfo<v8::
|
|
|
243
271
|
}
|
|
244
272
|
}
|
|
245
273
|
|
|
246
|
-
void GPUComputePassEncoderImpl::SetPipeline(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
274
|
+
void GPUComputePassEncoderImpl::SetPipeline(const v8::FunctionCallbackInfo <v8::Value> &args) {
|
|
247
275
|
auto *ptr = GetPointer(args.This());
|
|
248
276
|
if (ptr == nullptr) {
|
|
249
277
|
return;
|
|
@@ -36,6 +36,9 @@ public:
|
|
|
36
36
|
return scope.Escape(object);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
static void GetLabel(v8::Local<v8::Name> name,
|
|
40
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
41
|
+
|
|
39
42
|
static void DispatchWorkgroups(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
40
43
|
|
|
41
44
|
static void DispatchWorkgroupsIndirect(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
@@ -49,6 +49,10 @@ v8::Local<v8::FunctionTemplate> GPUComputePipelineImpl::GetCtor(v8::Isolate *iso
|
|
|
49
49
|
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
50
50
|
tmpl->SetInternalFieldCount(2);
|
|
51
51
|
|
|
52
|
+
tmpl->SetLazyDataProperty(
|
|
53
|
+
ConvertToV8String(isolate, "label"),
|
|
54
|
+
GetLabel
|
|
55
|
+
);
|
|
52
56
|
|
|
53
57
|
tmpl->Set(
|
|
54
58
|
ConvertToV8String(isolate, "getBindGroupLayout"),
|
|
@@ -59,6 +63,27 @@ v8::Local<v8::FunctionTemplate> GPUComputePipelineImpl::GetCtor(v8::Isolate *iso
|
|
|
59
63
|
return ctorTmpl;
|
|
60
64
|
}
|
|
61
65
|
|
|
66
|
+
void
|
|
67
|
+
GPUComputePipelineImpl::GetLabel(v8::Local<v8::Name> name,
|
|
68
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
69
|
+
auto ptr = GetPointer(info.This());
|
|
70
|
+
if (ptr != nullptr) {
|
|
71
|
+
auto label = canvas_native_webgpu_compute_pipeline_get_label(ptr->pipeline_);
|
|
72
|
+
if (label == nullptr) {
|
|
73
|
+
info.GetReturnValue().SetEmptyString();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
info.GetReturnValue().Set(
|
|
77
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
78
|
+
);
|
|
79
|
+
canvas_native_string_destroy(label);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
info.GetReturnValue().SetEmptyString();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
62
87
|
void GPUComputePipelineImpl::GetBindGroupLayout(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
63
88
|
auto *ptr = GetPointer(args.This());
|
|
64
89
|
if (ptr == nullptr) {
|