@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.
Files changed (211) hide show
  1. package/Canvas/common.d.ts +5 -10
  2. package/Canvas/common.js +61 -144
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +6 -5
  5. package/Canvas/index.android.js +63 -42
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +13 -3
  8. package/Canvas/index.ios.d.ts +9 -1
  9. package/Canvas/index.ios.js +117 -66
  10. package/Canvas/index.ios.js.map +1 -1
  11. package/Canvas/utils.d.ts +3 -0
  12. package/Canvas/utils.js +85 -0
  13. package/Canvas/utils.js.map +1 -0
  14. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +3 -1
  15. package/Canvas2D/CanvasRenderingContext2D/index.js +2 -4
  16. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  17. package/Dom/Group.d.ts +1 -2
  18. package/Dom/Group.js.map +1 -1
  19. package/Dom/Image.js +0 -1
  20. package/Dom/Image.js.map +1 -1
  21. package/Dom/Paint.d.ts +1 -1
  22. package/Dom/shapes/Path.d.ts +1 -1
  23. package/ImageAsset/index.d.ts +4 -2
  24. package/ImageAsset/index.js +151 -37
  25. package/ImageAsset/index.js.map +1 -1
  26. package/ImageBitmap/index.js +107 -20
  27. package/ImageBitmap/index.js.map +1 -1
  28. package/README.md +2 -4
  29. package/WebGL/WebGLRenderingContext/common.d.ts +1 -1
  30. package/WebGL/WebGLRenderingContext/index.js +76 -32
  31. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  32. package/WebGL2/WebGL2RenderingContext/index.js +5 -5
  33. package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
  34. package/WebGPU/GPU.js +4 -3
  35. package/WebGPU/GPU.js.map +1 -1
  36. package/WebGPU/GPUAdapter.d.ts +6 -3
  37. package/WebGPU/GPUAdapter.js +31 -0
  38. package/WebGPU/GPUAdapter.js.map +1 -1
  39. package/WebGPU/GPUBindGroup.d.ts +1 -0
  40. package/WebGPU/GPUBindGroup.js +3 -0
  41. package/WebGPU/GPUBindGroup.js.map +1 -1
  42. package/WebGPU/GPUBindGroupLayout.d.ts +1 -0
  43. package/WebGPU/GPUBindGroupLayout.js +3 -0
  44. package/WebGPU/GPUBindGroupLayout.js.map +1 -1
  45. package/WebGPU/GPUBuffer.js +10 -2
  46. package/WebGPU/GPUBuffer.js.map +1 -1
  47. package/WebGPU/GPUCanvasContext.d.ts +5 -3
  48. package/WebGPU/GPUCanvasContext.js +52 -10
  49. package/WebGPU/GPUCanvasContext.js.map +1 -1
  50. package/WebGPU/GPUCommandBuffer.d.ts +1 -0
  51. package/WebGPU/GPUCommandBuffer.js +3 -0
  52. package/WebGPU/GPUCommandBuffer.js.map +1 -1
  53. package/WebGPU/GPUCommandEncoder.d.ts +3 -9
  54. package/WebGPU/GPUCommandEncoder.js +94 -41
  55. package/WebGPU/GPUCommandEncoder.js.map +1 -1
  56. package/WebGPU/GPUComputePassEncoder.d.ts +1 -0
  57. package/WebGPU/GPUComputePassEncoder.js +3 -0
  58. package/WebGPU/GPUComputePassEncoder.js.map +1 -1
  59. package/WebGPU/GPUComputePipeline.d.ts +1 -0
  60. package/WebGPU/GPUComputePipeline.js +3 -0
  61. package/WebGPU/GPUComputePipeline.js.map +1 -1
  62. package/WebGPU/GPUDevice.d.ts +17 -79
  63. package/WebGPU/GPUDevice.js +75 -91
  64. package/WebGPU/GPUDevice.js.map +1 -1
  65. package/WebGPU/GPUExternalTexture.d.ts +1 -0
  66. package/WebGPU/GPUExternalTexture.js +3 -0
  67. package/WebGPU/GPUExternalTexture.js.map +1 -1
  68. package/WebGPU/GPUPipelineLayout.d.ts +1 -0
  69. package/WebGPU/GPUPipelineLayout.js +3 -0
  70. package/WebGPU/GPUPipelineLayout.js.map +1 -1
  71. package/WebGPU/GPUQuerySet.d.ts +1 -0
  72. package/WebGPU/GPUQuerySet.js +3 -0
  73. package/WebGPU/GPUQuerySet.js.map +1 -1
  74. package/WebGPU/GPUQueue.d.ts +1 -0
  75. package/WebGPU/GPUQueue.js +65 -14
  76. package/WebGPU/GPUQueue.js.map +1 -1
  77. package/WebGPU/GPURenderBundle.d.ts +1 -0
  78. package/WebGPU/GPURenderBundle.js +3 -0
  79. package/WebGPU/GPURenderBundle.js.map +1 -1
  80. package/WebGPU/GPURenderBundleEncoder.d.ts +4 -2
  81. package/WebGPU/GPURenderBundleEncoder.js +7 -3
  82. package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
  83. package/WebGPU/GPURenderPassEncoder.d.ts +5 -1
  84. package/WebGPU/GPURenderPassEncoder.js +14 -2
  85. package/WebGPU/GPURenderPassEncoder.js.map +1 -1
  86. package/WebGPU/GPURenderPipeline.d.ts +1 -0
  87. package/WebGPU/GPURenderPipeline.js +3 -0
  88. package/WebGPU/GPURenderPipeline.js.map +1 -1
  89. package/WebGPU/GPUSampler.d.ts +1 -0
  90. package/WebGPU/GPUSampler.js +3 -0
  91. package/WebGPU/GPUSampler.js.map +1 -1
  92. package/WebGPU/GPUShaderModule.d.ts +1 -1
  93. package/WebGPU/GPUShaderModule.js +2 -2
  94. package/WebGPU/GPUShaderModule.js.map +1 -1
  95. package/WebGPU/GPUTexture.d.ts +1 -0
  96. package/WebGPU/GPUTexture.js +3 -0
  97. package/WebGPU/GPUTexture.js.map +1 -1
  98. package/WebGPU/GPUTextureView.d.ts +1 -0
  99. package/WebGPU/GPUTextureView.js +3 -0
  100. package/WebGPU/GPUTextureView.js.map +1 -1
  101. package/WebGPU/Interfaces.d.ts +95 -4
  102. package/WebGPU/Types.d.ts +9 -1
  103. package/WebGPU/Utils.d.ts +6 -0
  104. package/WebGPU/Utils.js +226 -0
  105. package/WebGPU/Utils.js.map +1 -1
  106. package/angular/esm2022/index.mjs +4 -4
  107. package/angular/fesm2022/nativescript-canvas-angular.mjs +4 -4
  108. package/angular/fesm2022/nativescript-canvas-angular.mjs.map +1 -1
  109. package/common.js.map +1 -1
  110. package/index.d.ts +2 -1
  111. package/index.js +3 -2
  112. package/index.js.map +1 -1
  113. package/package.json +1 -1
  114. package/platforms/android/canvas-release.aar +0 -0
  115. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  116. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +61 -30
  117. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +1 -0
  118. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
  119. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +144 -176
  120. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +342 -72
  121. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  122. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  123. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1928 -630
  124. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +85 -23
  125. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  126. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +85 -23
  127. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
  128. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  129. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +681 -644
  130. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  131. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +122 -60
  132. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +1 -0
  133. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
  134. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +144 -176
  135. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +342 -72
  136. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  137. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  138. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  139. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1928 -630
  140. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +85 -23
  141. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  142. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +85 -23
  143. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1928 -630
  144. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +85 -23
  145. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  146. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +85 -23
  147. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
  148. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +40 -29
  149. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  150. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +683 -646
  151. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +736 -684
  152. package/platforms/ios/src/NSOperationQueueWrapper.h +1 -1
  153. package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
  154. package/platforms/ios/src/cpp/AsyncCallback.h +16 -8
  155. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +310 -801
  156. package/platforms/ios/src/cpp/CanvasJSIModule.h +2 -0
  157. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +578 -413
  158. package/platforms/ios/src/cpp/ImageAssetImpl.h +7 -3
  159. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +60 -3
  160. package/platforms/ios/src/cpp/ImageBitmapImpl.h +10 -3
  161. package/platforms/ios/src/cpp/PromiseCallback.h +1 -2
  162. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +7 -11
  163. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +3 -3
  164. package/platforms/ios/src/cpp/canvas2d/Path2D.h +5 -5
  165. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +106 -1
  166. package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +6 -6
  167. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +26 -23
  168. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +31 -5
  169. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +4 -1
  170. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +26 -0
  171. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +3 -0
  172. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +41 -7
  173. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -0
  174. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -5
  175. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +28 -1
  176. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +3 -0
  177. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +75 -79
  178. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +4 -0
  179. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +56 -23
  180. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +3 -0
  181. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +25 -0
  182. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +2 -0
  183. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1606 -681
  184. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -0
  185. package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +2 -1
  186. package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
  187. package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
  188. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +26 -0
  189. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +3 -1
  190. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -2
  191. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
  192. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +83 -14
  193. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +3 -0
  194. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +66 -34
  195. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +3 -0
  196. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +25 -0
  197. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +3 -0
  198. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +151 -52
  199. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +7 -0
  200. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +25 -0
  201. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +3 -0
  202. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +26 -0
  203. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +4 -1
  204. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +24 -0
  205. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +3 -0
  206. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +34 -8
  207. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +2 -0
  208. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +26 -0
  209. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +3 -0
  210. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
  211. package/utils.d.ts +1 -1
@@ -54,6 +54,11 @@ v8::Local<v8::FunctionTemplate> GPURenderPassEncoderImpl::GetCtor(v8::Isolate *i
54
54
  auto tmpl = ctorTmpl->InstanceTemplate();
55
55
  tmpl->SetInternalFieldCount(2);
56
56
 
57
+ tmpl->SetLazyDataProperty(
58
+ ConvertToV8String(isolate, "label"),
59
+ GetLabel
60
+ );
61
+
57
62
  tmpl->Set(
58
63
  ConvertToV8String(isolate, "beginOcclusionQuery"),
59
64
  v8::FunctionTemplate::New(isolate, &BeginOcclusionQuery));
@@ -74,6 +79,14 @@ v8::Local<v8::FunctionTemplate> GPURenderPassEncoderImpl::GetCtor(v8::Isolate *i
74
79
  ConvertToV8String(isolate, "drawIndirect"),
75
80
  v8::FunctionTemplate::New(isolate, &DrawIndirect));
76
81
 
82
+ tmpl->Set(
83
+ ConvertToV8String(isolate, "multiDrawIndexedIndirect"),
84
+ v8::FunctionTemplate::New(isolate, &MultiDrawIndexedIndirect));
85
+
86
+ tmpl->Set(
87
+ ConvertToV8String(isolate, "multiDrawIndirect"),
88
+ v8::FunctionTemplate::New(isolate, &MultiDrawIndirect));
89
+
77
90
  tmpl->Set(
78
91
  ConvertToV8String(isolate, "end"),
79
92
  v8::FunctionTemplate::New(isolate, &End));
@@ -136,6 +149,27 @@ v8::Local<v8::FunctionTemplate> GPURenderPassEncoderImpl::GetCtor(v8::Isolate *i
136
149
  }
137
150
 
138
151
 
152
+ void
153
+ GPURenderPassEncoderImpl::GetLabel(v8::Local<v8::Name> name,
154
+ const v8::PropertyCallbackInfo<v8::Value> &info) {
155
+ auto ptr = GetPointer(info.This());
156
+ if (ptr != nullptr) {
157
+ auto label = canvas_native_webgpu_render_pass_encoder_get_label(ptr->pass_);
158
+ if (label == nullptr) {
159
+ info.GetReturnValue().SetEmptyString();
160
+ return;
161
+ }
162
+ info.GetReturnValue().Set(
163
+ ConvertToV8String(info.GetIsolate(), label)
164
+ );
165
+ canvas_native_string_destroy(label);
166
+ return;
167
+ }
168
+
169
+ info.GetReturnValue().SetEmptyString();
170
+ }
171
+
172
+
139
173
  void
140
174
  GPURenderPassEncoderImpl::BeginOcclusionQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
141
175
  auto *ptr = GetPointer(args.This());
@@ -229,7 +263,7 @@ void GPURenderPassEncoderImpl::DrawIndexed(const v8::FunctionCallbackInfo<v8::Va
229
263
  }
230
264
 
231
265
  auto indexCount = indexCountVal->Uint32Value(
232
- context).FromJust();
266
+ context).FromJust();
233
267
  canvas_native_webgpu_render_pass_encoder_draw_indexed(ptr->GetPass(),
234
268
  indexCount,
235
269
  instanceCount, firstIndex,
@@ -265,6 +299,36 @@ GPURenderPassEncoderImpl::DrawIndexedIndirect(const v8::FunctionCallbackInfo<v8:
265
299
  }
266
300
 
267
301
 
302
+ }
303
+
304
+ void
305
+ GPURenderPassEncoderImpl::MultiDrawIndexedIndirect(
306
+ const v8::FunctionCallbackInfo<v8::Value> &args) {
307
+ auto *ptr = GetPointer(args.This());
308
+ if (ptr == nullptr) {
309
+ return;
310
+ }
311
+
312
+ auto isolate = args.GetIsolate();
313
+ auto context = isolate->GetCurrentContext();
314
+
315
+ auto indirectBufferVal = args[0];
316
+ auto indirectOffsetVal = args[1];
317
+ auto countVal = args[2];
318
+
319
+
320
+ auto indirectBufferType = GetNativeType(indirectBufferVal);
321
+
322
+ if (indirectBufferType == NativeType::GPUBuffer) {
323
+ auto indirectBuffer = GPUBufferImpl::GetPointer(indirectBufferVal.As<v8::Object>());
324
+ uint64_t offset = (uint64_t) indirectOffsetVal->NumberValue(context).FromJust();
325
+ uint32_t count = countVal->Uint32Value(context).FromJust();
326
+ canvas_native_webgpu_render_pass_encoder_multi_draw_indexed_indirect(ptr->GetPass(),
327
+ indirectBuffer->GetGPUBuffer(),
328
+ offset, count);
329
+ }
330
+
331
+
268
332
  }
269
333
 
270
334
  void
@@ -292,6 +356,35 @@ GPURenderPassEncoderImpl::DrawIndirect(const v8::FunctionCallbackInfo<v8::Value>
292
356
  }
293
357
 
294
358
 
359
+ }
360
+
361
+ void
362
+ GPURenderPassEncoderImpl::MultiDrawIndirect(const v8::FunctionCallbackInfo<v8::Value> &args) {
363
+ auto *ptr = GetPointer(args.This());
364
+ if (ptr == nullptr) {
365
+ return;
366
+ }
367
+
368
+ auto isolate = args.GetIsolate();
369
+ auto context = isolate->GetCurrentContext();
370
+
371
+ auto indirectBufferVal = args[0];
372
+ auto indirectOffsetVal = args[1];
373
+ auto countVal = args[2];
374
+
375
+
376
+ auto indirectBufferType = GetNativeType(indirectBufferVal);
377
+
378
+ if (indirectBufferType == NativeType::GPUBuffer) {
379
+ auto indirectBuffer = GPUBufferImpl::GetPointer(indirectBufferVal.As<v8::Object>());
380
+ uint64_t offset = (uint64_t) indirectOffsetVal->NumberValue(context).FromJust();
381
+ uint32_t count = countVal->Uint32Value(context).FromJust();
382
+ canvas_native_webgpu_render_pass_encoder_multi_draw_indirect(ptr->GetPass(),
383
+ indirectBuffer->GetGPUBuffer(),
384
+ offset, count);
385
+ }
386
+
387
+
295
388
  }
296
389
 
297
390
  void GPURenderPassEncoderImpl::End(const v8::FunctionCallbackInfo<v8::Value> &args) {
@@ -328,7 +421,7 @@ void GPURenderPassEncoderImpl::ExecuteBundles(const v8::FunctionCallbackInfo<v8:
328
421
  std::vector<const CanvasGPURenderBundle *> bundles;
329
422
  for (int i = 0; i < len; i++) {
330
423
  v8::Local<v8::Value> bundleVal;
331
- bundlesArray->Get(context, i).ToLocal(&bundlesVal);
424
+ bundlesArray->Get(context, i).ToLocal(&bundleVal);
332
425
  auto type = GetNativeType(bundleVal);
333
426
  if (type == NativeType::GPURenderBundle) {
334
427
  auto bundle = GPURenderBundleImpl::GetPointer(bundleVal.As<v8::Object>());
@@ -402,30 +495,34 @@ void GPURenderPassEncoderImpl::SetBindGroup(const v8::FunctionCallbackInfo<v8::V
402
495
  auto dynamicOffsetsStart = args[3];
403
496
  auto dynamicOffsetsLength = args[4];
404
497
 
498
+ const CanvasGPUBindGroup *bindGroup = nullptr;
499
+
405
500
  auto type = GetNativeType(bindGroupVal);
406
501
 
502
+ auto index = indexVal->Uint32Value(context).FromJust();
503
+
407
504
  if (type == NativeType::GPUBindGroup) {
408
- auto index = indexVal->Uint32Value(context).FromJust();
409
- auto bindgroup = GPUBindGroupImpl::GetPointer(bindGroupVal.As<v8::Object>());
410
-
411
- if (dynamicOffsets->IsUint8Array()) {
412
- auto buf = dynamicOffsets.As<v8::Uint32Array>();
413
- auto buffer = buf->Buffer();
414
- auto store = buffer->GetBackingStore();
415
- auto offset = buf->ByteOffset();
416
- auto data = static_cast<uint8_t *>(buffer->GetBackingStore()->Data()) + offset;
417
- auto size = buf->Length();
418
- auto start = (size_t) dynamicOffsetsStart->NumberValue(context).FromJust();
419
- auto offset_length = (size_t) dynamicOffsetsLength->NumberValue(context).FromJust();
420
- canvas_native_webgpu_render_pass_encoder_set_bind_group(ptr->GetPass(), index,
421
- bindgroup->GetBindGroup(),
422
- static_cast<const uint32_t *>(static_cast<void *>(data)),
423
- size, start, offset_length);
424
- } else {
425
- canvas_native_webgpu_render_pass_encoder_set_bind_group(ptr->GetPass(), index,
426
- bindgroup->GetBindGroup(),
427
- nullptr, 0, 0, 0);
428
- }
505
+ auto group = GPUBindGroupImpl::GetPointer(bindGroupVal.As<v8::Object>());
506
+ bindGroup = group->GetBindGroup();
507
+ }
508
+
509
+ if (dynamicOffsets->IsUint32Array()) {
510
+ auto buf = dynamicOffsets.As<v8::Uint32Array>();
511
+ auto buffer = buf->Buffer();
512
+ auto store = buffer->GetBackingStore();
513
+ auto offset = buf->ByteOffset();
514
+ auto data = static_cast<uint8_t *>(buffer->GetBackingStore()->Data()) + offset;
515
+ auto size = buf->Length();
516
+ auto start = (size_t) dynamicOffsetsStart->NumberValue(context).FromJust();
517
+ auto offset_length = (size_t) dynamicOffsetsLength->NumberValue(context).FromJust();
518
+ canvas_native_webgpu_render_pass_encoder_set_bind_group(ptr->GetPass(), index,
519
+ bindGroup,
520
+ static_cast<const uint32_t *>(static_cast<void *>(data)),
521
+ size, start, offset_length);
522
+ } else {
523
+ canvas_native_webgpu_render_pass_encoder_set_bind_group(ptr->GetPass(), index,
524
+ bindGroup,
525
+ nullptr, 0, 0, 0);
429
526
  }
430
527
  }
431
528
 
@@ -446,7 +543,7 @@ void GPURenderPassEncoderImpl::SetIndexBuffer(const v8::FunctionCallbackInfo<v8:
446
543
 
447
544
  auto type = GetNativeType(bufferVal);
448
545
 
449
- if (type == NativeType::GPURenderBundleEncoder) {
546
+ if (type == NativeType::GPUBuffer) {
450
547
  auto buffer = GPUBufferImpl::GetPointer(bufferVal.As<v8::Object>());
451
548
  auto indexFormat = ConvertFromV8String(isolate, indexFormatVal);
452
549
  if (offsetVal->IsNumber()) {
@@ -502,7 +599,7 @@ void GPURenderPassEncoderImpl::SetPipeline(const v8::FunctionCallbackInfo<v8::Va
502
599
  }
503
600
 
504
601
  auto pipelineVal = args[0];
505
- if(GetNativeType(pipelineVal) == NativeType::GPURenderPipeline){
602
+ if (GetNativeType(pipelineVal) == NativeType::GPURenderPipeline) {
506
603
  auto pipeline = GPURenderPipelineImpl::GetPointer(pipelineVal.As<v8::Object>());
507
604
  canvas_native_webgpu_render_pass_encoder_set_pipeline(ptr->GetPass(),
508
605
  pipeline->GetGPUPipeline());
@@ -565,13 +662,12 @@ void GPURenderPassEncoderImpl::SetVertexBuffer(const v8::FunctionCallbackInfo<v8
565
662
  int64_t size = -1;
566
663
  auto offsetVal = args[2];
567
664
  auto sizeVal = args[3];
665
+ auto type = GetNativeType(bufferVal);
666
+ auto isolate = args.GetIsolate();
667
+ if (type == NativeType::GPUBuffer) {
668
+ auto context = isolate->GetCurrentContext();
669
+ auto slot = slotVal->ToUint32(context).ToLocalChecked();
568
670
 
569
- if (slotVal->IsUint32() && bufferVal->IsObject()) {
570
- auto slot = slotVal.As<v8::Uint32>()->Value();
571
- if (GetNativeType(bufferVal) != NativeType::GPUBuffer) {
572
- // todo throw ??
573
- return;
574
- }
575
671
 
576
672
  auto buffer = GPUBufferImpl::GetPointer(bufferVal.As<v8::Object>());
577
673
 
@@ -583,7 +679,7 @@ void GPURenderPassEncoderImpl::SetVertexBuffer(const v8::FunctionCallbackInfo<v8
583
679
  size = (int64_t) sizeVal.As<v8::Number>()->Value();
584
680
  }
585
681
 
586
- canvas_native_webgpu_render_pass_encoder_set_vertex_buffer(ptr->GetPass(), slot,
682
+ canvas_native_webgpu_render_pass_encoder_set_vertex_buffer(ptr->GetPass(), slot->Value(),
587
683
  buffer->GetGPUBuffer(), offset,
588
684
  size);
589
685
 
@@ -596,29 +692,32 @@ void GPURenderPassEncoderImpl::SetViewport(const v8::FunctionCallbackInfo<v8::Va
596
692
  return;
597
693
  }
598
694
 
599
- auto x = args[0];
600
- auto y = args[1];
601
- auto width = args[2];
602
- auto height = args[3];
695
+ auto xVal = args[0];
696
+ auto yVal = args[1];
697
+ auto widthVal = args[2];
698
+ auto heightVal = args[3];
603
699
 
604
- auto minDepth = args[4];
605
- auto maxDepth = args[5];
700
+ auto minDepthVal = args[4];
701
+ auto maxDepthVal = args[5];
606
702
 
607
703
  auto isolate = args.GetIsolate();
608
704
  auto context = isolate->GetCurrentContext();
609
-
610
- canvas_native_webgpu_render_pass_encoder_set_viewport(ptr->GetPass(),
611
- (float) x->NumberValue(
612
- context).FromJust(),
613
- (float) y->NumberValue(
614
- context).FromJust(),
615
- (float) width->NumberValue(
616
- context).FromJust(),
617
- (float) height->NumberValue(
618
- context).FromJust(),
619
- (float) minDepth->NumberValue(
620
- context).FromJust(),
621
- (float) maxDepth->NumberValue(
622
- context).FromJust());
705
+
706
+
707
+ auto x = (float) xVal->NumberValue(
708
+ context).FromJust();
709
+ auto y = (float) yVal->NumberValue(
710
+ context).FromJust();
711
+ auto width = (float) widthVal->NumberValue(
712
+ context).FromJust();
713
+ auto height = (float) heightVal->NumberValue(
714
+ context).FromJust();
715
+
716
+ auto minDepth = (float) minDepthVal->NumberValue(
717
+ context).FromJust();
718
+ auto maxDepth = (float) maxDepthVal->NumberValue(
719
+ context).FromJust();
720
+
721
+ canvas_native_webgpu_render_pass_encoder_set_viewport(ptr->GetPass(),x,y,width,height, minDepth, maxDepth);
623
722
 
624
723
  }
@@ -38,6 +38,9 @@ public:
38
38
  return scope.Escape(object);
39
39
  }
40
40
 
41
+ static void GetLabel(v8::Local<v8::Name> name,
42
+ const v8::PropertyCallbackInfo<v8::Value> &info);
43
+
41
44
  static void BeginOcclusionQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
42
45
 
43
46
  static void Draw(const v8::FunctionCallbackInfo<v8::Value> &args);
@@ -48,6 +51,10 @@ public:
48
51
 
49
52
  static void DrawIndirect(const v8::FunctionCallbackInfo<v8::Value> &args);
50
53
 
54
+ static void MultiDrawIndexedIndirect(const v8::FunctionCallbackInfo<v8::Value> &args);
55
+
56
+ static void MultiDrawIndirect(const v8::FunctionCallbackInfo<v8::Value> &args);
57
+
51
58
  static void End(const v8::FunctionCallbackInfo<v8::Value> &args);
52
59
 
53
60
  static void EndOcclusionQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
@@ -48,6 +48,10 @@ v8::Local<v8::FunctionTemplate> GPURenderPipelineImpl::GetCtor(v8::Isolate *isol
48
48
  auto tmpl = ctorTmpl->InstanceTemplate();
49
49
  tmpl->SetInternalFieldCount(2);
50
50
 
51
+ tmpl->SetLazyDataProperty(
52
+ ConvertToV8String(isolate, "label"),
53
+ GetLabel
54
+ );
51
55
 
52
56
  tmpl->Set(
53
57
  ConvertToV8String(isolate, "getBindGroupLayout"),
@@ -82,3 +86,24 @@ void GPURenderPipelineImpl::GetBindGroupLayout(const v8::FunctionCallbackInfo<v8
82
86
  args.GetReturnValue().SetUndefined();
83
87
  }
84
88
 
89
+
90
+ void
91
+ GPURenderPipelineImpl::GetLabel(v8::Local<v8::Name> name,
92
+ const v8::PropertyCallbackInfo<v8::Value> &info) {
93
+ auto ptr = GetPointer(info.This());
94
+ if (ptr != nullptr) {
95
+ auto label = canvas_native_webgpu_render_pipeline_get_label(ptr->pipeline_);
96
+ if (label == nullptr) {
97
+ info.GetReturnValue().SetEmptyString();
98
+ return;
99
+ }
100
+ info.GetReturnValue().Set(
101
+ ConvertToV8String(info.GetIsolate(), label)
102
+ );
103
+ canvas_native_string_destroy(label);
104
+ return;
105
+ }
106
+
107
+ info.GetReturnValue().SetEmptyString();
108
+ }
109
+
@@ -37,6 +37,9 @@ public:
37
37
  return scope.Escape(object);
38
38
  }
39
39
 
40
+ static void GetLabel(v8::Local<v8::Name> name,
41
+ const v8::PropertyCallbackInfo<v8::Value> &info);
42
+
40
43
 
41
44
  static void GetBindGroupLayout(const v8::FunctionCallbackInfo <v8::Value> &args);
42
45
 
@@ -47,7 +47,33 @@ v8::Local<v8::FunctionTemplate> GPUSamplerImpl::GetCtor(v8::Isolate *isolate) {
47
47
  auto tmpl = ctorTmpl->InstanceTemplate();
48
48
  tmpl->SetInternalFieldCount(2);
49
49
 
50
+ tmpl->SetLazyDataProperty(
51
+ ConvertToV8String(isolate, "label"),
52
+ GetLabel
53
+ );
54
+
50
55
  cache->GPUSamplerTmpl =
51
56
  std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
52
57
  return ctorTmpl;
53
58
  }
59
+
60
+
61
+ void
62
+ GPUSamplerImpl::GetLabel(v8::Local<v8::Name> name,
63
+ const v8::PropertyCallbackInfo<v8::Value> &info) {
64
+ auto ptr = GetPointer(info.This());
65
+ if (ptr != nullptr) {
66
+ auto label = canvas_native_webgpu_sampler_get_label(ptr->sampler_);
67
+ if (label == nullptr) {
68
+ info.GetReturnValue().SetEmptyString();
69
+ return;
70
+ }
71
+ info.GetReturnValue().Set(
72
+ ConvertToV8String(info.GetIsolate(), label)
73
+ );
74
+ canvas_native_string_destroy(label);
75
+ return;
76
+ }
77
+
78
+ info.GetReturnValue().SetEmptyString();
79
+ }
@@ -9,7 +9,7 @@
9
9
  #include "Helpers.h"
10
10
  #include "ObjectWrapperImpl.h"
11
11
 
12
- class GPUSamplerImpl: ObjectWrapperImpl {
12
+ class GPUSamplerImpl : ObjectWrapperImpl {
13
13
  public:
14
14
  explicit GPUSamplerImpl(const CanvasGPUSampler *sampler);
15
15
 
@@ -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
 
40
43
  private:
41
44
  const CanvasGPUSampler *sampler_;
@@ -47,10 +47,34 @@ v8::Local<v8::FunctionTemplate> GPUShaderModuleImpl::GetCtor(v8::Isolate *isolat
47
47
  auto tmpl = ctorTmpl->InstanceTemplate();
48
48
  tmpl->SetInternalFieldCount(2);
49
49
 
50
+ tmpl->SetLazyDataProperty(
51
+ ConvertToV8String(isolate, "label"),
52
+ GetLabel
53
+ );
50
54
 
51
55
  cache->GPUShaderModuleTmpl =
52
56
  std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
53
57
  return ctorTmpl;
54
58
  }
55
59
 
60
+ void
61
+ GPUShaderModuleImpl::GetLabel(v8::Local<v8::Name> name,
62
+ const v8::PropertyCallbackInfo<v8::Value> &info) {
63
+ auto ptr = GetPointer(info.This());
64
+ if (ptr != nullptr) {
65
+ auto label = canvas_native_webgpu_shader_module_get_label(ptr->shaderModule_);
66
+ if (label == nullptr) {
67
+ info.GetReturnValue().SetEmptyString();
68
+ return;
69
+ }
70
+ info.GetReturnValue().Set(
71
+ ConvertToV8String(info.GetIsolate(), label)
72
+ );
73
+ canvas_native_string_destroy(label);
74
+ return;
75
+ }
76
+
77
+ info.GetReturnValue().SetEmptyString();
78
+ }
79
+
56
80
 
@@ -37,6 +37,9 @@ public:
37
37
  return scope.Escape(object);
38
38
  }
39
39
 
40
+ static void GetLabel(v8::Local<v8::Name> name,
41
+ const v8::PropertyCallbackInfo<v8::Value> &info);
42
+
40
43
  private:
41
44
  const CanvasGPUShaderModule *shaderModule_;
42
45
  };
@@ -5,6 +5,7 @@
5
5
  #include "GPUTextureImpl.h"
6
6
  #include "Caches.h"
7
7
  #include "GPUTextureViewImpl.h"
8
+ #include "GPULabel.h"
8
9
 
9
10
  GPUTextureImpl::GPUTextureImpl(const CanvasGPUTexture *texture) : texture_(texture) {}
10
11
 
@@ -47,6 +48,10 @@ v8::Local<v8::FunctionTemplate> GPUTextureImpl::GetCtor(v8::Isolate *isolate) {
47
48
  auto tmpl = ctorTmpl->InstanceTemplate();
48
49
  tmpl->SetInternalFieldCount(2);
49
50
 
51
+ tmpl->SetLazyDataProperty(
52
+ ConvertToV8String(isolate, "label"),
53
+ GetLabel
54
+ );
50
55
 
51
56
  tmpl->Set(
52
57
  ConvertToV8String(isolate, "destroy"),
@@ -107,6 +112,27 @@ v8::Local<v8::FunctionTemplate> GPUTextureImpl::GetCtor(v8::Isolate *isolate) {
107
112
  return ctorTmpl;
108
113
  }
109
114
 
115
+
116
+ void
117
+ GPUTextureImpl::GetLabel(v8::Local<v8::Name> name,
118
+ const v8::PropertyCallbackInfo<v8::Value> &info) {
119
+ auto ptr = GetPointer(info.This());
120
+ if (ptr != nullptr) {
121
+ auto label = canvas_native_webgpu_texture_get_label(ptr->texture_);
122
+ if (label == nullptr) {
123
+ info.GetReturnValue().SetEmptyString();
124
+ return;
125
+ }
126
+ info.GetReturnValue().Set(
127
+ ConvertToV8String(info.GetIsolate(), label)
128
+ );
129
+ canvas_native_string_destroy(label);
130
+ return;
131
+ }
132
+
133
+ info.GetReturnValue().SetEmptyString();
134
+ }
135
+
110
136
  void
111
137
  GPUTextureImpl::GetDimension(v8::Local<v8::Name> name,
112
138
  const v8::PropertyCallbackInfo<v8::Value> &info) {
@@ -249,6 +275,7 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
249
275
  aspect, 0, -1, 0, -1
250
276
  };
251
277
 
278
+ GPULabel label;
252
279
 
253
280
  if (descVal->IsObject()) {
254
281
  descriptor = new CanvasCreateTextureViewDescriptor{};
@@ -269,7 +296,6 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
269
296
  }
270
297
 
271
298
 
272
-
273
299
  v8::Local<v8::Value> arrayLayerCountVal;
274
300
  if (descObj->Get(context, ConvertToV8String(isolate, "arrayLayerCount")).ToLocal(
275
301
  &arrayLayerCountVal) && arrayLayerCountVal->IsInt32()) {
@@ -297,16 +323,15 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
297
323
  descriptor->range = &range;
298
324
 
299
325
 
300
-
301
326
  v8::Local<v8::Value> formatVal;
302
327
  descObj->Get(context, ConvertToV8String(isolate, "format")).ToLocal(&formatVal);
303
328
  auto formatStr = ConvertFromV8String(isolate, formatVal);
304
329
 
305
- descriptor->format = CanvasOptionalGPUTextureFormat {
306
- CanvasOptionalGPUTextureFormatNone
330
+ descriptor->format = CanvasOptionalGPUTextureFormat{
331
+ CanvasOptionalGPUTextureFormatNone
307
332
  };
308
333
 
309
- if (!formatStr.empty()){
334
+ if (!formatStr.empty()) {
310
335
  auto format = canvas_native_webgpu_enum_string_to_gpu_texture(formatStr.c_str());
311
336
  descriptor->format = format;
312
337
  }
@@ -317,9 +342,9 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
317
342
  v8::Local<v8::Value> labelVal;
318
343
  descObj->Get(context, ConvertToV8String(isolate, "label")).ToLocal(&labelVal);
319
344
 
320
- if (!labelVal.IsEmpty() && labelVal->IsString()) {
321
- descriptor->label = *v8::String::Utf8Value(isolate, labelVal);
322
- }
345
+ label = GPULabel(isolate, labelVal);
346
+
347
+ descriptor->label = *label;
323
348
 
324
349
  v8::Local<v8::Value> dimensionVal;
325
350
  if (descObj->Get(context, ConvertToV8String(isolate, "dimension")).ToLocal(&dimensionVal)) {
@@ -347,6 +372,7 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
347
372
 
348
373
  if (descriptor != nullptr) {
349
374
  delete descriptor;
375
+ descriptor = nullptr;
350
376
  }
351
377
 
352
378
  if (view != nullptr) {
@@ -36,6 +36,8 @@ 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);
39
41
 
40
42
 
41
43
  static void GetWidth(v8::Local<v8::Name> name,
@@ -46,8 +46,34 @@ v8::Local<v8::FunctionTemplate> GPUTextureViewImpl::GetCtor(v8::Isolate *isolate
46
46
  auto tmpl = ctorTmpl->InstanceTemplate();
47
47
  tmpl->SetInternalFieldCount(2);
48
48
 
49
+ tmpl->SetLazyDataProperty(
50
+ ConvertToV8String(isolate, "label"),
51
+ GetLabel
52
+ );
53
+
49
54
 
50
55
  cache->GPUTextureViewTmpl =
51
56
  std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
52
57
  return ctorTmpl;
53
58
  }
59
+
60
+
61
+ void
62
+ GPUTextureViewImpl::GetLabel(v8::Local<v8::Name> name,
63
+ const v8::PropertyCallbackInfo<v8::Value> &info) {
64
+ auto ptr = GetPointer(info.This());
65
+ if (ptr != nullptr) {
66
+ auto label = canvas_native_webgpu_texture_view_get_label(ptr->view_);
67
+ if (label == nullptr) {
68
+ info.GetReturnValue().SetEmptyString();
69
+ return;
70
+ }
71
+ info.GetReturnValue().Set(
72
+ ConvertToV8String(info.GetIsolate(), label)
73
+ );
74
+ canvas_native_string_destroy(label);
75
+ return;
76
+ }
77
+
78
+ info.GetReturnValue().SetEmptyString();
79
+ }
@@ -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
 
40
43
  private:
41
44
  const CanvasGPUTextureView *view_;