@nativescript/canvas 2.0.0-webgpu.1 → 2.0.0-webgpu.11
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 +2 -16
- package/Canvas/common.js +1 -62
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +6 -8
- package/Canvas/index.android.js +116 -62
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +7 -8
- package/Canvas/index.ios.d.ts +3 -2
- package/Canvas/index.ios.js +115 -74
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js +72 -72
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.js +1 -1
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Dom/Dom.js +8 -1
- package/Dom/Dom.js.map +1 -1
- package/Dom/Group.d.ts +1 -2
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.d.ts +4 -1
- package/Dom/Image.js +15 -2
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.d.ts +1 -1
- package/Dom/Paint.js.map +1 -1
- package/Dom/Text.js.map +1 -1
- package/Dom/shaders/LinearGradient.js.map +1 -1
- package/Dom/shaders/TwoPointConicalGradient.js.map +1 -1
- package/Dom/shapes/Atlas.js.map +1 -1
- package/Dom/shapes/Circle.js.map +1 -1
- package/Dom/shapes/Line.js.map +1 -1
- package/Dom/shapes/Oval.js.map +1 -1
- package/Dom/shapes/Path.d.ts +1 -1
- package/Dom/shapes/Path.js.map +1 -1
- package/Dom/shapes/Rect.js.map +1 -1
- package/Dom/shapes/RoundedRect.js.map +1 -1
- package/Dom/shapes/index.js.map +1 -1
- package/ImageAsset/index.d.ts +3 -1
- package/ImageAsset/index.js +38 -6
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +3 -3
- package/ImageBitmap/index.js.map +1 -1
- package/README.md +62 -3
- package/TextDecoder/index.js +3 -3
- package/TextDecoder/index.js.map +1 -1
- package/TextEncoder/index.js +3 -3
- package/TextEncoder/index.js.map +1 -1
- package/WebGL/WebGLExtensions/index.js +5 -5
- package/WebGL/WebGLExtensions/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.js.map +1 -1
- package/WebGPU/GPU.js.map +1 -1
- package/WebGPU/GPUAdapter.d.ts +4 -2
- package/WebGPU/GPUAdapter.js +3 -0
- package/WebGPU/GPUAdapter.js.map +1 -1
- package/WebGPU/GPUAdapterInfo.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 +6 -2
- package/WebGPU/GPUBuffer.js.map +1 -1
- package/WebGPU/GPUCanvasContext.d.ts +1 -1
- package/WebGPU/GPUCanvasContext.js +13 -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 +1 -0
- package/WebGPU/GPUCommandEncoder.js +3 -0
- 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 +4 -4
- package/WebGPU/GPUDevice.js +32 -9
- 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 +11 -0
- 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 +14 -4
- package/WebGPU/Types.d.ts +28 -27
- package/WebGPU/Utils.d.ts +1 -1
- package/WebGPU/Utils.js.map +1 -1
- package/angular/{esm2020 → esm2022}/index.mjs +5 -5
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs +4 -4
- package/angular/{fesm2020 → fesm2022}/nativescript-canvas-angular.mjs.map +1 -1
- package/angular/package.json +4 -10
- package/helpers.js.map +1 -1
- package/package.json +2 -2
- 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 +26 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2091 -2055
- 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 +971 -205
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +38 -9
- 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 +645 -602
- 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 +52 -18
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2091 -2055
- 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 +971 -205
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +971 -205
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +25 -25
- 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 +647 -604
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +685 -638
- package/platforms/ios/src/NSOperationQueueWrapper.h +2 -0
- package/platforms/ios/src/cpp/AsyncCallback.h +206 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +13 -13
- package/platforms/ios/src/cpp/Helpers.h +2 -164
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +13 -13
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +1 -1
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +2 -1
- package/platforms/ios/src/cpp/JSIReadFileCallback.h +4 -4
- package/platforms/ios/src/cpp/NativeType.h +87 -0
- package/platforms/ios/src/cpp/ObjectWrapperImpl.h +50 -0
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +2 -2
- package/platforms/ios/src/cpp/PromiseCallback.h +198 -0
- package/platforms/ios/src/cpp/RafImpl.h +2 -2
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +0 -6
- package/platforms/ios/src/cpp/TextDecoderImpl.h +3 -3
- package/platforms/ios/src/cpp/TextEncoderImpl.cpp +1 -1
- package/platforms/ios/src/cpp/TextEncoderImpl.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +8 -7
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +1 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +146 -76
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +74 -20
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +5 -6
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +4 -4
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +10 -10
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +2 -2
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +6 -3
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +7 -7
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLProgram.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +8 -8
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShader.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +5 -5
- package/platforms/ios/src/cpp/webgl/WebGLTexture.h +3 -2
- package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +5 -5
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +722 -722
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +137 -69
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +32 -6
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +80 -32
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +8 -4
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +19 -14
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +29 -2
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +455 -457
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +5 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +42 -14
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +26 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +3 -1
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1699 -727
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +4 -2
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +54 -41
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +8 -5
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +2 -3
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +65 -25
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +42 -14
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +26 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +34 -7
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +26 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +25 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +33 -8
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +6 -4
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
- package/react/index.d.ts +1 -1
- package/utils.d.ts +1 -1
- package/utils.js.map +1 -1
- package/angular/fesm2015/nativescript-canvas-angular.mjs.map +0 -1
- package/angular/fesm2020/nativescript-canvas-angular.mjs +0 -24
- package/typings/objc!CanvasNative.d.ts +0 -2038
- package/typings/objc!CanvasNative.js +0 -1
- package/typings/objc!CanvasNative.js.map +0 -1
- /package/angular/{esm2020 → esm2022}/nativescript-canvas-angular.mjs +0 -0
|
@@ -28,7 +28,7 @@ void GPURenderPassEncoderImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isol
|
|
|
28
28
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
29
29
|
|
|
30
30
|
canvasModule->Set(context, ConvertToV8String(isolate, "GPURenderPassEncoder"),
|
|
31
|
-
func).FromJust()
|
|
31
|
+
func).FromJust();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
GPURenderPassEncoderImpl *
|
|
@@ -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));
|
|
@@ -136,6 +141,27 @@ v8::Local<v8::FunctionTemplate> GPURenderPassEncoderImpl::GetCtor(v8::Isolate *i
|
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
|
|
144
|
+
void
|
|
145
|
+
GPURenderPassEncoderImpl::GetLabel(v8::Local<v8::Name> name,
|
|
146
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
147
|
+
auto ptr = GetPointer(info.This());
|
|
148
|
+
if (ptr != nullptr) {
|
|
149
|
+
auto label = canvas_native_webgpu_render_pass_encoder_get_label(ptr->pass_);
|
|
150
|
+
if (label == nullptr) {
|
|
151
|
+
info.GetReturnValue().SetEmptyString();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
info.GetReturnValue().Set(
|
|
155
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
156
|
+
);
|
|
157
|
+
canvas_native_string_destroy(label);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
info.GetReturnValue().SetEmptyString();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
139
165
|
void
|
|
140
166
|
GPURenderPassEncoderImpl::BeginOcclusionQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
141
167
|
auto *ptr = GetPointer(args.This());
|
|
@@ -228,9 +254,10 @@ void GPURenderPassEncoderImpl::DrawIndexed(const v8::FunctionCallbackInfo<v8::Va
|
|
|
228
254
|
firstInstance = firstInstanceVal.As<v8::Uint32>()->Value();
|
|
229
255
|
}
|
|
230
256
|
|
|
257
|
+
auto indexCount = indexCountVal->Uint32Value(
|
|
258
|
+
context).FromJust();
|
|
231
259
|
canvas_native_webgpu_render_pass_encoder_draw_indexed(ptr->GetPass(),
|
|
232
|
-
|
|
233
|
-
context).FromJust(),
|
|
260
|
+
indexCount,
|
|
234
261
|
instanceCount, firstIndex,
|
|
235
262
|
baseVertex,
|
|
236
263
|
firstInstance);
|
|
@@ -327,7 +354,7 @@ void GPURenderPassEncoderImpl::ExecuteBundles(const v8::FunctionCallbackInfo<v8:
|
|
|
327
354
|
std::vector<const CanvasGPURenderBundle *> bundles;
|
|
328
355
|
for (int i = 0; i < len; i++) {
|
|
329
356
|
v8::Local<v8::Value> bundleVal;
|
|
330
|
-
bundlesArray->Get(context, i).ToLocal(&
|
|
357
|
+
bundlesArray->Get(context, i).ToLocal(&bundleVal);
|
|
331
358
|
auto type = GetNativeType(bundleVal);
|
|
332
359
|
if (type == NativeType::GPURenderBundle) {
|
|
333
360
|
auto bundle = GPURenderBundleImpl::GetPointer(bundleVal.As<v8::Object>());
|
|
@@ -407,7 +434,7 @@ void GPURenderPassEncoderImpl::SetBindGroup(const v8::FunctionCallbackInfo<v8::V
|
|
|
407
434
|
auto index = indexVal->Uint32Value(context).FromJust();
|
|
408
435
|
auto bindgroup = GPUBindGroupImpl::GetPointer(bindGroupVal.As<v8::Object>());
|
|
409
436
|
|
|
410
|
-
if (dynamicOffsets->
|
|
437
|
+
if (dynamicOffsets->IsUint32Array()) {
|
|
411
438
|
auto buf = dynamicOffsets.As<v8::Uint32Array>();
|
|
412
439
|
auto buffer = buf->Buffer();
|
|
413
440
|
auto store = buffer->GetBackingStore();
|
|
@@ -445,7 +472,7 @@ void GPURenderPassEncoderImpl::SetIndexBuffer(const v8::FunctionCallbackInfo<v8:
|
|
|
445
472
|
|
|
446
473
|
auto type = GetNativeType(bufferVal);
|
|
447
474
|
|
|
448
|
-
if (type == NativeType::
|
|
475
|
+
if (type == NativeType::GPUBuffer) {
|
|
449
476
|
auto buffer = GPUBufferImpl::GetPointer(bufferVal.As<v8::Object>());
|
|
450
477
|
auto indexFormat = ConvertFromV8String(isolate, indexFormatVal);
|
|
451
478
|
if (offsetVal->IsNumber()) {
|
|
@@ -501,7 +528,7 @@ void GPURenderPassEncoderImpl::SetPipeline(const v8::FunctionCallbackInfo<v8::Va
|
|
|
501
528
|
}
|
|
502
529
|
|
|
503
530
|
auto pipelineVal = args[0];
|
|
504
|
-
if(GetNativeType(pipelineVal) == NativeType::GPURenderPipeline){
|
|
531
|
+
if (GetNativeType(pipelineVal) == NativeType::GPURenderPipeline) {
|
|
505
532
|
auto pipeline = GPURenderPipelineImpl::GetPointer(pipelineVal.As<v8::Object>());
|
|
506
533
|
canvas_native_webgpu_render_pass_encoder_set_pipeline(ptr->GetPass(),
|
|
507
534
|
pipeline->GetGPUPipeline());
|
|
@@ -32,12 +32,15 @@ public:
|
|
|
32
32
|
v8::EscapableHandleScope scope(isolate);
|
|
33
33
|
auto object = GPURenderPassEncoderImpl::GetCtor(isolate)->GetFunction(
|
|
34
34
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
35
|
-
SetNativeType(
|
|
35
|
+
SetNativeType(encoder, NativeType::GPURenderPassEncoder);
|
|
36
36
|
object->SetAlignedPointerInInternalField(0, encoder);
|
|
37
37
|
encoder->BindFinalizer(isolate, object);
|
|
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);
|
|
@@ -23,7 +23,7 @@ void GPURenderPipelineImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate
|
|
|
23
23
|
auto context = isolate->GetCurrentContext();
|
|
24
24
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
25
25
|
|
|
26
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPURenderPipeline"), func).FromJust()
|
|
26
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPURenderPipeline"), func).FromJust();
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
GPURenderPipelineImpl *GPURenderPipelineImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -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
|
+
|
|
@@ -31,12 +31,15 @@ public:
|
|
|
31
31
|
v8::EscapableHandleScope scope(isolate);
|
|
32
32
|
auto object = GPURenderPipelineImpl::GetCtor(isolate)->GetFunction(
|
|
33
33
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
34
|
-
SetNativeType(
|
|
34
|
+
SetNativeType(pipeline, NativeType::GPURenderPipeline);
|
|
35
35
|
object->SetAlignedPointerInInternalField(0, pipeline);
|
|
36
36
|
pipeline->BindFinalizer(isolate, object);
|
|
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
|
|
|
@@ -22,7 +22,7 @@ void GPUSamplerImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isola
|
|
|
22
22
|
auto context = isolate->GetCurrentContext();
|
|
23
23
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
24
24
|
|
|
25
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUSampler"), func).FromJust()
|
|
25
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUSampler"), func).FromJust();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
GPUSamplerImpl *GPUSamplerImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -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
|
|
|
@@ -30,12 +30,15 @@ public:
|
|
|
30
30
|
v8::EscapableHandleScope scope(isolate);
|
|
31
31
|
auto object = GPUSamplerImpl::GetCtor(isolate)->GetFunction(
|
|
32
32
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
-
SetNativeType(
|
|
33
|
+
SetNativeType(sampler, NativeType::GPUSampler);
|
|
34
34
|
object->SetAlignedPointerInInternalField(0, sampler);
|
|
35
35
|
sampler->BindFinalizer(isolate, object);
|
|
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_;
|
|
@@ -22,7 +22,7 @@ void GPUShaderModuleImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *
|
|
|
22
22
|
auto context = isolate->GetCurrentContext();
|
|
23
23
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
24
24
|
|
|
25
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUShaderModule"), func).FromJust()
|
|
25
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUShaderModule"), func).FromJust();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
GPUShaderModuleImpl *GPUShaderModuleImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -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
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
class GPUShaderModuleImpl : ObjectWrapperImpl {
|
|
13
13
|
public:
|
|
14
|
-
GPUShaderModuleImpl(const CanvasGPUShaderModule *shaderModule);
|
|
14
|
+
explicit GPUShaderModuleImpl(const CanvasGPUShaderModule *shaderModule);
|
|
15
15
|
|
|
16
16
|
~GPUShaderModuleImpl() {
|
|
17
17
|
canvas_native_webgpu_shader_module_release(this->GetShaderModule());
|
|
@@ -31,12 +31,15 @@ public:
|
|
|
31
31
|
v8::EscapableHandleScope scope(isolate);
|
|
32
32
|
auto object = GPUShaderModuleImpl::GetCtor(isolate)->GetFunction(
|
|
33
33
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
34
|
-
SetNativeType(
|
|
34
|
+
SetNativeType(shaderModule, NativeType::GPUShaderModule);
|
|
35
35
|
object->SetAlignedPointerInInternalField(0, shaderModule);
|
|
36
36
|
shaderModule->BindFinalizer(isolate, object);
|
|
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
|
};
|
|
@@ -22,7 +22,7 @@ void GPUSupportedLimitsImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolat
|
|
|
22
22
|
auto context = isolate->GetCurrentContext();
|
|
23
23
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
24
24
|
|
|
25
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUSupportedLimits"), func).FromJust()
|
|
25
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUSupportedLimits"), func).FromJust();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
GPUSupportedLimitsImpl *GPUSupportedLimitsImpl::GetPointer(v8::Local<v8::Object> object) {
|
|
@@ -281,7 +281,7 @@ void GPUSupportedLimitsImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
281
281
|
|
|
282
282
|
ret->SetAlignedPointerInInternalField(0, object);
|
|
283
283
|
|
|
284
|
-
SetNativeType(
|
|
284
|
+
SetNativeType(object, NativeType::GPUSupportedLimits);
|
|
285
285
|
|
|
286
286
|
object->BindFinalizer(isolate, ret);
|
|
287
287
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
class GPUSupportedLimitsImpl : public ObjectWrapperImpl {
|
|
12
12
|
public:
|
|
13
|
-
GPUSupportedLimitsImpl(CanvasGPUSupportedLimits *limits);
|
|
13
|
+
explicit GPUSupportedLimitsImpl(CanvasGPUSupportedLimits *limits);
|
|
14
14
|
|
|
15
15
|
~GPUSupportedLimitsImpl() {
|
|
16
16
|
canvas_native_webgpu_limits_release(this->limits_);
|
|
@@ -23,7 +23,7 @@ public:
|
|
|
23
23
|
v8::EscapableHandleScope scope(isolate);
|
|
24
24
|
auto object = GPUSupportedLimitsImpl::GetCtor(isolate)->GetFunction(
|
|
25
25
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
26
|
-
SetNativeType(
|
|
26
|
+
SetNativeType(limits, NativeType::GPUSupportedLimits);
|
|
27
27
|
object->SetAlignedPointerInInternalField(0, limits);
|
|
28
28
|
limits->BindFinalizer(isolate, object);
|
|
29
29
|
return scope.Escape(object);
|
|
@@ -47,6 +47,10 @@ v8::Local<v8::FunctionTemplate> GPUTextureImpl::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
|
+
);
|
|
50
54
|
|
|
51
55
|
tmpl->Set(
|
|
52
56
|
ConvertToV8String(isolate, "destroy"),
|
|
@@ -107,6 +111,27 @@ v8::Local<v8::FunctionTemplate> GPUTextureImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
107
111
|
return ctorTmpl;
|
|
108
112
|
}
|
|
109
113
|
|
|
114
|
+
|
|
115
|
+
void
|
|
116
|
+
GPUTextureImpl::GetLabel(v8::Local<v8::Name> name,
|
|
117
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
118
|
+
auto ptr = GetPointer(info.This());
|
|
119
|
+
if (ptr != nullptr) {
|
|
120
|
+
auto label = canvas_native_webgpu_texture_get_label(ptr->texture_);
|
|
121
|
+
if (label == nullptr) {
|
|
122
|
+
info.GetReturnValue().SetEmptyString();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
info.GetReturnValue().Set(
|
|
126
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
127
|
+
);
|
|
128
|
+
canvas_native_string_destroy(label);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
info.GetReturnValue().SetEmptyString();
|
|
133
|
+
}
|
|
134
|
+
|
|
110
135
|
void
|
|
111
136
|
GPUTextureImpl::GetDimension(v8::Local<v8::Name> name,
|
|
112
137
|
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
@@ -249,6 +274,7 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
249
274
|
aspect, 0, -1, 0, -1
|
|
250
275
|
};
|
|
251
276
|
|
|
277
|
+
std::string label;
|
|
252
278
|
|
|
253
279
|
if (descVal->IsObject()) {
|
|
254
280
|
descriptor = new CanvasCreateTextureViewDescriptor{};
|
|
@@ -269,7 +295,6 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
269
295
|
}
|
|
270
296
|
|
|
271
297
|
|
|
272
|
-
|
|
273
298
|
v8::Local<v8::Value> arrayLayerCountVal;
|
|
274
299
|
if (descObj->Get(context, ConvertToV8String(isolate, "arrayLayerCount")).ToLocal(
|
|
275
300
|
&arrayLayerCountVal) && arrayLayerCountVal->IsInt32()) {
|
|
@@ -297,16 +322,15 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
297
322
|
descriptor->range = ⦥
|
|
298
323
|
|
|
299
324
|
|
|
300
|
-
|
|
301
325
|
v8::Local<v8::Value> formatVal;
|
|
302
326
|
descObj->Get(context, ConvertToV8String(isolate, "format")).ToLocal(&formatVal);
|
|
303
327
|
auto formatStr = ConvertFromV8String(isolate, formatVal);
|
|
304
328
|
|
|
305
|
-
descriptor->format = CanvasOptionalGPUTextureFormat
|
|
306
|
-
|
|
329
|
+
descriptor->format = CanvasOptionalGPUTextureFormat{
|
|
330
|
+
CanvasOptionalGPUTextureFormatNone
|
|
307
331
|
};
|
|
308
332
|
|
|
309
|
-
if (!formatStr.empty()){
|
|
333
|
+
if (!formatStr.empty()) {
|
|
310
334
|
auto format = canvas_native_webgpu_enum_string_to_gpu_texture(formatStr.c_str());
|
|
311
335
|
descriptor->format = format;
|
|
312
336
|
}
|
|
@@ -317,9 +341,9 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
317
341
|
v8::Local<v8::Value> labelVal;
|
|
318
342
|
descObj->Get(context, ConvertToV8String(isolate, "label")).ToLocal(&labelVal);
|
|
319
343
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
344
|
+
label = ConvertFromV8String(isolate, labelVal);
|
|
345
|
+
|
|
346
|
+
descriptor->label = label.c_str();
|
|
323
347
|
|
|
324
348
|
v8::Local<v8::Value> dimensionVal;
|
|
325
349
|
if (descObj->Get(context, ConvertToV8String(isolate, "dimension")).ToLocal(&dimensionVal)) {
|
|
@@ -347,6 +371,7 @@ void GPUTextureImpl::CreateView(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
347
371
|
|
|
348
372
|
if (descriptor != nullptr) {
|
|
349
373
|
delete descriptor;
|
|
374
|
+
descriptor = nullptr;
|
|
350
375
|
}
|
|
351
376
|
|
|
352
377
|
if (view != nullptr) {
|
|
@@ -25,17 +25,19 @@ public:
|
|
|
25
25
|
|
|
26
26
|
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
27
27
|
|
|
28
|
-
static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, GPUTextureImpl *
|
|
28
|
+
static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, GPUTextureImpl *texture) {
|
|
29
29
|
auto context = isolate->GetCurrentContext();
|
|
30
30
|
v8::EscapableHandleScope scope(isolate);
|
|
31
31
|
auto object = GPUTextureImpl::GetCtor(isolate)->GetFunction(
|
|
32
32
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
-
SetNativeType(
|
|
34
|
-
object->SetAlignedPointerInInternalField(0,
|
|
35
|
-
|
|
33
|
+
SetNativeType(texture, NativeType::GPUTexture);
|
|
34
|
+
object->SetAlignedPointerInInternalField(0, texture);
|
|
35
|
+
texture->BindFinalizer(isolate, object);
|
|
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,
|
|
@@ -21,7 +21,7 @@ void GPUTextureViewImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *i
|
|
|
21
21
|
auto context = isolate->GetCurrentContext();
|
|
22
22
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
23
23
|
|
|
24
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUTextureView"), func).FromJust()
|
|
24
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUTextureView"), func).FromJust();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
GPUTextureViewImpl *GPUTextureViewImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -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
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
class GPUTextureViewImpl : ObjectWrapperImpl {
|
|
13
13
|
public:
|
|
14
|
-
GPUTextureViewImpl(const CanvasGPUTextureView *view);
|
|
14
|
+
explicit GPUTextureViewImpl(const CanvasGPUTextureView *view);
|
|
15
15
|
|
|
16
16
|
~GPUTextureViewImpl() {
|
|
17
17
|
canvas_native_webgpu_texture_view_release(this->GetTextureView());
|
|
@@ -30,12 +30,15 @@ public:
|
|
|
30
30
|
v8::EscapableHandleScope scope(isolate);
|
|
31
31
|
auto object = GPUTextureViewImpl::GetCtor(isolate)->GetFunction(
|
|
32
32
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
-
SetNativeType(
|
|
33
|
+
SetNativeType(view, NativeType::GPUTextureView);
|
|
34
34
|
object->SetAlignedPointerInInternalField(0, view);
|
|
35
35
|
view->BindFinalizer(isolate, object);
|
|
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_;
|