@nativescript/canvas 2.0.0-webgpu.1 → 2.0.0-webgpu.3
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 -7
- package/Canvas/index.android.js +87 -42
- 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 +87 -46
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +71 -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.js.map +1 -1
- package/Dom/Image.d.ts +4 -1
- package/Dom/Image.js +16 -2
- package/Dom/Image.js.map +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.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 +64 -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.js.map +1 -1
- package/WebGPU/GPUAdapterInfo.js.map +1 -1
- package/WebGPU/GPUBindGroup.js.map +1 -1
- package/WebGPU/GPUBindGroupLayout.js.map +1 -1
- package/WebGPU/GPUBuffer.js +5 -1
- package/WebGPU/GPUBuffer.js.map +1 -1
- package/WebGPU/GPUCanvasContext.js.map +1 -1
- package/WebGPU/GPUCommandBuffer.js.map +1 -1
- package/WebGPU/GPUCommandEncoder.js.map +1 -1
- package/WebGPU/GPUComputePassEncoder.js.map +1 -1
- package/WebGPU/GPUComputePipeline.js.map +1 -1
- package/WebGPU/GPUDevice.d.ts +2 -2
- package/WebGPU/GPUDevice.js +4 -3
- package/WebGPU/GPUDevice.js.map +1 -1
- package/WebGPU/GPUExternalTexture.js.map +1 -1
- package/WebGPU/GPUPipelineLayout.js.map +1 -1
- package/WebGPU/GPUQuerySet.js.map +1 -1
- package/WebGPU/GPUQueue.js.map +1 -1
- package/WebGPU/GPURenderBundle.js.map +1 -1
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
- package/WebGPU/GPURenderPassEncoder.js +2 -2
- package/WebGPU/GPURenderPassEncoder.js.map +1 -1
- package/WebGPU/GPURenderPipeline.js.map +1 -1
- package/WebGPU/GPUSampler.js.map +1 -1
- package/WebGPU/GPUShaderModule.js.map +1 -1
- package/WebGPU/GPUTexture.js.map +1 -1
- package/WebGPU/GPUTextureView.js.map +1 -1
- package/WebGPU/Types.d.ts +27 -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/Info.plist +5 -5
- 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 +21 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2049 -2061
- 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 +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +644 -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 +42 -18
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2049 -2061
- 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 +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +24 -24
- 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 +646 -604
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +684 -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 +145 -75
- 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 +2 -2
- 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 +124 -58
- 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 +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +44 -30
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -4
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -11
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +30 -31
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +99 -73
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +54 -41
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +5 -4
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +38 -23
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +4 -3
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +2 -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.h +4 -4
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +2 -2
- package/react/index.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
|
@@ -232,7 +232,6 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
232
232
|
if (!descVal->IsNullOrUndefined() && descVal->IsObject()) {
|
|
233
233
|
auto desc = descVal.As<v8::Object>();
|
|
234
234
|
|
|
235
|
-
|
|
236
235
|
v8::Local<v8::Value> labelVal;
|
|
237
236
|
desc->Get(context, ConvertToV8String(isolate, "label")).ToLocal(&labelVal);
|
|
238
237
|
|
|
@@ -265,10 +264,10 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
265
264
|
"view")).ToLocal(&viewVal);
|
|
266
265
|
|
|
267
266
|
const CanvasGPUTextureView *view = nullptr;
|
|
268
|
-
|
|
267
|
+
|
|
269
268
|
auto viewPtr = GPUTextureViewImpl::GetPointer(viewVal.As<v8::Object>());
|
|
270
269
|
view = viewPtr->GetTextureView();
|
|
271
|
-
|
|
270
|
+
|
|
272
271
|
const CanvasGPUTextureView *resolve_target = nullptr;
|
|
273
272
|
|
|
274
273
|
v8::Local<v8::Value> resolve_target_val;
|
|
@@ -288,8 +287,8 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
288
287
|
CanvasStoreOp store = CanvasStoreOp::CanvasStoreOpStore;
|
|
289
288
|
v8::Local<v8::Value> loadVal;
|
|
290
289
|
|
|
291
|
-
if(colorAttachment->Get(context, ConvertToV8String(isolate,
|
|
292
|
-
|
|
290
|
+
if (colorAttachment->Get(context, ConvertToV8String(isolate,
|
|
291
|
+
"loadOp")).ToLocal(&loadVal)) {
|
|
293
292
|
if (loadVal->IsUint32()) {
|
|
294
293
|
load = (CanvasLoadOp) loadVal->Uint32Value(
|
|
295
294
|
context).ToChecked();
|
|
@@ -302,11 +301,11 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
}
|
|
305
|
-
|
|
306
|
-
|
|
304
|
+
|
|
305
|
+
|
|
307
306
|
v8::Local<v8::Value> storeVal;
|
|
308
|
-
if(colorAttachment->Get(context, ConvertToV8String(isolate,
|
|
309
|
-
|
|
307
|
+
if (colorAttachment->Get(context, ConvertToV8String(isolate,
|
|
308
|
+
"storeOp")).ToLocal(&storeVal)) {
|
|
310
309
|
if (storeVal->IsUint32()) {
|
|
311
310
|
store = (CanvasStoreOp) storeVal->Uint32Value(
|
|
312
311
|
context).ToChecked();
|
|
@@ -381,20 +380,20 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
381
380
|
&depthLoadOp);
|
|
382
381
|
|
|
383
382
|
depthStencilAttachment->depth_load_op = CanvasOptionalLoadOp{
|
|
384
|
-
|
|
383
|
+
CanvasOptionalLoadOpNone
|
|
385
384
|
};
|
|
386
385
|
|
|
387
386
|
if (!depthLoadOp.IsEmpty() && depthLoadOp->IsString()) {
|
|
388
387
|
auto value = ConvertFromV8String(isolate, depthLoadOp);
|
|
389
388
|
if (value == "load") {
|
|
390
389
|
depthStencilAttachment->depth_load_op = CanvasOptionalLoadOp{
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
CanvasOptionalLoadOpSome,
|
|
391
|
+
CanvasLoadOpLoad
|
|
393
392
|
};
|
|
394
393
|
} else if (value == "clear") {
|
|
395
394
|
depthStencilAttachment->depth_load_op = CanvasOptionalLoadOp{
|
|
396
|
-
|
|
397
|
-
|
|
395
|
+
CanvasOptionalLoadOpSome,
|
|
396
|
+
CanvasLoadOpClear
|
|
398
397
|
};
|
|
399
398
|
}
|
|
400
399
|
}
|
|
@@ -406,20 +405,20 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
406
405
|
&depthStoreOp);
|
|
407
406
|
|
|
408
407
|
depthStencilAttachment->depth_store_op = CanvasOptionalStoreOp{
|
|
409
|
-
|
|
408
|
+
CanvasOptionalStoreOpNone
|
|
410
409
|
};
|
|
411
410
|
|
|
412
411
|
if (!depthStoreOp.IsEmpty() && depthStoreOp->IsString()) {
|
|
413
412
|
auto value = ConvertFromV8String(isolate, depthStoreOp);
|
|
414
413
|
if (value == "store") {
|
|
415
414
|
depthStencilAttachment->depth_store_op = depthStencilAttachment->depth_store_op = CanvasOptionalStoreOp{
|
|
416
|
-
|
|
417
|
-
|
|
415
|
+
CanvasOptionalStoreOpSome,
|
|
416
|
+
CanvasStoreOpStore
|
|
418
417
|
};
|
|
419
418
|
} else if (value == "discard") {
|
|
420
419
|
depthStencilAttachment->depth_store_op = depthStencilAttachment->depth_store_op = CanvasOptionalStoreOp{
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
CanvasOptionalStoreOpSome,
|
|
421
|
+
CanvasStoreOpDiscard
|
|
423
422
|
};
|
|
424
423
|
}
|
|
425
424
|
}
|
|
@@ -455,20 +454,20 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
455
454
|
&stencilLoadOp);
|
|
456
455
|
|
|
457
456
|
depthStencilAttachment->stencil_load_op = CanvasOptionalLoadOp{
|
|
458
|
-
|
|
457
|
+
CanvasOptionalLoadOpNone
|
|
459
458
|
};
|
|
460
459
|
|
|
461
460
|
if (!stencilLoadOp.IsEmpty() && stencilLoadOp->IsString()) {
|
|
462
461
|
auto value = ConvertFromV8String(isolate, stencilLoadOp);
|
|
463
462
|
if (value == "load") {
|
|
464
463
|
depthStencilAttachment->stencil_load_op = CanvasOptionalLoadOp{
|
|
465
|
-
|
|
466
|
-
|
|
464
|
+
CanvasOptionalLoadOpSome,
|
|
465
|
+
CanvasLoadOpLoad
|
|
467
466
|
};
|
|
468
467
|
} else if (value == "clear") {
|
|
469
468
|
depthStencilAttachment->stencil_load_op = CanvasOptionalLoadOp{
|
|
470
|
-
|
|
471
|
-
|
|
469
|
+
CanvasOptionalLoadOpSome,
|
|
470
|
+
CanvasLoadOpClear
|
|
472
471
|
};
|
|
473
472
|
}
|
|
474
473
|
}
|
|
@@ -480,20 +479,20 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
480
479
|
&stencilStoreOp);
|
|
481
480
|
|
|
482
481
|
depthStencilAttachment->stencil_store_op = CanvasOptionalStoreOp{
|
|
483
|
-
|
|
482
|
+
CanvasOptionalStoreOpNone
|
|
484
483
|
};
|
|
485
484
|
|
|
486
485
|
if (!stencilStoreOp.IsEmpty() && stencilStoreOp->IsString()) {
|
|
487
486
|
auto value = ConvertFromV8String(isolate, stencilStoreOp);
|
|
488
487
|
if (value == "store") {
|
|
489
488
|
depthStencilAttachment->stencil_store_op = CanvasOptionalStoreOp{
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
CanvasOptionalStoreOpSome,
|
|
490
|
+
CanvasStoreOpStore
|
|
492
491
|
};
|
|
493
492
|
} else if (value == "discard") {
|
|
494
493
|
depthStencilAttachment->stencil_store_op = CanvasOptionalStoreOp{
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
CanvasOptionalStoreOpSome,
|
|
495
|
+
CanvasStoreOpDiscard
|
|
497
496
|
};
|
|
498
497
|
}
|
|
499
498
|
}
|
|
@@ -518,7 +517,7 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
518
517
|
desc->Get(context, ConvertToV8String(isolate, "occlusionQuerySet")).ToLocal(
|
|
519
518
|
&occlusionQuerySetVal);
|
|
520
519
|
|
|
521
|
-
|
|
520
|
+
|
|
522
521
|
if (GetNativeType(occlusionQuerySetVal) == NativeType::GPUQuerySet) {
|
|
523
522
|
auto occlusionQuerySet = GPUQuerySetImpl::GetPointer(
|
|
524
523
|
occlusionQuerySetVal.As<v8::Object>());
|
|
@@ -585,6 +584,7 @@ void GPUCommandEncoderImpl::BeginRenderPass(const v8::FunctionCallbackInfo<v8::V
|
|
|
585
584
|
|
|
586
585
|
if (depthStencilAttachment != nullptr) {
|
|
587
586
|
delete depthStencilAttachment;
|
|
587
|
+
depthStencilAttachment = nullptr;
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
|
|
@@ -1099,7 +1099,6 @@ void GPUCommandEncoderImpl::Finish(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
1099
1099
|
auto isolate = args.GetIsolate();
|
|
1100
1100
|
auto context = isolate->GetCurrentContext();
|
|
1101
1101
|
|
|
1102
|
-
|
|
1103
1102
|
auto descVal = args[0];
|
|
1104
1103
|
std::string label;
|
|
1105
1104
|
bool didSet = false;
|
|
@@ -29,7 +29,7 @@ public:
|
|
|
29
29
|
v8::EscapableHandleScope scope(isolate);
|
|
30
30
|
auto object = GPUCommandEncoderImpl::GetCtor(isolate)->GetFunction(
|
|
31
31
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
32
|
-
SetNativeType(
|
|
32
|
+
SetNativeType(encoder, NativeType::GPUCommandEncoder);
|
|
33
33
|
object->SetAlignedPointerInInternalField(0, encoder);
|
|
34
34
|
encoder->BindFinalizer(isolate, object);
|
|
35
35
|
return scope.Escape(object);
|
|
@@ -26,7 +26,7 @@ void GPUComputePassEncoderImpl::Init(v8::Local<v8::Object> canvasModule, v8::Iso
|
|
|
26
26
|
auto context = isolate->GetCurrentContext();
|
|
27
27
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
28
28
|
|
|
29
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePassEncoder"), func).FromJust()
|
|
29
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePassEncoder"), func).FromJust();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
GPUComputePassEncoderImpl *
|
|
@@ -30,7 +30,7 @@ public:
|
|
|
30
30
|
v8::EscapableHandleScope scope(isolate);
|
|
31
31
|
auto object = GPUComputePassEncoderImpl::GetCtor(isolate)->GetFunction(
|
|
32
32
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
-
SetNativeType(
|
|
33
|
+
SetNativeType(pass, NativeType::GPUComputePass);
|
|
34
34
|
object->SetAlignedPointerInInternalField(0, pass);
|
|
35
35
|
pass->BindFinalizer(isolate, object);
|
|
36
36
|
return scope.Escape(object);
|
|
@@ -24,7 +24,7 @@ void GPUComputePipelineImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolat
|
|
|
24
24
|
auto context = isolate->GetCurrentContext();
|
|
25
25
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
26
26
|
|
|
27
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePipeline"), func).FromJust()
|
|
27
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePipeline"), func).FromJust();
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
GPUComputePipelineImpl *GPUComputePipelineImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -31,7 +31,7 @@ public:
|
|
|
31
31
|
v8::EscapableHandleScope scope(isolate);
|
|
32
32
|
auto object = GPUComputePipelineImpl::GetCtor(isolate)->GetFunction(
|
|
33
33
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
34
|
-
SetNativeType(
|
|
34
|
+
SetNativeType(pipeline, NativeType::GPUComputePipeline);
|
|
35
35
|
object->SetAlignedPointerInInternalField(0, pipeline);
|
|
36
36
|
pipeline->BindFinalizer(isolate, object);
|
|
37
37
|
return scope.Escape(object);
|
|
@@ -38,7 +38,7 @@ void GPUDeviceImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolat
|
|
|
38
38
|
auto context = isolate->GetCurrentContext();
|
|
39
39
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
40
40
|
|
|
41
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUDevice"), func).FromJust()
|
|
41
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUDevice"), func).FromJust();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
GPUDeviceImpl *GPUDeviceImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -248,13 +248,13 @@ GPUDeviceImpl::GetFeatures(v8::Local<v8::Name> name,
|
|
|
248
248
|
for (int i = 0; i < len; ++i) {
|
|
249
249
|
auto item = canvas_native_string_buffer_get_value_at(features, i);
|
|
250
250
|
if (item != nullptr) {
|
|
251
|
-
auto keyValue =
|
|
251
|
+
auto keyValue = ConvertToV8String(isolate, (char *) item);
|
|
252
252
|
map->Set(context, keyValue, keyValue);
|
|
253
253
|
canvas_native_string_destroy(item);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
canvas_native_string_buffer_release(features);
|
|
258
258
|
|
|
259
259
|
info.GetReturnValue().Set(map);
|
|
260
260
|
|
|
@@ -296,6 +296,11 @@ GPUDeviceImpl::GetQueue(v8::Local<v8::Name> name,
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
|
|
299
|
+
struct LostData {
|
|
300
|
+
int32_t reason;
|
|
301
|
+
char *message;
|
|
302
|
+
};
|
|
303
|
+
|
|
299
304
|
void
|
|
300
305
|
GPUDeviceImpl::GetLost(v8::Local<v8::Name> name,
|
|
301
306
|
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
@@ -304,64 +309,84 @@ GPUDeviceImpl::GetLost(v8::Local<v8::Name> name,
|
|
|
304
309
|
auto resolver = v8::Promise::Resolver::New(isolate->GetCurrentContext()).ToLocalChecked();
|
|
305
310
|
info.GetReturnValue().Set(resolver->GetPromise());
|
|
306
311
|
if (ptr != nullptr) {
|
|
307
|
-
v8::Global<v8::Promise::Resolver> promise(isolate, resolver);
|
|
308
312
|
auto callback = new PromiseCallback{
|
|
309
313
|
isolate,
|
|
310
|
-
|
|
314
|
+
resolver,
|
|
315
|
+
[](bool done, void *data) {
|
|
316
|
+
if (data != nullptr) {
|
|
317
|
+
auto async_data = static_cast<PromiseCallback *>(data);
|
|
318
|
+
auto func = async_data->inner_.get();
|
|
319
|
+
if (func != nullptr && func->isolate_ != nullptr) {
|
|
320
|
+
v8::Isolate *isolate = func->isolate_;
|
|
321
|
+
v8::Locker locker(isolate);
|
|
322
|
+
v8::Isolate::Scope isolate_scope(
|
|
323
|
+
isolate);
|
|
324
|
+
v8::HandleScope handle_scope(
|
|
325
|
+
isolate);
|
|
326
|
+
v8::Local<v8::Promise::Resolver> callback = func->callback_.Get(
|
|
327
|
+
isolate);
|
|
328
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
329
|
+
v8::Context::Scope context_scope(
|
|
330
|
+
context);
|
|
331
|
+
|
|
332
|
+
auto ret = v8::Object::New(
|
|
333
|
+
isolate);
|
|
334
|
+
LostData *lostData = nullptr;
|
|
335
|
+
if (func->data != nullptr) {
|
|
336
|
+
lostData = static_cast<LostData *>(func->data);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (lostData != nullptr) {
|
|
340
|
+
|
|
341
|
+
if (lostData->message != nullptr) {
|
|
342
|
+
ret->Set(context,
|
|
343
|
+
ConvertToV8String(
|
|
344
|
+
isolate,
|
|
345
|
+
"message"),
|
|
346
|
+
ConvertToV8String(
|
|
347
|
+
isolate,
|
|
348
|
+
lostData->message));
|
|
349
|
+
canvas_native_string_destroy(
|
|
350
|
+
lostData->message);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
ret->Set(context,
|
|
354
|
+
ConvertToV8String(
|
|
355
|
+
isolate,
|
|
356
|
+
"reason"),
|
|
357
|
+
v8::Int32::New(isolate,
|
|
358
|
+
lostData->reason)).IsJust();
|
|
359
|
+
} else {
|
|
360
|
+
ret->Set(context,
|
|
361
|
+
ConvertToV8String(
|
|
362
|
+
isolate,
|
|
363
|
+
"message"),
|
|
364
|
+
v8::String::Empty(
|
|
365
|
+
isolate));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
callback->Resolve(context, ret);
|
|
369
|
+
delete static_cast<PromiseCallback *>(data);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
311
373
|
};
|
|
312
374
|
|
|
375
|
+
callback->prepare();
|
|
376
|
+
|
|
313
377
|
canvas_native_webgpu_device_set_lost_callback(ptr->GetGPUDevice(),
|
|
314
378
|
[](int32_t reason, char *message,
|
|
315
379
|
void *data) {
|
|
316
380
|
if (data != nullptr) {
|
|
317
|
-
auto
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
isolate);
|
|
325
|
-
v8::Local<v8::Promise::Resolver> callback = func->callback.Get(
|
|
326
|
-
isolate);
|
|
327
|
-
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
328
|
-
v8::Context::Scope context_scope(
|
|
329
|
-
context);
|
|
330
|
-
|
|
331
|
-
auto ret = v8::Object::New(
|
|
332
|
-
isolate);
|
|
333
|
-
if (message == nullptr) {
|
|
334
|
-
ret->Set(context,
|
|
335
|
-
ConvertToV8String(
|
|
336
|
-
isolate,
|
|
337
|
-
"message"),
|
|
338
|
-
v8::String::Empty(
|
|
339
|
-
isolate));
|
|
340
|
-
} else {
|
|
341
|
-
ret->Set(context,
|
|
342
|
-
ConvertToV8String(
|
|
343
|
-
isolate,
|
|
344
|
-
"message"),
|
|
345
|
-
ConvertToV8String(
|
|
346
|
-
isolate,
|
|
347
|
-
message));
|
|
348
|
-
canvas_native_string_destroy(
|
|
349
|
-
message);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
ret->Set(context,
|
|
353
|
-
ConvertToV8String(
|
|
354
|
-
isolate,
|
|
355
|
-
"reason"),
|
|
356
|
-
v8::Int32::New(isolate,
|
|
357
|
-
reason)).IsJust();
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
callback->Resolve(context, ret);
|
|
361
|
-
delete static_cast<PromiseCallback *>(data);
|
|
381
|
+
auto async_data = static_cast<PromiseCallback *>(data);
|
|
382
|
+
auto inner = async_data->inner_.get();
|
|
383
|
+
if (inner != nullptr) {
|
|
384
|
+
inner->data = new LostData{
|
|
385
|
+
reason, message
|
|
386
|
+
};
|
|
387
|
+
async_data->execute(true);
|
|
362
388
|
}
|
|
363
389
|
}
|
|
364
|
-
|
|
365
390
|
}, callback);
|
|
366
391
|
}
|
|
367
392
|
}
|
|
@@ -377,7 +402,7 @@ void GPUDeviceImpl::CreateBindGroup(const v8::FunctionCallbackInfo<v8::Value> &a
|
|
|
377
402
|
char *label = nullptr;
|
|
378
403
|
|
|
379
404
|
auto optionsVal = args[0];
|
|
380
|
-
|
|
405
|
+
|
|
381
406
|
std::vector<CanvasBindGroupEntry> entries;
|
|
382
407
|
|
|
383
408
|
if (optionsVal->IsObject()) {
|
|
@@ -467,10 +492,10 @@ void GPUDeviceImpl::CreateBindGroup(const v8::FunctionCallbackInfo<v8::Value> &a
|
|
|
467
492
|
int64_t offset = -1;
|
|
468
493
|
|
|
469
494
|
v8::Local<v8::Value> offsetVal;
|
|
470
|
-
|
|
495
|
+
|
|
471
496
|
resourceObj->Get(context,
|
|
472
|
-
|
|
473
|
-
|
|
497
|
+
ConvertToV8String(isolate,
|
|
498
|
+
"offset")).ToLocal(
|
|
474
499
|
&offsetVal);
|
|
475
500
|
if (!offsetVal.IsEmpty() && offsetVal->IsNumber()) {
|
|
476
501
|
offset = (int64_t) offsetVal->NumberValue(
|
|
@@ -481,7 +506,8 @@ void GPUDeviceImpl::CreateBindGroup(const v8::FunctionCallbackInfo<v8::Value> &a
|
|
|
481
506
|
|
|
482
507
|
v8::Local<v8::Value> sizeVal;
|
|
483
508
|
resourceObj->Get(context,
|
|
484
|
-
|
|
509
|
+
ConvertToV8String(isolate,
|
|
510
|
+
"size")).ToLocal(
|
|
485
511
|
&sizeVal);
|
|
486
512
|
if (!sizeVal.IsEmpty() && sizeVal->IsNumber()) {
|
|
487
513
|
size = (int64_t) sizeVal->NumberValue(
|
|
@@ -1234,7 +1260,6 @@ void GPUDeviceImpl::CreateQuerySet(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
1234
1260
|
label = *v8::String::Utf8Value(isolate, labelVal);
|
|
1235
1261
|
}
|
|
1236
1262
|
|
|
1237
|
-
|
|
1238
1263
|
v8::Local<v8::Value> typeVal;
|
|
1239
1264
|
options->Get(context, ConvertToV8String(isolate, "type")).ToLocal(&labelVal);
|
|
1240
1265
|
|
|
@@ -1438,7 +1463,7 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1438
1463
|
&depthBiasClampVal);
|
|
1439
1464
|
|
|
1440
1465
|
if (!depthBiasClampVal.IsEmpty() && depthBiasClampVal->IsNumber()) {
|
|
1441
|
-
stencil->depth_bias_clamp = (float)depthBiasClampVal->NumberValue(context).FromJust();
|
|
1466
|
+
stencil->depth_bias_clamp = (float) depthBiasClampVal->NumberValue(context).FromJust();
|
|
1442
1467
|
}
|
|
1443
1468
|
|
|
1444
1469
|
|
|
@@ -1447,7 +1472,7 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1447
1472
|
&depthBiasSlopeScaleVal);
|
|
1448
1473
|
|
|
1449
1474
|
if (!depthBiasSlopeScaleVal.IsEmpty() && depthBiasSlopeScaleVal->IsNumber()) {
|
|
1450
|
-
stencil->depth_bias_slope_scale = (float)depthBiasSlopeScaleVal->NumberValue(
|
|
1475
|
+
stencil->depth_bias_slope_scale = (float) depthBiasSlopeScaleVal->NumberValue(
|
|
1451
1476
|
context).FromJust();
|
|
1452
1477
|
}
|
|
1453
1478
|
|
|
@@ -1573,7 +1598,7 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1573
1598
|
if (!stencilWriteMaskVal.IsEmpty() && stencilWriteMaskVal->IsUint32()) {
|
|
1574
1599
|
stencil->stencil_write_mask = stencilWriteMaskVal->Uint32Value(context).FromJust();
|
|
1575
1600
|
}
|
|
1576
|
-
|
|
1601
|
+
|
|
1577
1602
|
descriptor.depth_stencil = stencil;
|
|
1578
1603
|
|
|
1579
1604
|
}
|
|
@@ -1898,7 +1923,7 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1898
1923
|
v8::Local<v8::Value> cullModeValue;
|
|
1899
1924
|
|
|
1900
1925
|
if (primitiveObj->Get(context, ConvertToV8String(isolate, "cullMode")).ToLocal(
|
|
1901
|
-
|
|
1926
|
+
&cullModeValue)) {
|
|
1902
1927
|
if (cullModeValue->IsUint32()) {
|
|
1903
1928
|
auto cullMode = cullModeValue.As<v8::Uint32>()->Value();
|
|
1904
1929
|
|
|
@@ -1933,7 +1958,7 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1933
1958
|
v8::Local<v8::Value> frontFaceValue;
|
|
1934
1959
|
|
|
1935
1960
|
if (primitiveObj->Get(context, ConvertToV8String(isolate, "frontFace")).ToLocal(
|
|
1936
|
-
|
|
1961
|
+
&frontFaceValue)) {
|
|
1937
1962
|
if (frontFaceValue->IsUint32()) {
|
|
1938
1963
|
auto frontFace = frontFaceValue.As<v8::Uint32>()->Value();
|
|
1939
1964
|
switch (frontFace) {
|
|
@@ -1960,7 +1985,7 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1960
1985
|
v8::Local<v8::Value> stripIndexFormatValue;
|
|
1961
1986
|
|
|
1962
1987
|
if (primitiveObj->Get(context, ConvertToV8String(isolate, "stripIndexFormat")).ToLocal(
|
|
1963
|
-
|
|
1988
|
+
&stripIndexFormatValue)) {
|
|
1964
1989
|
if (stripIndexFormatValue->IsUint32()) {
|
|
1965
1990
|
auto stripIndexFormat = stripIndexFormatValue.As<v8::Uint32>()->Value();
|
|
1966
1991
|
switch (stripIndexFormat) {
|
|
@@ -2001,7 +2026,7 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2001
2026
|
v8::Local<v8::Value> topologyValue;
|
|
2002
2027
|
|
|
2003
2028
|
if (primitiveObj->Get(context, ConvertToV8String(isolate, "topology")).ToLocal(
|
|
2004
|
-
|
|
2029
|
+
&topologyValue)) {
|
|
2005
2030
|
|
|
2006
2031
|
if (topologyValue->IsUint32()) {
|
|
2007
2032
|
auto topology = topologyValue.As<v8::Uint32>()->Value();
|
|
@@ -2262,8 +2287,8 @@ void GPUDeviceImpl::CreateRenderPipeline(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2262
2287
|
}
|
|
2263
2288
|
|
|
2264
2289
|
}
|
|
2265
|
-
|
|
2266
|
-
if(descriptor.depth_stencil != nullptr){
|
|
2290
|
+
|
|
2291
|
+
if (descriptor.depth_stencil != nullptr) {
|
|
2267
2292
|
delete descriptor.depth_stencil;
|
|
2268
2293
|
}
|
|
2269
2294
|
|
|
@@ -2493,7 +2518,8 @@ void GPUDeviceImpl::CreateShaderModule(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
2493
2518
|
v8::Local<v8::Value> codeVal;
|
|
2494
2519
|
|
|
2495
2520
|
std::string code;
|
|
2496
|
-
if (desc->Get(context, ConvertToV8String(isolate, "code")).ToLocal(&codeVal) &&
|
|
2521
|
+
if (desc->Get(context, ConvertToV8String(isolate, "code")).ToLocal(&codeVal) &&
|
|
2522
|
+
codeVal->IsString()) {
|
|
2497
2523
|
code = ConvertFromV8String(isolate, codeVal);
|
|
2498
2524
|
}
|
|
2499
2525
|
|
|
@@ -2542,15 +2568,15 @@ void GPUDeviceImpl::CreateTexture(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
2542
2568
|
v8::Local<v8::Value> depthOrArrayLayersVal;
|
|
2543
2569
|
|
|
2544
2570
|
if (options->Get(context, ConvertToV8String(isolate, "depthOrArrayLayers")).ToLocal(
|
|
2545
|
-
|
|
2571
|
+
&depthOrArrayLayersVal) && depthOrArrayLayersVal->IsUint32()) {
|
|
2546
2572
|
descriptor.depthOrArrayLayers = depthOrArrayLayersVal.As<v8::Uint32>()->Value();
|
|
2547
2573
|
}
|
|
2548
2574
|
|
|
2549
2575
|
|
|
2550
2576
|
v8::Local<v8::Value> widthVal;
|
|
2551
2577
|
|
|
2552
|
-
if (
|
|
2553
|
-
|
|
2578
|
+
if (options->Get(context, ConvertToV8String(isolate, "width")).ToLocal(
|
|
2579
|
+
&widthVal) && widthVal->IsUint32()) {
|
|
2554
2580
|
descriptor.width = widthVal.As<v8::Uint32>()->Value();
|
|
2555
2581
|
}
|
|
2556
2582
|
|
|
@@ -2558,7 +2584,7 @@ void GPUDeviceImpl::CreateTexture(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
2558
2584
|
v8::Local<v8::Value> heightVal;
|
|
2559
2585
|
|
|
2560
2586
|
if (options->Get(context, ConvertToV8String(isolate, "height")).ToLocal(
|
|
2561
|
-
|
|
2587
|
+
&heightVal) && heightVal->IsUint32()) {
|
|
2562
2588
|
descriptor.height = heightVal.As<v8::Uint32>()->Value();
|
|
2563
2589
|
}
|
|
2564
2590
|
|
|
@@ -2566,7 +2592,7 @@ void GPUDeviceImpl::CreateTexture(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
2566
2592
|
v8::Local<v8::Value> usageVal;
|
|
2567
2593
|
|
|
2568
2594
|
if (options->Get(context, ConvertToV8String(isolate, "usage")).ToLocal(
|
|
2569
|
-
|
|
2595
|
+
&usageVal) && usageVal->IsUint32()) {
|
|
2570
2596
|
descriptor.usage = usageVal.As<v8::Uint32>()->Value();
|
|
2571
2597
|
}
|
|
2572
2598
|
|
|
@@ -2611,7 +2637,7 @@ void GPUDeviceImpl::CreateTexture(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
2611
2637
|
v8::Local<v8::Value> formatVal;
|
|
2612
2638
|
|
|
2613
2639
|
if (options->Get(context, ConvertToV8String(isolate, "format")).ToLocal(
|
|
2614
|
-
|
|
2640
|
+
&formatVal) && formatVal->IsString()) {
|
|
2615
2641
|
auto format = ConvertFromV8String(isolate, formatVal);
|
|
2616
2642
|
|
|
2617
2643
|
// todo use enum
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
class GPUDeviceImpl : ObjectWrapperImpl {
|
|
13
13
|
public:
|
|
14
|
-
GPUDeviceImpl(const CanvasGPUDevice *device);
|
|
14
|
+
explicit GPUDeviceImpl(const CanvasGPUDevice *device);
|
|
15
15
|
|
|
16
16
|
~GPUDeviceImpl() {
|
|
17
17
|
canvas_native_webgpu_device_release(this->device_);
|
|
@@ -30,7 +30,7 @@ public:
|
|
|
30
30
|
v8::EscapableHandleScope scope(isolate);
|
|
31
31
|
auto object = GPUDeviceImpl::GetCtor(isolate)->GetFunction(
|
|
32
32
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
-
SetNativeType(
|
|
33
|
+
SetNativeType(device, NativeType::GPUDevice);
|
|
34
34
|
object->SetAlignedPointerInInternalField(0, device);
|
|
35
35
|
device->BindFinalizer(isolate, object);
|
|
36
36
|
return scope.Escape(object);
|