@nativescript/canvas 2.0.0-beta.8 → 2.0.0-webgpu.0

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 (284) hide show
  1. package/Canvas/common.d.ts +23 -15
  2. package/Canvas/common.js +125 -56
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +5 -7
  5. package/Canvas/index.android.js +61 -133
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +4 -1
  8. package/Canvas/index.ios.d.ts +6 -6
  9. package/Canvas/index.ios.js +75 -85
  10. package/Canvas/index.ios.js.map +1 -1
  11. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -1
  12. package/Canvas2D/CanvasRenderingContext2D/index.js +8 -11
  13. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  14. package/Canvas2D/DOMMatrix/index.d.ts +14 -0
  15. package/Canvas2D/DOMMatrix/index.js +62 -0
  16. package/Canvas2D/DOMMatrix/index.js.map +1 -1
  17. package/Canvas2D/ImageData/index.js +4 -6
  18. package/Canvas2D/ImageData/index.js.map +1 -1
  19. package/ImageAsset/index.d.ts +1 -0
  20. package/ImageAsset/index.js +49 -0
  21. package/ImageAsset/index.js.map +1 -1
  22. package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
  23. package/WebGL/WebGLRenderingContext/index.js +104 -14
  24. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  25. package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
  26. package/WebGL2/WebGL2RenderingContext/index.js +2 -3
  27. package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
  28. package/WebGPU/Constants.d.ts +36 -0
  29. package/WebGPU/Constants.js +42 -0
  30. package/WebGPU/Constants.js.map +1 -0
  31. package/WebGPU/Errors.d.ts +18 -0
  32. package/WebGPU/Errors.js +21 -0
  33. package/WebGPU/Errors.js.map +1 -0
  34. package/WebGPU/GPU.d.ts +13 -0
  35. package/WebGPU/GPU.js +35 -0
  36. package/WebGPU/GPU.js.map +1 -0
  37. package/WebGPU/GPUAdapter.d.ts +23 -0
  38. package/WebGPU/GPUAdapter.js +62 -0
  39. package/WebGPU/GPUAdapter.js.map +1 -0
  40. package/WebGPU/GPUAdapterInfo.d.ts +9 -0
  41. package/WebGPU/GPUAdapterInfo.js +24 -0
  42. package/WebGPU/GPUAdapterInfo.js.map +1 -0
  43. package/WebGPU/GPUBindGroup.d.ts +5 -0
  44. package/WebGPU/GPUBindGroup.js +12 -0
  45. package/WebGPU/GPUBindGroup.js.map +1 -0
  46. package/WebGPU/GPUBindGroupLayout.d.ts +5 -0
  47. package/WebGPU/GPUBindGroupLayout.js +12 -0
  48. package/WebGPU/GPUBindGroupLayout.js.map +1 -0
  49. package/WebGPU/GPUBuffer.d.ts +15 -0
  50. package/WebGPU/GPUBuffer.js +54 -0
  51. package/WebGPU/GPUBuffer.js.map +1 -0
  52. package/WebGPU/GPUCanvasContext.d.ts +33 -0
  53. package/WebGPU/GPUCanvasContext.js +67 -0
  54. package/WebGPU/GPUCanvasContext.js.map +1 -0
  55. package/WebGPU/GPUCommandBuffer.d.ts +5 -0
  56. package/WebGPU/GPUCommandBuffer.js +12 -0
  57. package/WebGPU/GPUCommandBuffer.js.map +1 -0
  58. package/WebGPU/GPUCommandEncoder.d.ts +41 -0
  59. package/WebGPU/GPUCommandEncoder.js +105 -0
  60. package/WebGPU/GPUCommandEncoder.js.map +1 -0
  61. package/WebGPU/GPUComputePassEncoder.d.ts +16 -0
  62. package/WebGPU/GPUComputePassEncoder.js +50 -0
  63. package/WebGPU/GPUComputePassEncoder.js.map +1 -0
  64. package/WebGPU/GPUComputePipeline.d.ts +7 -0
  65. package/WebGPU/GPUComputePipeline.js +16 -0
  66. package/WebGPU/GPUComputePipeline.js.map +1 -0
  67. package/WebGPU/GPUDevice.d.ts +173 -0
  68. package/WebGPU/GPUDevice.js +381 -0
  69. package/WebGPU/GPUDevice.js.map +1 -0
  70. package/WebGPU/GPUDeviceLostInfo.d.ts +1 -0
  71. package/WebGPU/GPUDeviceLostInfo.js +10 -0
  72. package/WebGPU/GPUDeviceLostInfo.js.map +1 -0
  73. package/WebGPU/GPUExternalTexture.d.ts +5 -0
  74. package/WebGPU/GPUExternalTexture.js +12 -0
  75. package/WebGPU/GPUExternalTexture.js.map +1 -0
  76. package/WebGPU/GPUPipelineLayout.d.ts +5 -0
  77. package/WebGPU/GPUPipelineLayout.js +12 -0
  78. package/WebGPU/GPUPipelineLayout.js.map +1 -0
  79. package/WebGPU/GPUQuerySet.d.ts +5 -0
  80. package/WebGPU/GPUQuerySet.js +12 -0
  81. package/WebGPU/GPUQuerySet.js.map +1 -0
  82. package/WebGPU/GPUQueue.d.ts +14 -0
  83. package/WebGPU/GPUQueue.js +77 -0
  84. package/WebGPU/GPUQueue.js.map +1 -0
  85. package/WebGPU/GPURenderBundle.d.ts +5 -0
  86. package/WebGPU/GPURenderBundle.js +12 -0
  87. package/WebGPU/GPURenderBundle.js.map +1 -0
  88. package/WebGPU/GPURenderBundleEncoder.d.ts +20 -0
  89. package/WebGPU/GPURenderBundleEncoder.js +61 -0
  90. package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
  91. package/WebGPU/GPURenderPassEncoder.d.ts +29 -0
  92. package/WebGPU/GPURenderPassEncoder.js +94 -0
  93. package/WebGPU/GPURenderPassEncoder.js.map +1 -0
  94. package/WebGPU/GPURenderPipeline.d.ts +7 -0
  95. package/WebGPU/GPURenderPipeline.js +16 -0
  96. package/WebGPU/GPURenderPipeline.js.map +1 -0
  97. package/WebGPU/GPUSampler.d.ts +5 -0
  98. package/WebGPU/GPUSampler.js +12 -0
  99. package/WebGPU/GPUSampler.js.map +1 -0
  100. package/WebGPU/GPUShaderModule.d.ts +6 -0
  101. package/WebGPU/GPUShaderModule.js +15 -0
  102. package/WebGPU/GPUShaderModule.js.map +1 -0
  103. package/WebGPU/GPUTexture.d.ts +16 -0
  104. package/WebGPU/GPUTexture.js +41 -0
  105. package/WebGPU/GPUTexture.js.map +1 -0
  106. package/WebGPU/GPUTextureView.d.ts +5 -0
  107. package/WebGPU/GPUTextureView.js +12 -0
  108. package/WebGPU/GPUTextureView.js.map +1 -0
  109. package/WebGPU/Interfaces.d.ts +155 -0
  110. package/WebGPU/Interfaces.js +2 -0
  111. package/WebGPU/Interfaces.js.map +1 -0
  112. package/WebGPU/Types.d.ts +39 -0
  113. package/WebGPU/Types.js +2 -0
  114. package/WebGPU/Types.js.map +1 -0
  115. package/WebGPU/Utils.d.ts +1 -0
  116. package/WebGPU/Utils.js +75 -0
  117. package/WebGPU/Utils.js.map +1 -0
  118. package/WebGPU/index.d.ts +28 -0
  119. package/WebGPU/index.js +29 -0
  120. package/WebGPU/index.js.map +1 -0
  121. package/index.d.ts +1 -1
  122. package/index.js +22 -1
  123. package/index.js.map +1 -1
  124. package/package.json +1 -4
  125. package/platforms/android/canvas-release.aar +0 -0
  126. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  127. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +23 -23
  128. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +47 -8
  129. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2280 -103
  130. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  131. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  132. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1564 -3814
  133. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +27 -34
  134. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  135. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +27 -34
  136. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  137. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +602 -664
  138. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  139. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +46 -46
  140. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +47 -8
  141. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2280 -103
  142. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  143. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  144. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  145. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1564 -3814
  146. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +27 -34
  147. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  148. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +27 -34
  149. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1564 -3814
  150. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +27 -34
  151. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  152. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +27 -34
  153. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +31 -31
  154. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  155. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +604 -663
  156. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +638 -642
  157. package/platforms/ios/build.xcconfig +3 -1
  158. package/platforms/ios/src/cpp/Caches.h +69 -1
  159. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +320 -395
  160. package/platforms/ios/src/cpp/CanvasJSIModule.h +7 -1
  161. package/platforms/ios/src/cpp/Helpers.h +43 -8
  162. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +35 -37
  163. package/platforms/ios/src/cpp/ImageAssetImpl.h +14 -10
  164. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +2 -2
  165. package/platforms/ios/src/cpp/ImageBitmapImpl.h +1 -1
  166. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +0 -10
  167. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +41 -4
  168. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +409 -3
  169. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +27 -0
  170. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +131 -149
  171. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1766 -1659
  172. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +302 -0
  173. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +63 -0
  174. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +174 -0
  175. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +58 -0
  176. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +53 -0
  177. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +45 -0
  178. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +53 -0
  179. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +45 -0
  180. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +229 -0
  181. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +59 -0
  182. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +317 -0
  183. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +55 -0
  184. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +54 -0
  185. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +45 -0
  186. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1087 -0
  187. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +69 -0
  188. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +260 -0
  189. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +62 -0
  190. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +84 -0
  191. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +49 -0
  192. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +2741 -0
  193. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +95 -0
  194. package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +186 -0
  195. package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
  196. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +54 -0
  197. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +46 -0
  198. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +137 -0
  199. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
  200. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +521 -0
  201. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +56 -0
  202. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +469 -0
  203. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +71 -0
  204. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +53 -0
  205. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +45 -0
  206. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +653 -0
  207. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +85 -0
  208. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +84 -0
  209. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +49 -0
  210. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +53 -0
  211. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +45 -0
  212. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +56 -0
  213. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +45 -0
  214. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +1304 -0
  215. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +288 -0
  216. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +360 -0
  217. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +75 -0
  218. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +53 -0
  219. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +45 -0
  220. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +178 -0
  221. package/SVG/Circle.d.ts +0 -11
  222. package/SVG/Circle.js +0 -21
  223. package/SVG/Circle.js.map +0 -1
  224. package/SVG/ClipPath.d.ts +0 -4
  225. package/SVG/ClipPath.js +0 -9
  226. package/SVG/ClipPath.js.map +0 -1
  227. package/SVG/Defs.d.ts +0 -4
  228. package/SVG/Defs.js +0 -9
  229. package/SVG/Defs.js.map +0 -1
  230. package/SVG/Ellipse.d.ts +0 -13
  231. package/SVG/Ellipse.js +0 -26
  232. package/SVG/Ellipse.js.map +0 -1
  233. package/SVG/G.d.ts +0 -7
  234. package/SVG/G.js +0 -9
  235. package/SVG/G.js.map +0 -1
  236. package/SVG/Image.d.ts +0 -11
  237. package/SVG/Image.js +0 -40
  238. package/SVG/Image.js.map +0 -1
  239. package/SVG/Line.d.ts +0 -13
  240. package/SVG/Line.js +0 -26
  241. package/SVG/Line.js.map +0 -1
  242. package/SVG/LinearGradient.d.ts +0 -10
  243. package/SVG/LinearGradient.js +0 -13
  244. package/SVG/LinearGradient.js.map +0 -1
  245. package/SVG/Path.d.ts +0 -7
  246. package/SVG/Path.js +0 -14
  247. package/SVG/Path.js.map +0 -1
  248. package/SVG/Pattern.d.ts +0 -4
  249. package/SVG/Pattern.js +0 -9
  250. package/SVG/Pattern.js.map +0 -1
  251. package/SVG/Polygon.d.ts +0 -7
  252. package/SVG/Polygon.js +0 -14
  253. package/SVG/Polygon.js.map +0 -1
  254. package/SVG/Polyline.d.ts +0 -7
  255. package/SVG/Polyline.js +0 -14
  256. package/SVG/Polyline.js.map +0 -1
  257. package/SVG/Rect.d.ts +0 -8
  258. package/SVG/Rect.js +0 -13
  259. package/SVG/Rect.js.map +0 -1
  260. package/SVG/SVG.d.ts +0 -32
  261. package/SVG/SVG.js +0 -204
  262. package/SVG/SVG.js.map +0 -1
  263. package/SVG/SVGItem.d.ts +0 -5
  264. package/SVG/SVGItem.js +0 -8
  265. package/SVG/SVGItem.js.map +0 -1
  266. package/SVG/Stop.d.ts +0 -5
  267. package/SVG/Stop.js +0 -9
  268. package/SVG/Stop.js.map +0 -1
  269. package/SVG/Symbol.d.ts +0 -4
  270. package/SVG/Symbol.js +0 -9
  271. package/SVG/Symbol.js.map +0 -1
  272. package/SVG/Text.d.ts +0 -14
  273. package/SVG/Text.js +0 -26
  274. package/SVG/Text.js.map +0 -1
  275. package/SVG/Use.d.ts +0 -4
  276. package/SVG/Use.js +0 -9
  277. package/SVG/Use.js.map +0 -1
  278. package/SVG/index.d.ts +0 -18
  279. package/SVG/index.js +0 -19
  280. package/SVG/index.js.map +0 -1
  281. package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
  282. package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
  283. package/platforms/ios/src/cpp/URLImpl.cpp +0 -464
  284. package/platforms/ios/src/cpp/URLImpl.h +0 -121
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GPUCanvasContext.js","sourceRoot":"","sources":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YAC3B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;YAEvE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBACzB,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;aAChD;YAED,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;gBACvB,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;aAC5C;SACD;QAED,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,WAAW;QACV,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;IAED,iBAAiB;QAChB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAClD,IAAI,OAAO,EAAE;YACZ,OAAO,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACtC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAED,cAAc,CAAC,OAAmB;QACjC,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,eAAe,CAAC,OAAmB;QAMlC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;CACD;AArFA;IACC,OAAO,CAAC,UAAU,EAAE,CAAC;AACtB,CAAC,GAAA,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { native_ } from './Constants';
2
+ export declare class GPUCommandBuffer {
3
+ [native_]: any;
4
+ static fromNative(commandBuffer: any): GPUCommandBuffer;
5
+ }
@@ -0,0 +1,12 @@
1
+ import { native_ } from './Constants';
2
+ export class GPUCommandBuffer {
3
+ static fromNative(commandBuffer) {
4
+ if (commandBuffer) {
5
+ const ret = new GPUCommandBuffer();
6
+ ret[native_] = commandBuffer;
7
+ return ret;
8
+ }
9
+ return null;
10
+ }
11
+ }
12
+ //# sourceMappingURL=GPUCommandBuffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GPUCommandBuffer.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUCommandBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,OAAO,gBAAgB;IAE5B,MAAM,CAAC,UAAU,CAAC,aAAa;QAC9B,IAAI,aAAa,EAAE;YAClB,MAAM,GAAG,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACnC,GAAG,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC;YAC7B,OAAO,GAAG,CAAC;SACX;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
@@ -0,0 +1,41 @@
1
+ import { native_ } from './Constants';
2
+ import { GPUBuffer } from './GPUBuffer';
3
+ import { GPUCommandBuffer } from './GPUCommandBuffer';
4
+ import { GPUComputePassEncoder } from './GPUComputePassEncoder';
5
+ import { GPUQuerySet } from './GPUQuerySet';
6
+ import { GPURenderPassEncoder } from './GPURenderPassEncoder';
7
+ import { GPUImageCopyBuffer, GPUImageCopyTexture, GPURenderPassColorAttachment, GPURenderPassDepthStencilAttachment, GPURenderPassTimestampWrites } from './Interfaces';
8
+ import { GPUExtent3D } from './Types';
9
+ export declare class GPUCommandEncoder {
10
+ [native_]: any;
11
+ static fromNative(encoder: any): GPUCommandEncoder;
12
+ beginComputePass(descriptor?: {
13
+ label?: string;
14
+ timestampWrites?: {
15
+ beginningOfPassWriteIndex: number;
16
+ endOfPassWriteIndex: number;
17
+ querySet: GPUQuerySet;
18
+ };
19
+ }): GPUComputePassEncoder;
20
+ beginRenderPass(descriptor: {
21
+ colorAttachments: (null | GPURenderPassColorAttachment)[];
22
+ depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
23
+ label?: string;
24
+ maxDrawCount?: number;
25
+ occlusionQuerySet?: GPUQuerySet;
26
+ timestampWrites?: GPURenderPassTimestampWrites;
27
+ }): GPURenderPassEncoder;
28
+ clearBuffer(buffer: GPUBuffer, offset?: number, size?: number): void;
29
+ copyBufferToBuffer(source: GPUBuffer, sourceOffset: number, destination: GPUBuffer, destinationOffset: number, size: number): void;
30
+ copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
31
+ copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D): void;
32
+ copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
33
+ finish(descriptor?: {
34
+ label?: string;
35
+ }): GPUCommandBuffer;
36
+ insertDebugMarker(markerLabel: string): void;
37
+ popDebugGroup(): void;
38
+ pushDebugGroup(groupLabel: string): void;
39
+ resolveQuerySet(querySet: GPUQuerySet, firstQuery: number, queryCount: number, destination: GPUBuffer, destinationOffset: number): void;
40
+ writeTimestamp(querySet: GPUQuerySet, queryIndex: number): void;
41
+ }
@@ -0,0 +1,105 @@
1
+ import { native_ } from './Constants';
2
+ import { GPUCommandBuffer } from './GPUCommandBuffer';
3
+ import { GPUComputePassEncoder } from './GPUComputePassEncoder';
4
+ import { GPURenderPassEncoder } from './GPURenderPassEncoder';
5
+ export class GPUCommandEncoder {
6
+ static fromNative(encoder) {
7
+ if (encoder) {
8
+ const ret = new GPUCommandEncoder();
9
+ ret[native_] = encoder;
10
+ return ret;
11
+ }
12
+ return null;
13
+ }
14
+ beginComputePass(descriptor) {
15
+ if (descriptor?.timestampWrites) {
16
+ descriptor.timestampWrites.querySet = descriptor.timestampWrites.querySet[native_];
17
+ }
18
+ return GPUComputePassEncoder.fromNative(this[native_].beginComputePass(descriptor));
19
+ }
20
+ beginRenderPass(descriptor) {
21
+ descriptor.colorAttachments = descriptor.colorAttachments.map((attachment) => {
22
+ if (Array.isArray(attachment.clearValue)) {
23
+ attachment.clearValue = { r: attachment.clearValue[0], g: attachment.clearValue[1], b: attachment.clearValue[2], a: attachment.clearValue[3] };
24
+ }
25
+ attachment.view = attachment.view[native_];
26
+ if (attachment.resolveTarget) {
27
+ attachment.resolveTarget = attachment.resolveTarget[native_];
28
+ }
29
+ return attachment;
30
+ });
31
+ if (descriptor?.depthStencilAttachment?.view?.[native_]) {
32
+ descriptor.depthStencilAttachment.view = descriptor.depthStencilAttachment.view[native_];
33
+ }
34
+ if (descriptor?.occlusionQuerySet) {
35
+ descriptor.occlusionQuerySet = descriptor.occlusionQuerySet[native_];
36
+ }
37
+ if (descriptor?.timestampWrites?.querySet) {
38
+ descriptor.timestampWrites.querySet = descriptor.timestampWrites.querySet[native_];
39
+ }
40
+ const passEncoder = this[native_].beginRenderPass(descriptor);
41
+ return GPURenderPassEncoder.fromNative(passEncoder);
42
+ }
43
+ clearBuffer(buffer, offset, size) {
44
+ this[native_].clearBuffer(buffer[native_], offset ?? -1, size ?? -1);
45
+ }
46
+ copyBufferToBuffer(source, sourceOffset, destination, destinationOffset, size) {
47
+ this[native_].copyBufferToBuffer(source[native_], sourceOffset, destination[native_], destinationOffset, size);
48
+ }
49
+ copyBufferToTexture(source, destination, copySize) {
50
+ source.buffer = source.buffer[native_];
51
+ destination.texture = destination.texture[native_];
52
+ if (Array.isArray(copySize)) {
53
+ copySize = {
54
+ width: copySize[0],
55
+ height: copySize[1] ?? 1,
56
+ depthOrArrayLayers: copySize[2] ?? 1,
57
+ };
58
+ }
59
+ this[native_].copyBufferToTexture(source, destination, copySize);
60
+ }
61
+ copyTextureToBuffer(source, destination, copySize) {
62
+ source.texture = source.texture[native_];
63
+ destination.buffer = destination.buffer[native_];
64
+ if (Array.isArray(copySize)) {
65
+ copySize = {
66
+ width: copySize[0],
67
+ height: copySize[1] ?? 1,
68
+ depthOrArrayLayers: copySize[2] ?? 1,
69
+ };
70
+ }
71
+ this[native_].copyTextureToBuffer(source, destination, copySize);
72
+ }
73
+ copyTextureToTexture(source, destination, copySize) {
74
+ source.texture = source.texture[native_];
75
+ destination.texture = destination.texture[native_];
76
+ if (Array.isArray(copySize)) {
77
+ copySize = {
78
+ width: copySize[0],
79
+ height: copySize[1] ?? 1,
80
+ depthOrArrayLayers: copySize[2] ?? 1,
81
+ };
82
+ }
83
+ this[native_].copyTextureToTexture(source, destination, copySize);
84
+ }
85
+ finish(descriptor) {
86
+ const ret = this[native_].finish(descriptor);
87
+ return GPUCommandBuffer.fromNative(ret);
88
+ }
89
+ insertDebugMarker(markerLabel) {
90
+ this[native_].insertDebugMarker(markerLabel);
91
+ }
92
+ popDebugGroup() {
93
+ this[native_].popDebugGroup();
94
+ }
95
+ pushDebugGroup(groupLabel) {
96
+ this[native_].pushDebugGroup(groupLabel);
97
+ }
98
+ resolveQuerySet(querySet, firstQuery, queryCount, destination, destinationOffset) {
99
+ this[native_].resolveQuerySet(querySet[native_], firstQuery, queryCount, destination[native_], destinationOffset);
100
+ }
101
+ writeTimestamp(querySet, queryIndex) {
102
+ this[native_].writeTimestamp(querySet[native_], queryIndex);
103
+ }
104
+ }
105
+ //# sourceMappingURL=GPUCommandEncoder.js.map
@@ -0,0 +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;AAI9D,MAAM,OAAO,iBAAiB;IAG7B,MAAM,CAAC,UAAU,CAAC,OAAO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,IAAI,CAAC;gBACxB,kBAAkB,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;aACpC,CAAC;SACF;QAED,IAAI,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,UAA+B;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC7C,OAAO,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,iBAAiB,CAAC,WAAmB;QACpC,IAAI,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;IAED,aAAa;QACZ,IAAI,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC;IAED,cAAc,CAAC,UAAkB;QAChC,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,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"}
@@ -0,0 +1,16 @@
1
+ import { native_ } from './Constants';
2
+ import { GPUBindGroup } from './GPUBindGroup';
3
+ import { GPUBuffer } from './GPUBuffer';
4
+ import { GPUComputePipeline } from './GPUComputePipeline';
5
+ export declare class GPUComputePassEncoder {
6
+ [native_]: any;
7
+ dispatchWorkgroups(workgroupCountX: number, workgroupCountY?: number, workgroupCountZ?: number): void;
8
+ dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;
9
+ end(): void;
10
+ insertDebugMarker(markerLabel: string): void;
11
+ popDebugGroup(): void;
12
+ pushDebugGroup(groupLabel: string): void;
13
+ setBindGroup(index: number, bindGroup: GPUBindGroup, dynamicOffsetsData?: number[] | Uint32Array, dynamicOffsetsDataStart?: number, dynamicOffsetsDataLength?: number): void;
14
+ setPipeline(renderPipeline: GPUComputePipeline): void;
15
+ static fromNative(pass: any): GPUComputePassEncoder;
16
+ }
@@ -0,0 +1,50 @@
1
+ import { native_ } from './Constants';
2
+ export class GPUComputePassEncoder {
3
+ dispatchWorkgroups(workgroupCountX, workgroupCountY = 1, workgroupCountZ = 1) {
4
+ this[native_].dispatchWorkgroups(workgroupCountX, workgroupCountY ?? 1, workgroupCountZ ?? 1);
5
+ }
6
+ dispatchWorkgroupsIndirect(indirectBuffer, indirectOffset) {
7
+ this[native_].dispatchWorkgroupsIndirect(indirectBuffer[native_], indirectOffset);
8
+ }
9
+ end() {
10
+ this[native_].end();
11
+ this[native_] = null;
12
+ }
13
+ insertDebugMarker(markerLabel) {
14
+ this[native_].insertDebugMarker(markerLabel);
15
+ }
16
+ popDebugGroup() {
17
+ this[native_].popDebugGroup();
18
+ }
19
+ pushDebugGroup(groupLabel) {
20
+ this[native_].pushDebugGroup(groupLabel);
21
+ }
22
+ setBindGroup(index, bindGroup, dynamicOffsetsData, dynamicOffsetsDataStart, dynamicOffsetsDataLength) {
23
+ const group = bindGroup?.[native_];
24
+ if (!group) {
25
+ return;
26
+ }
27
+ if (Array.isArray(dynamicOffsetsData)) {
28
+ const data = new Uint32Array(dynamicOffsetsData);
29
+ this[native_].setBindGroup(index, group, data, 0, data.length);
30
+ }
31
+ else if (dynamicOffsetsData instanceof Uint32Array) {
32
+ this[native_].setBindGroup(index, group, dynamicOffsetsData, dynamicOffsetsDataStart, dynamicOffsetsDataLength);
33
+ }
34
+ else {
35
+ this[native_].setBindGroup(index, group);
36
+ }
37
+ }
38
+ setPipeline(renderPipeline) {
39
+ this[native_].setPipeline(renderPipeline[native_]);
40
+ }
41
+ static fromNative(pass) {
42
+ if (pass) {
43
+ const ret = new GPUComputePassEncoder();
44
+ ret[native_] = pass;
45
+ return ret;
46
+ }
47
+ return null;
48
+ }
49
+ }
50
+ //# sourceMappingURL=GPUComputePassEncoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GPUComputePassEncoder.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUComputePassEncoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKtC,MAAM,OAAO,qBAAqB;IAGjC,kBAAkB,CAAC,eAAuB,EAAE,kBAA0B,CAAC,EAAE,kBAA0B,CAAC;QACnG,IAAI,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,eAAe,EAAE,eAAe,IAAI,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC;IAC/F,CAAC;IAED,0BAA0B,CAAC,cAAyB,EAAE,cAAsB;QAC3E,IAAI,CAAC,OAAO,CAAC,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC;IACnF,CAAC;IAED,GAAG;QACF,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,iBAAiB,CAAC,WAAmB;QACpC,IAAI,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;IAED,aAAa;QACZ,IAAI,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC;IAED,cAAc,CAAC,UAAkB;QAChC,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,YAAY,CAAC,KAAa,EAAE,SAAuB,EAAE,kBAA2C,EAAE,uBAAgC,EAAE,wBAAiC;QACpK,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,EAAE;YACX,OAAO;SACP;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;YACtC,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,kBAAkB,CAAC,CAAC;YACjD,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SAC/D;aAAM,IAAI,kBAAkB,YAAY,WAAW,EAAE;YACrD,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,wBAAwB,CAAC,CAAC;SAChH;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACzC;IACF,CAAC;IAED,WAAW,CAAC,cAAkC;QAC7C,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,IAAI;QACrB,IAAI,IAAI,EAAE;YACT,MAAM,GAAG,GAAG,IAAI,qBAAqB,EAAE,CAAC;YACxC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YACpB,OAAO,GAAG,CAAC;SACX;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
@@ -0,0 +1,7 @@
1
+ import { native_ } from './Constants';
2
+ import { GPUBindGroupLayout } from './GPUBindGroupLayout';
3
+ export declare class GPUComputePipeline {
4
+ [native_]: any;
5
+ getBindGroupLayout(index: number): GPUBindGroupLayout;
6
+ static fromNative(pipeline: any): GPUComputePipeline;
7
+ }
@@ -0,0 +1,16 @@
1
+ import { native_ } from './Constants';
2
+ import { GPUBindGroupLayout } from './GPUBindGroupLayout';
3
+ export class GPUComputePipeline {
4
+ getBindGroupLayout(index) {
5
+ return GPUBindGroupLayout.fromNative(this[native_].getBindGroupLayout(index));
6
+ }
7
+ static fromNative(pipeline) {
8
+ if (pipeline) {
9
+ const ret = new GPUComputePipeline();
10
+ ret[native_] = pipeline;
11
+ return ret;
12
+ }
13
+ return null;
14
+ }
15
+ }
16
+ //# sourceMappingURL=GPUComputePipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GPUComputePipeline.js","sourceRoot":"","sources":["../../../../packages/canvas/WebGPU/GPUComputePipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,kBAAkB;IAG9B,kBAAkB,CAAC,KAAa;QAC/B,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ;QACzB,IAAI,QAAQ,EAAE;YACb,MAAM,GAAG,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACrC,GAAG,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;YACxB,OAAO,GAAG,CAAC;SACX;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
@@ -0,0 +1,173 @@
1
+ import { Observable } from '@nativescript/core';
2
+ import { GPUBuffer } from './GPUBuffer';
3
+ import { GPUTexture } from './GPUTexture';
4
+ import { native_ } from './Constants';
5
+ import { GPUShaderModule } from './GPUShaderModule';
6
+ import { GPUQueue } from './GPUQueue';
7
+ import { GPUPipelineLayout } from './GPUPipelineLayout';
8
+ import { GPURenderPipeline } from './GPURenderPipeline';
9
+ import { GPUCommandEncoder } from './GPUCommandEncoder';
10
+ import { GPUDeviceLostInfo } from './Errors';
11
+ import { GPUBindGroup } from './GPUBindGroup';
12
+ import { GPUBindGroupLayout } from './GPUBindGroupLayout';
13
+ import { GPUTextureView } from './GPUTextureView';
14
+ import { GPUSampler } from './GPUSampler';
15
+ import { GPUExternalTexture } from './GPUExternalTexture';
16
+ import type { GPUAddressMode, GPUCompareFunction, GPUErrorFilter, GPUFilterMode, GPUMipmapFilterMode, GPUQueryType, GPUTextureFormat, GPUTextureSampleType, GPUTextureViewDimension } from './Types';
17
+ import type { GPUDepthStencilState, GPUExternalTextureBindingLayout, GPUFragmentState, GPUMultisampleState, GPUPrimitiveState, GPUProgrammableStage, GPUVertexState } from './Interfaces';
18
+ import { GPUComputePipeline } from './GPUComputePipeline';
19
+ import { GPUQuerySet } from './GPUQuerySet';
20
+ import { GPURenderBundleEncoder } from './GPURenderBundleEncoder';
21
+ import { GPUAdapter } from './GPUAdapter';
22
+ export declare class EventTarget {
23
+ _emitter?: WeakRef<Observable>;
24
+ addEventListener(event: string, handler: any, options?: AddEventListenerOptions): void;
25
+ removeEventListener(event: string, handler?: any): void;
26
+ dispatchEvent(event: any): void;
27
+ }
28
+ interface GPUExtent3DDict {
29
+ width: number;
30
+ height?: number;
31
+ depthOrArrayLayers?: number;
32
+ }
33
+ declare type GPUExtent3D = [number, number, number] | [number, number] | GPUExtent3DDict;
34
+ export declare class GPUDevice extends EventTarget {
35
+ [native_]: any;
36
+ label: string;
37
+ _lostPromise: Promise<GPUDeviceLostInfo>;
38
+ _observerable: Observable;
39
+ constructor();
40
+ private _uncapturederror;
41
+ static fromNative(device: any, adapter: GPUAdapter): GPUDevice;
42
+ get lost(): Promise<GPUDeviceLostInfo>;
43
+ get native(): any;
44
+ get limits(): any;
45
+ get features(): any;
46
+ destroy(): void;
47
+ createBindGroup(descriptor: {
48
+ label?: string;
49
+ layout: GPUBindGroupLayout;
50
+ entries: {
51
+ binding: number;
52
+ resource: GPUTextureView | GPUSampler | GPUExternalTexture | {
53
+ buffer: GPUBuffer;
54
+ offset?: number;
55
+ size?: number;
56
+ };
57
+ }[];
58
+ }): GPUBindGroup;
59
+ createBindGroupLayout(descriptor: {
60
+ label?: string;
61
+ entries: {
62
+ binding: number;
63
+ visibility: number;
64
+ buffer?: {
65
+ hasDynamicOffset?: boolean;
66
+ minBindingSize?: number;
67
+ type?: 'uniform' | 'storage' | 'read-only-storage';
68
+ };
69
+ externalTexture?: GPUExternalTextureBindingLayout;
70
+ sampler?: {
71
+ type?: 'filtering' | 'non-filtering' | 'comparison';
72
+ };
73
+ storageTexture?: {
74
+ access?: 'write-only' | 'read-only' | 'read-write';
75
+ format: GPUTextureFormat;
76
+ viewDimension?: GPUTextureViewDimension;
77
+ };
78
+ texture?: {
79
+ multisampled?: boolean;
80
+ sampleType?: GPUTextureSampleType;
81
+ viewDimension?: GPUTextureViewDimension;
82
+ };
83
+ }[];
84
+ }): GPUBindGroupLayout;
85
+ createBuffer(descriptor: {
86
+ label?: string;
87
+ mappedAtCreation?: boolean;
88
+ size: number;
89
+ usage: number;
90
+ }): GPUBuffer;
91
+ createCommandEncoder(descriptor?: {
92
+ label?: string;
93
+ }): GPUCommandEncoder;
94
+ createComputePipeline(descriptor: {
95
+ compute: GPUProgrammableStage;
96
+ label?: string;
97
+ layout: GPUPipelineLayout | 'auto';
98
+ }): GPUComputePipeline;
99
+ createComputePipelineAsync(descriptor: {
100
+ compute: GPUProgrammableStage;
101
+ label?: string;
102
+ layout: GPUPipelineLayout | 'auto';
103
+ }): Promise<unknown>;
104
+ createPipelineLayout(descriptor: {
105
+ bindGroupLayouts: GPUBindGroupLayout[];
106
+ label?: string;
107
+ }): GPUPipelineLayout;
108
+ createQuerySet(descriptor: {
109
+ count: number;
110
+ label?: string;
111
+ type: GPUQueryType;
112
+ }): GPUQuerySet;
113
+ createRenderBundleEncoder(descriptor: {
114
+ colorFormats: (null | GPUTextureFormat)[];
115
+ depthReadOnly?: boolean;
116
+ depthStencilFormat?: GPUTextureFormat;
117
+ label?: string;
118
+ sampleCount?: number;
119
+ stencilReadOnly?: boolean;
120
+ }): GPURenderBundleEncoder;
121
+ createRenderPipeline(descriptor: {
122
+ depthStencil?: GPUDepthStencilState;
123
+ fragment?: GPUFragmentState;
124
+ label?: string;
125
+ layout: GPUPipelineLayout | 'auto';
126
+ multisample?: GPUMultisampleState;
127
+ primitive?: GPUPrimitiveState;
128
+ vertex: GPUVertexState;
129
+ }): GPURenderPipeline;
130
+ createRenderPipelineAsync(descriptor: {
131
+ depthStencil?: GPUDepthStencilState;
132
+ fragment?: GPUFragmentState;
133
+ label?: string;
134
+ layout: GPUPipelineLayout | 'auto';
135
+ multisample?: GPUMultisampleState;
136
+ primitive?: GPUPrimitiveState;
137
+ vertex: GPUVertexState;
138
+ }): Promise<unknown>;
139
+ createSampler(descriptor?: {
140
+ addressModeU?: GPUAddressMode;
141
+ addressModeV?: GPUAddressMode;
142
+ addressModeW?: GPUAddressMode;
143
+ compare?: GPUCompareFunction;
144
+ label?: string;
145
+ lodMaxClamp?: number;
146
+ lodMinClamp?: number;
147
+ magFilter?: GPUFilterMode;
148
+ maxAnisotropy?: number;
149
+ minFilter?: GPUFilterMode;
150
+ mipmapFilter?: GPUMipmapFilterMode;
151
+ }): GPUSampler;
152
+ createShaderModule(desc: {
153
+ label?: string;
154
+ code: string;
155
+ sourceMap?: object;
156
+ compilationHints?: any[];
157
+ }): GPUShaderModule;
158
+ createTexture(descriptor: {
159
+ label?: string;
160
+ size: GPUExtent3D;
161
+ mipLevelCount?: number;
162
+ sampleCount?: number;
163
+ dimension?: '1d' | '2d' | '3d';
164
+ format: any;
165
+ usage: any;
166
+ viewFormats?: any[];
167
+ }): GPUTexture;
168
+ popErrorScope(): Promise<unknown>;
169
+ pushErrorScope(filter: GPUErrorFilter): void;
170
+ private _queue;
171
+ get queue(): GPUQueue;
172
+ }
173
+ export {};