@nativescript/canvas 2.0.0-alpha.8 → 2.0.0-beta.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.
- package/Canvas/common.d.ts +213 -25
- package/Canvas/common.js +705 -452
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +10 -1
- package/Canvas/index.android.js +155 -52
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +8 -0
- package/Canvas/index.ios.d.ts +7 -4
- package/Canvas/index.ios.js +159 -106
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasGradient/index.d.ts +1 -3
- package/Canvas2D/CanvasGradient/index.js +1 -10
- package/Canvas2D/CanvasGradient/index.js.map +1 -1
- package/Canvas2D/CanvasPattern/index.d.ts +1 -3
- package/Canvas2D/CanvasPattern/index.js +1 -10
- package/Canvas2D/CanvasPattern/index.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +9 -5
- package/Canvas2D/CanvasRenderingContext2D/index.js +174 -245
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.js +3 -3
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +6 -6
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.d.ts +0 -2
- package/Canvas2D/Path2D/index.js +32 -42
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Dom/Paint.js +2 -3
- package/Dom/Paint.js.map +1 -1
- package/Dom/shapes/Circle.js +1 -2
- package/Dom/shapes/Circle.js.map +1 -1
- package/Dom/shapes/Points.js +1 -2
- package/Dom/shapes/Points.js.map +1 -1
- package/ImageAsset/index.d.ts +2 -2
- package/ImageAsset/index.js +33 -37
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.d.ts +0 -2
- package/ImageBitmap/index.js +47 -33
- package/ImageBitmap/index.js.map +1 -1
- package/LICENSE +201 -0
- package/SVG/SVG.js +1 -1
- package/SVG/SVG.js.map +1 -1
- package/TextDecoder/index.d.ts +0 -2
- package/TextDecoder/index.js +3 -12
- package/TextDecoder/index.js.map +1 -1
- package/TextEncoder/index.d.ts +0 -2
- package/TextEncoder/index.js +4 -13
- package/TextEncoder/index.js.map +1 -1
- package/WebGL/WebGLExtensions/index.d.ts +4 -12
- package/WebGL/WebGLExtensions/index.js +27 -77
- package/WebGL/WebGLExtensions/index.js.map +1 -1
- package/WebGL/WebGLProgram.d.ts +0 -1
- package/WebGL/WebGLProgram.js +0 -3
- package/WebGL/WebGLProgram.js.map +1 -1
- package/WebGL/WebGLRenderingContext/common.d.ts +1 -3
- package/WebGL/WebGLRenderingContext/common.js +3 -13
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +19 -17
- package/WebGL/WebGLRenderingContext/index.js +354 -728
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/common.d.ts +2 -2
- package/WebGL2/WebGL2RenderingContext/common.js +2 -2
- package/WebGL2/WebGL2RenderingContext/common.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js +116 -285
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/angular/esm2020/index.mjs +4 -4
- package/angular/fesm2015/nativescript-canvas-angular.mjs +4 -4
- package/angular/fesm2020/nativescript-canvas-angular.mjs +4 -4
- package/angular/package.json +2 -2
- package/index.js.map +1 -1
- package/package.json +3 -2
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/android/include.gradle +15 -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 +135 -68
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +10 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +144 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2808 -68
- 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 +5677 -2409
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +44 -25
- 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 +44 -25
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- 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 +270 -136
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +10 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +144 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2808 -68
- 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 +5677 -2409
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +44 -25
- 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 +44 -25
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +5677 -2409
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +44 -25
- 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 +44 -25
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +42 -31
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/Podfile +5 -2
- package/platforms/ios/build.xcconfig +3 -3
- package/platforms/ios/src/CanvasModule.h +0 -2
- package/platforms/ios/src/CanvasModule.mm +4 -4
- package/platforms/ios/src/NSOperationQueueWrapper.h +11 -0
- package/platforms/ios/src/NSOperationQueueWrapper.mm +74 -0
- package/platforms/ios/src/cpp/Caches.cpp +35 -0
- package/platforms/ios/src/cpp/Caches.h +190 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +1593 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.h +16 -34
- package/platforms/ios/src/cpp/Common.h +30 -0
- package/platforms/ios/src/cpp/ConcurrentMap.h +54 -0
- package/platforms/ios/src/cpp/Helpers.h +336 -38
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +802 -0
- package/platforms/ios/src/cpp/ImageAssetImpl.h +46 -12
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +189 -0
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +42 -16
- package/platforms/ios/src/cpp/JSICallback.h +83 -5
- package/platforms/ios/src/cpp/JSIReadFileCallback.h +86 -6
- package/platforms/ios/src/cpp/JSIRuntime.cpp +21 -0
- package/platforms/ios/src/cpp/JSIRuntime.h +7 -0
- package/platforms/ios/src/cpp/ObjectWrapperImpl.h +31 -0
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +55 -0
- package/platforms/ios/src/cpp/OneByteStringResource.h +36 -0
- package/platforms/ios/src/cpp/PerIsolateData.cpp +49 -0
- package/platforms/ios/src/cpp/PerIsolateData.h +54 -0
- package/platforms/ios/src/cpp/RafImpl.cpp +8 -0
- package/platforms/ios/src/cpp/RafImpl.h +11 -8
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +193 -0
- package/platforms/ios/src/cpp/TextDecoderImpl.h +23 -13
- package/platforms/ios/src/cpp/TextEncoderImpl.cpp +139 -0
- package/platforms/ios/src/cpp/TextEncoderImpl.h +21 -12
- package/platforms/ios/src/cpp/URLImpl.cpp +464 -0
- package/platforms/ios/src/cpp/URLImpl.h +121 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.cpp +71 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +29 -13
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +89 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +49 -12
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +2809 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +1331 -21
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +207 -0
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +27 -13
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +807 -0
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +173 -13
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +499 -0
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +422 -12
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.cpp +253 -0
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +51 -12
- package/platforms/ios/src/cpp/gl.h +57 -7
- package/platforms/ios/src/cpp/gl3stub.c +425 -0
- package/platforms/ios/src/cpp/gl3stub.h +665 -0
- package/platforms/ios/src/cpp/gles3jni.h +37 -0
- package/platforms/ios/src/cpp/include/robin_hood.h +2544 -0
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp +91 -0
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +33 -13
- package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +42 -7
- package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +47 -11
- package/platforms/ios/src/cpp/webgl/WebGLProgram.h +41 -6
- package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +41 -7
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +6845 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +3217 -388
- package/platforms/ios/src/cpp/webgl/{WebGLRenderingContextBase.mm → WebGLRenderingContextBase.cpp} +18 -17
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.h +16 -36
- package/platforms/ios/src/cpp/webgl/WebGLShader.h +41 -7
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.cpp +50 -0
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +67 -12
- package/platforms/ios/src/cpp/webgl/WebGLTexture.h +41 -7
- package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +45 -9
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +136 -0
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +88 -12
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp +35 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +26 -6
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp +41 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +26 -6
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +306 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +47 -13
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +49 -6
- package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +37 -15
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +47 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +49 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +41 -16
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +44 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +39 -16
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +37 -16
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +42 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +40 -16
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.cpp +110 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +149 -14
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +51 -8
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +49 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +49 -8
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +76 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +57 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +53 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +59 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +46 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp +38 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +157 -14
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.cpp +32 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +61 -13
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +4564 -0
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1790 -342
- package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +41 -4
- package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +42 -3
- package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +45 -11
- package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +43 -4
- package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +44 -4
- package/platforms/ios/src/module.modulemap +1 -0
- package/{pods → src-native/ios}/NativeScript.podspec +12 -25
- package/typings/objc!CanvasNative.d.ts +2038 -0
- package/typings/objc!CanvasNative.js +1 -0
- package/typings/objc!CanvasNative.js.map +1 -0
- package/utils.d.ts +3 -1
- package/utils.js +7 -20
- package/utils.js.map +1 -1
- package/angular/nativescript-canvas-angular.d.ts +0 -5
- package/platforms/ios/src/cpp/CanvasJSIModule.mm +0 -1105
- package/platforms/ios/src/cpp/ImageAssetImpl.mm +0 -417
- package/platforms/ios/src/cpp/ImageBitmapImpl.mm +0 -126
- package/platforms/ios/src/cpp/RafImpl.mm +0 -10
- package/platforms/ios/src/cpp/TextDecoderImpl.mm +0 -97
- package/platforms/ios/src/cpp/TextEncoderImpl.mm +0 -60
- package/platforms/ios/src/cpp/VecMutableBuffer.h +0 -46
- package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.cc +0 -6156
- package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.h +0 -2867
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.mm +0 -42
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.mm +0 -49
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.mm +0 -1972
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.mm +0 -68
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.mm +0 -149
- package/platforms/ios/src/cpp/canvas2d/Path2D.mm +0 -335
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.mm +0 -68
- package/platforms/ios/src/cpp/rust/cxx.cc +0 -793
- package/platforms/ios/src/cpp/rust/cxx.h +0 -1111
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.mm +0 -39
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.mm +0 -5958
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.mm +0 -40
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.mm +0 -108
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.mm +0 -28
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.mm +0 -42
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.mm +0 -295
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.mm +0 -40
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.mm +0 -37
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.mm +0 -28
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.mm +0 -31
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.mm +0 -28
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.mm +0 -127
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.mm +0 -45
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.mm +0 -45
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.mm +0 -31
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.mm +0 -70
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.mm +0 -47
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.mm +0 -46
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.mm +0 -49
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.mm +0 -30
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.mm +0 -177
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.mm +0 -64
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.mm +0 -4556
- package/pods/Headers/jsi/decorator.h +0 -770
- package/pods/Headers/jsi/instrumentation.h +0 -117
- package/pods/Headers/jsi/jsi-inl.h +0 -338
- package/pods/Headers/jsi/jsi.h +0 -1571
- package/pods/Headers/jsi/jsilib.h +0 -59
- package/pods/Headers/jsi/threadsafe.h +0 -79
- package/pods/Headers/v8runtime/HostProxy.h +0 -71
- package/pods/Headers/v8runtime/JSIV8ValueConverter.h +0 -74
- package/pods/Headers/v8runtime/V8PointerValue.h +0 -44
- package/pods/Headers/v8runtime/V8Runtime.h +0 -240
- package/pods/Headers/v8runtime/V8RuntimeConfig.h +0 -26
- package/pods/Headers/v8runtime/V8RuntimeFactory.h +0 -21
- /package/platforms/ios/src/cpp/{OnRafCallback.mm → OnRafCallback.cpp} +0 -0
- /package/{pods → src-native/ios}/Headers/include/APIDesign.md +0 -0
- /package/{pods → src-native/ios}/Headers/include/DEPS +0 -0
- /package/{pods → src-native/ios}/Headers/include/DIR_METADATA +0 -0
- /package/{pods → src-native/ios}/Headers/include/OWNERS +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/DEPS +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/OWNERS +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/README.md +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/allocation.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/common.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/cross-thread-persistent.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/custom-space.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/default-platform.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/ephemeron-pair.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/explicit-management.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/garbage-collected.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/heap-consistency.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/heap-state.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/heap-statistics.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/heap.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/api-constants.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/atomic-entry-flag.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/caged-heap-local-data.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/compiler-specific.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/finalizer-trait.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/gc-info.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/logging.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/name-trait.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/persistent-node.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/pointer-policies.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/internal/write-barrier.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/liveness-broker.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/macros.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/member.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/name-provider.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/object-size-trait.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/persistent.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/platform.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/prefinalizer.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/process-heap-statistics.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/sentinel-pointer.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/source-location.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/testing.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/trace-trait.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/type-traits.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/cppgc/visitor.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/js_protocol-1.2.json +0 -0
- /package/{pods → src-native/ios}/Headers/include/js_protocol-1.3.json +0 -0
- /package/{pods → src-native/ios}/Headers/include/js_protocol.pdl +0 -0
- /package/{pods → src-native/ios}/Headers/include/libffi/arm64/ffi.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/libffi/arm64/ffitarget.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/libffi/x86_64/ffi.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/libffi/x86_64/ffitarget.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/libffi.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/libplatform/DEPS +0 -0
- /package/{pods → src-native/ios}/Headers/include/libplatform/libplatform-export.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/libplatform/libplatform.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/libplatform/v8-tracing.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-array-buffer.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-callbacks.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-container.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-context.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-cppgc.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-data.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-date.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-debug.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-embedder-heap.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-embedder-state-scope.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-exception.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-extension.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-external.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-fast-api-calls.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-forward.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-function-callback.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-function.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-initialization.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-inspector-protocol.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-inspector.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-internal.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-isolate.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-json.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-local-handle.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-locker.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-maybe.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-memory-span.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-message.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-metrics.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-microtask-queue.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-microtask.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-object.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-persistent-handle.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-platform.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-primitive-object.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-primitive.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-profiler.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-promise.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-proxy.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-regexp.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-script.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-snapshot.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-statistics.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-template.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-traced-handle.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-typed-array.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-unwinder-state.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-unwinder.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-util.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-value-serializer-version.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-value-serializer.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-value.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-version-string.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-version.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-wasm-trap-handler-posix.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-wasm-trap-handler-win.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-wasm.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8-weak-callback-info.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8.h +0 -0
- /package/{pods → src-native/ios}/Headers/include/v8config.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/InspectorServer.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/JsV8InspectorClient.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/base/trace_event/common/trace_event_common.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/base64.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/address-region.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/atomic-utils.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/atomicops.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/base-export.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/bits.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/build_config.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/compiler-specific.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/export-template.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/flags.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/immediate-crash.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/lazy-instance.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/logging.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/macros.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/memory.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/once.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/optional.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/platform/mutex.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/platform/platform.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/platform/semaphore.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/platform/v8-time.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/platform/wrappers.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/safe_conversions.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/safe_conversions_impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/template-utils.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/base/v8-fallthrough.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/common/checks.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/common/globals.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/debug/debug-interface.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/debug/interface-types.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/init/v8.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/custom-preview.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/injected-script.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/inspected-context.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/CSS.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Console.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/DOM.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Debugger.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Forward.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/HeapProfiler.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Log.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Network.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Overlay.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Page.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Profiler.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Protocol.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Runtime.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Schema.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/protocol/Security.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/remote-object-id.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/search-util.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/string-16.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/string-util.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-console-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-console-message.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-console.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-css-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-debugger-id.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-debugger-script.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-debugger.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-dom-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-inspector-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-inspector-session-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-log-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-network-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-page-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-regex.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-schema-agent-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-stack-trace-impl.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-string-conversions.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/v8-value-utils.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/inspector/value-mirror.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/libplatform/default-platform.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/logging/tracing-flags.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/numbers/conversions.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/tracing/trace-event.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/utils/allocation.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/src/utils/vector.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/utils.h +0 -0
- /package/{pods → src-native/ios}/Headers/inspector/v8-inspector-platform.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ArgConverter.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ArrayAdapter.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Caches.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ClassBuilder.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Common.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ConcurrentMap.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ConcurrentQueue.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Console.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Constants.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/DataWrapper.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/DictionaryAdapter.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ExtVector.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/FFICall.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/FastEnumerationAdapter.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/FunctionReference.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Helpers.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/InlineFunctions.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Interop.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/KnownUnknownClassPair.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Metadata.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/MetadataBuilder.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/MetadataInlines.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ModuleInternal.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/NSDataAdapter.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/NativeScriptException.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/ObjectManager.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/OneByteStringResource.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Pointer.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/PromiseProxy.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Reference.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Runtime.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/RuntimeConfig.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/SetTimeout.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/SimpleAllocator.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/StringHasher.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/SymbolIterator.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/SymbolLoader.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/TNSDerivedClass.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/TSHelpers.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Tasks.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/UnmanagedType.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/WeakRef.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/Worker.h +0 -0
- /package/{pods → src-native/ios}/Headers/runtime/robin_hood.h +0 -0
|
@@ -0,0 +1,4564 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 22/03/2022.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include "WebGL2RenderingContext.h"
|
|
6
|
+
|
|
7
|
+
v8::CFunction WebGL2RenderingContext::fast_begin_query_(
|
|
8
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBeginQuery));
|
|
9
|
+
|
|
10
|
+
v8::CFunction WebGL2RenderingContext::fast_begin_transform_feedback_(
|
|
11
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBeginTransformFeedback));
|
|
12
|
+
|
|
13
|
+
v8::CFunction WebGL2RenderingContext::fast_bind_vertex_array_(
|
|
14
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBindVertexArray));
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
v8::CFunction WebGL2RenderingContext::fast_bind_buffer_base_(
|
|
18
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBindBufferBase));
|
|
19
|
+
|
|
20
|
+
v8::CFunction WebGL2RenderingContext::fast_bind_buffer_range_(
|
|
21
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBindBufferRange));
|
|
22
|
+
|
|
23
|
+
v8::CFunction WebGL2RenderingContext::fast_bind_sampler_(
|
|
24
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBindSampler));
|
|
25
|
+
|
|
26
|
+
v8::CFunction WebGL2RenderingContext::fast_bind_transform_feedback_(
|
|
27
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBindTransformFeedback));
|
|
28
|
+
|
|
29
|
+
v8::CFunction WebGL2RenderingContext::fast_blit_framebuffer_(
|
|
30
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastBlitFramebuffer));
|
|
31
|
+
|
|
32
|
+
v8::CFunction WebGL2RenderingContext::fast_clear_buffer_fi_(
|
|
33
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastClearBufferfi));
|
|
34
|
+
|
|
35
|
+
v8::CFunction WebGL2RenderingContext::fast_clear_buffer_fv_(
|
|
36
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastClearBufferfv));
|
|
37
|
+
|
|
38
|
+
v8::CFunction WebGL2RenderingContext::fast_clear_buffer_fv_array_(
|
|
39
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastClearBufferfvArray));
|
|
40
|
+
|
|
41
|
+
const v8::CFunction fast_clear_buffer_fv_overloads_[] = {
|
|
42
|
+
WebGL2RenderingContext::fast_clear_buffer_fv_,
|
|
43
|
+
WebGL2RenderingContext::fast_clear_buffer_fv_array_
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
v8::CFunction WebGL2RenderingContext::fast_clear_buffer_iv_(
|
|
47
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastClearBufferiv));
|
|
48
|
+
|
|
49
|
+
v8::CFunction WebGL2RenderingContext::fast_clear_buffer_iv_array_(
|
|
50
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastClearBufferivArray));
|
|
51
|
+
|
|
52
|
+
const v8::CFunction fast_clear_buffer_iv_overloads_[] = {
|
|
53
|
+
WebGL2RenderingContext::fast_clear_buffer_iv_,
|
|
54
|
+
WebGL2RenderingContext::fast_clear_buffer_iv_array_
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
v8::CFunction WebGL2RenderingContext::fast_clear_buffer_uiv_(
|
|
59
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastClearBufferuiv));
|
|
60
|
+
|
|
61
|
+
v8::CFunction WebGL2RenderingContext::fast_clear_buffer_uiv_array_(
|
|
62
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastClearBufferuivArray));
|
|
63
|
+
|
|
64
|
+
const v8::CFunction fast_clear_buffer_uiv_overloads_[] = {
|
|
65
|
+
WebGL2RenderingContext::fast_clear_buffer_uiv_,
|
|
66
|
+
WebGL2RenderingContext::fast_clear_buffer_uiv_array_
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
v8::CFunction WebGL2RenderingContext::fast_draw_arrays_instanced_(
|
|
70
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDrawArraysInstanced));
|
|
71
|
+
|
|
72
|
+
v8::CFunction WebGL2RenderingContext::fast_draw_buffers_(
|
|
73
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDrawBuffers));
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
v8::CFunction WebGL2RenderingContext::fast_draw_elements_instanced_(
|
|
77
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDrawElementsInstanced));
|
|
78
|
+
|
|
79
|
+
v8::CFunction WebGL2RenderingContext::fast_draw_range_elements_(
|
|
80
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDrawRangeElements));
|
|
81
|
+
|
|
82
|
+
v8::CFunction WebGL2RenderingContext::fast_resume_transform_feedback_(
|
|
83
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastResumeTransformFeedback));
|
|
84
|
+
|
|
85
|
+
v8::CFunction WebGL2RenderingContext::fast_sampler_parameterf_(
|
|
86
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastSamplerParameterf));
|
|
87
|
+
|
|
88
|
+
v8::CFunction WebGL2RenderingContext::fast_sampler_parameteri_(
|
|
89
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastSamplerParameteri));
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_1ui_(
|
|
93
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform1ui));
|
|
94
|
+
|
|
95
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_1uiv_(
|
|
96
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform1uiv));
|
|
97
|
+
|
|
98
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_2ui_(
|
|
99
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform2ui));
|
|
100
|
+
|
|
101
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_2uiv_(
|
|
102
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform2uiv));
|
|
103
|
+
|
|
104
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_3ui_(
|
|
105
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform3ui));
|
|
106
|
+
|
|
107
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_3uiv_(
|
|
108
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform3uiv));
|
|
109
|
+
|
|
110
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_4ui_(
|
|
111
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform4ui));
|
|
112
|
+
|
|
113
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_4uiv_(
|
|
114
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniform4uiv));
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_2x3fv_(
|
|
118
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix2x3fv));
|
|
119
|
+
|
|
120
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_2x3fv_array_(
|
|
121
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix2x3fvArray));
|
|
122
|
+
|
|
123
|
+
const v8::CFunction fast_uniform_matrix_2x3fv_overloads_[] = {
|
|
124
|
+
WebGL2RenderingContext::fast_uniform_matrix_2x3fv_,
|
|
125
|
+
WebGL2RenderingContext::fast_uniform_matrix_2x3fv_array_
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_2x4fv_(
|
|
130
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix2x4fv));
|
|
131
|
+
|
|
132
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_2x4fv_array_(
|
|
133
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix2x4fvArray));
|
|
134
|
+
|
|
135
|
+
const v8::CFunction fast_uniform_matrix_2x4fv_overloads_[] = {
|
|
136
|
+
WebGL2RenderingContext::fast_uniform_matrix_2x4fv_,
|
|
137
|
+
WebGL2RenderingContext::fast_uniform_matrix_2x4fv_array_
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_3x2fv_(
|
|
142
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix3x2fv));
|
|
143
|
+
|
|
144
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_3x2fv_array_(
|
|
145
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix3x2fvArray));
|
|
146
|
+
|
|
147
|
+
const v8::CFunction fast_uniform_matrix_3x2fv_overloads_[] = {
|
|
148
|
+
WebGL2RenderingContext::fast_uniform_matrix_3x2fv_,
|
|
149
|
+
WebGL2RenderingContext::fast_uniform_matrix_3x2fv_array_
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_3x4fv_(
|
|
153
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix3x4fv));
|
|
154
|
+
|
|
155
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_3x4fv_array_(
|
|
156
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix3x4fvArray));
|
|
157
|
+
|
|
158
|
+
const v8::CFunction fast_uniform_matrix_3x4fv_overloads_[] = {
|
|
159
|
+
WebGL2RenderingContext::fast_uniform_matrix_3x4fv_,
|
|
160
|
+
WebGL2RenderingContext::fast_uniform_matrix_3x4fv_array_
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_4x2fv_(
|
|
165
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix4x2fv));
|
|
166
|
+
|
|
167
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_4x2fv_array_(
|
|
168
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix4x2fvArray));
|
|
169
|
+
|
|
170
|
+
const v8::CFunction fast_uniform_matrix_4x2fv_overloads_[] = {
|
|
171
|
+
WebGL2RenderingContext::fast_uniform_matrix_4x2fv_,
|
|
172
|
+
WebGL2RenderingContext::fast_uniform_matrix_4x2fv_array_
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_4x3fv_(
|
|
177
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix4x3fv));
|
|
178
|
+
|
|
179
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_matrix_4x3fv_array_(
|
|
180
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformMatrix4x3fvArray));
|
|
181
|
+
|
|
182
|
+
const v8::CFunction fast_uniform_matrix_4x3fv_overloads_[] = {
|
|
183
|
+
WebGL2RenderingContext::fast_uniform_matrix_4x3fv_,
|
|
184
|
+
WebGL2RenderingContext::fast_uniform_matrix_4x3fv_array_
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
v8::CFunction WebGL2RenderingContext::fast_vertex_attrib_divisor_(
|
|
188
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastVertexAttribDivisor));
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
v8::CFunction WebGL2RenderingContext::fast_vertex_attrib_i_4i_(
|
|
192
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastVertexAttribI4i));
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
v8::CFunction WebGL2RenderingContext::fast_vertex_attrib_i_4iv_(
|
|
196
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastVertexAttribI4iv));
|
|
197
|
+
|
|
198
|
+
v8::CFunction WebGL2RenderingContext::fast_vertex_attrib_i_4iv_array_(
|
|
199
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastVertexAttribI4ivArray));
|
|
200
|
+
|
|
201
|
+
const v8::CFunction fast_vertex_attrib_i_4iv_overloads_[] = {
|
|
202
|
+
WebGL2RenderingContext::fast_vertex_attrib_i_4iv_,
|
|
203
|
+
WebGL2RenderingContext::fast_vertex_attrib_i_4iv_array_
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
v8::CFunction WebGL2RenderingContext::fast_vertex_attrib_i_4ui_(
|
|
208
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastVertexAttribI4ui));
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
v8::CFunction WebGL2RenderingContext::fast_vertex_attrib_i_4uiv_(
|
|
212
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastVertexAttribI4uiv));
|
|
213
|
+
|
|
214
|
+
v8::CFunction WebGL2RenderingContext::fast_vertex_attrib_i_4uiv_array_(
|
|
215
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastVertexAttribI4uivArray));
|
|
216
|
+
|
|
217
|
+
const v8::CFunction fast_vertex_attrib_i_4uiv_overloads_[] = {
|
|
218
|
+
WebGL2RenderingContext::fast_vertex_attrib_i_4uiv_,
|
|
219
|
+
WebGL2RenderingContext::fast_vertex_attrib_i_4uiv_array_
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
v8::CFunction WebGL2RenderingContext::fast_uniform_block_binding_(
|
|
223
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastUniformBlockBinding));
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
v8::CFunction WebGL2RenderingContext::fast_invalidate_framebuffer_(
|
|
227
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastInvalidateFramebuffer));
|
|
228
|
+
|
|
229
|
+
v8::CFunction WebGL2RenderingContext::fast_invalidate_sub_framebuffer_(
|
|
230
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastInvalidateSubFramebuffer));
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
v8::CFunction WebGL2RenderingContext::fast_copy_tex_sub_image_3d_(
|
|
234
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastCopyTexSubImage3D));
|
|
235
|
+
|
|
236
|
+
v8::CFunction WebGL2RenderingContext::fast_copy_buffer_sub_data_(
|
|
237
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastCopyBufferSubData));
|
|
238
|
+
|
|
239
|
+
v8::CFunction WebGL2RenderingContext::fast_delete_query_(
|
|
240
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDeleteQuery));
|
|
241
|
+
v8::CFunction WebGL2RenderingContext::fast_delete_sampler_(
|
|
242
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDeleteSampler));
|
|
243
|
+
v8::CFunction WebGL2RenderingContext::fast_delete_sync_(
|
|
244
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDeleteSync));
|
|
245
|
+
v8::CFunction WebGL2RenderingContext::fast_delete_transform_feedback_(
|
|
246
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDeleteTransformFeedback));
|
|
247
|
+
v8::CFunction WebGL2RenderingContext::fast_delete_vertex_array_(
|
|
248
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastDeleteVertexArray));
|
|
249
|
+
|
|
250
|
+
v8::CFunction WebGL2RenderingContext::fast_end_query_(
|
|
251
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastEndQuery));
|
|
252
|
+
|
|
253
|
+
v8::CFunction WebGL2RenderingContext::fast_end_transform_feedback_(
|
|
254
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastEndTransformFeedback));
|
|
255
|
+
|
|
256
|
+
v8::CFunction WebGL2RenderingContext::fast_framebuffer_texture_layer_(
|
|
257
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastFramebufferTextureLayer));
|
|
258
|
+
|
|
259
|
+
v8::CFunction WebGL2RenderingContext::fast_pause_transform_feedback_(
|
|
260
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastPauseTransformFeedback));
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
v8::CFunction WebGL2RenderingContext::fast_read_buffer_(
|
|
264
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastReadBuffer));
|
|
265
|
+
|
|
266
|
+
v8::CFunction WebGL2RenderingContext::fast_renderbuffer_storage_multisample_(
|
|
267
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastRenderbufferStorageMultisample));
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
v8::CFunction WebGL2RenderingContext::fast_is_query_(
|
|
271
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastIsQuery));
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
v8::CFunction WebGL2RenderingContext::fast_is_sampler_(
|
|
275
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastIsSampler));
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
v8::CFunction WebGL2RenderingContext::fast_is_sync_(
|
|
279
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastIsSync));
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
v8::CFunction WebGL2RenderingContext::fast_is_transform_feedback_(
|
|
283
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastIsTransformFeedback));
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
v8::CFunction WebGL2RenderingContext::fast_is_vertex_array_(
|
|
287
|
+
v8::CFunction::Make(WebGL2RenderingContext::FastIsVertexArray));
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state) : WebGLRenderingContext(
|
|
292
|
+
state, WebGLRenderingVersion::V2) {
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state,
|
|
298
|
+
WebGLRenderingVersion version)
|
|
299
|
+
: WebGLRenderingContext(state, version) {
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
v8::Local<v8::FunctionTemplate> WebGL2RenderingContext::GetCtor(v8::Isolate *isolate) {
|
|
304
|
+
auto cache = Caches::Get(isolate);
|
|
305
|
+
auto ctor = cache->WebGL2RenderingContextTmpl.get();
|
|
306
|
+
if (ctor != nullptr) {
|
|
307
|
+
return ctor->Get(isolate);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
311
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(2);
|
|
312
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WebGL2RenderingContext"));
|
|
313
|
+
|
|
314
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
315
|
+
tmpl->SetInternalFieldCount(2);
|
|
316
|
+
WebGLRenderingContext::SetConstants(isolate, tmpl);
|
|
317
|
+
SetConstants(isolate, tmpl);
|
|
318
|
+
|
|
319
|
+
WebGLRenderingContext::SetMethods(isolate, tmpl);
|
|
320
|
+
SetMethods(isolate, tmpl);
|
|
321
|
+
|
|
322
|
+
WebGLRenderingContext::SetProps(isolate, tmpl);
|
|
323
|
+
SetProps(isolate, tmpl);
|
|
324
|
+
cache->WebGL2RenderingContextTmpl =
|
|
325
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
326
|
+
return ctorTmpl;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
WebGL2RenderingContext *WebGL2RenderingContext::GetPointer(const v8::Local<v8::Object> &object) {
|
|
330
|
+
auto ptr = object->GetAlignedPointerFromInternalField(0);
|
|
331
|
+
if (ptr == nullptr) {
|
|
332
|
+
return nullptr;
|
|
333
|
+
}
|
|
334
|
+
return static_cast<WebGL2RenderingContext *>(ptr);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
void WebGL2RenderingContext::BeginQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
338
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
339
|
+
if (ptr == nullptr) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
auto isolate = args.GetIsolate();
|
|
344
|
+
auto context = isolate->GetCurrentContext();
|
|
345
|
+
|
|
346
|
+
auto value = args[1];
|
|
347
|
+
auto type = GetNativeType(value);
|
|
348
|
+
if (type == NativeType::WebGLQuery) {
|
|
349
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
350
|
+
auto query = WebGLQuery::GetPointer(value.As<v8::Object>());
|
|
351
|
+
|
|
352
|
+
if (query != nullptr) {
|
|
353
|
+
canvas_native_webgl2_begin_query(
|
|
354
|
+
target,
|
|
355
|
+
query->GetQuery(),
|
|
356
|
+
ptr->GetState()
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
void
|
|
363
|
+
WebGL2RenderingContext::BeginTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
364
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
365
|
+
if (ptr == nullptr) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
auto isolate = args.GetIsolate();
|
|
370
|
+
auto context = isolate->GetCurrentContext();
|
|
371
|
+
|
|
372
|
+
auto value = args[0]->Uint32Value(context).ToChecked();
|
|
373
|
+
canvas_native_webgl2_begin_transform_feedback(
|
|
374
|
+
value,
|
|
375
|
+
ptr->GetState()
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
void WebGL2RenderingContext::BindBufferBase(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
380
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
381
|
+
if (ptr == nullptr) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
auto isolate = args.GetIsolate();
|
|
386
|
+
auto context = isolate->GetCurrentContext();
|
|
387
|
+
|
|
388
|
+
auto bufferValue = args[2];
|
|
389
|
+
auto type = GetNativeType(bufferValue);
|
|
390
|
+
|
|
391
|
+
if (type == NativeType::WebGLBuffer) {
|
|
392
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
393
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
394
|
+
|
|
395
|
+
auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
|
|
396
|
+
|
|
397
|
+
canvas_native_webgl2_bind_buffer_base(
|
|
398
|
+
target,
|
|
399
|
+
index,
|
|
400
|
+
buffer->GetBuffer(),
|
|
401
|
+
ptr->GetState()
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
void WebGL2RenderingContext::BindBufferRange(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
407
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
408
|
+
if (ptr == nullptr) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
auto isolate = args.GetIsolate();
|
|
413
|
+
auto context = isolate->GetCurrentContext();
|
|
414
|
+
|
|
415
|
+
auto bufferValue = args[2];
|
|
416
|
+
auto type = GetNativeType(bufferValue);
|
|
417
|
+
if (type == NativeType::WebGLBuffer) {
|
|
418
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
419
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
420
|
+
auto offset = args[3]->NumberValue(context).ToChecked();
|
|
421
|
+
auto size = args[4]->NumberValue(context).ToChecked();
|
|
422
|
+
auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
|
|
423
|
+
canvas_native_webgl2_bind_buffer_range(
|
|
424
|
+
target,
|
|
425
|
+
index,
|
|
426
|
+
buffer->GetBuffer(),
|
|
427
|
+
static_cast<ssize_t>(offset),
|
|
428
|
+
static_cast<ssize_t>(size),
|
|
429
|
+
ptr->GetState()
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
void WebGL2RenderingContext::BindSampler(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
435
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
436
|
+
if (ptr == nullptr) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
auto isolate = args.GetIsolate();
|
|
441
|
+
auto context = isolate->GetCurrentContext();
|
|
442
|
+
|
|
443
|
+
auto samplerValue = args[1];
|
|
444
|
+
auto type = GetNativeType(samplerValue);
|
|
445
|
+
if (type == NativeType::WebGLSampler) {
|
|
446
|
+
auto unit = args[0]->Uint32Value(context).ToChecked();
|
|
447
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
448
|
+
|
|
449
|
+
canvas_native_webgl2_bind_sampler(
|
|
450
|
+
unit,
|
|
451
|
+
sampler->GetSampler(),
|
|
452
|
+
ptr->GetState()
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
void
|
|
458
|
+
WebGL2RenderingContext::BindTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
459
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
460
|
+
if (ptr == nullptr) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
auto isolate = args.GetIsolate();
|
|
465
|
+
auto context = isolate->GetCurrentContext();
|
|
466
|
+
|
|
467
|
+
auto transformFeedbackValue = args[1];
|
|
468
|
+
auto type = GetNativeType(transformFeedbackValue);
|
|
469
|
+
|
|
470
|
+
if (type == NativeType::WebGLTransformFeedback) {
|
|
471
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
472
|
+
auto transformFeedback = WebGLTransformFeedback::GetPointer(
|
|
473
|
+
transformFeedbackValue.As<v8::Object>());
|
|
474
|
+
|
|
475
|
+
canvas_native_webgl2_bind_transform_feedback(
|
|
476
|
+
target,
|
|
477
|
+
transformFeedback->GetFeedback(),
|
|
478
|
+
ptr->GetState()
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
void WebGL2RenderingContext::BindVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
484
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
485
|
+
if (ptr == nullptr) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
auto isolate = args.GetIsolate();
|
|
490
|
+
|
|
491
|
+
auto value = args[0];
|
|
492
|
+
if (value->IsNull()) {
|
|
493
|
+
canvas_native_webgl2_bind_vertex_array(
|
|
494
|
+
0,
|
|
495
|
+
ptr->GetState()
|
|
496
|
+
);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
auto type = GetNativeType(value);
|
|
501
|
+
if (type == NativeType::WebGLVertexArrayObject) {
|
|
502
|
+
auto vertexArray = WebGLVertexArrayObject::GetPointer(value.As<v8::Object>());
|
|
503
|
+
|
|
504
|
+
if (vertexArray != nullptr) {
|
|
505
|
+
canvas_native_webgl2_bind_vertex_array(
|
|
506
|
+
vertexArray->GetVertexArrayObject(),
|
|
507
|
+
ptr->GetState()
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
void WebGL2RenderingContext::BlitFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
514
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
515
|
+
if (ptr == nullptr) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
auto isolate = args.GetIsolate();
|
|
520
|
+
auto context = isolate->GetCurrentContext();
|
|
521
|
+
|
|
522
|
+
auto srcX0 = args[0]->Int32Value(context).ToChecked();
|
|
523
|
+
auto srcY0 = args[1]->Int32Value(context).ToChecked();
|
|
524
|
+
|
|
525
|
+
auto srcX1 = args[2]->Int32Value(context).ToChecked();
|
|
526
|
+
auto srcY1 = args[3]->Int32Value(context).ToChecked();
|
|
527
|
+
|
|
528
|
+
auto dstX0 = args[4]->Int32Value(context).ToChecked();
|
|
529
|
+
auto dstY0 = args[5]->Int32Value(context).ToChecked();
|
|
530
|
+
|
|
531
|
+
auto dstX1 = args[6]->Int32Value(context).ToChecked();
|
|
532
|
+
auto dstY1 = args[7]->Int32Value(context).ToChecked();
|
|
533
|
+
|
|
534
|
+
auto mask = args[8]->Uint32Value(context).ToChecked();
|
|
535
|
+
auto filter = args[9]->Uint32Value(context).ToChecked();
|
|
536
|
+
canvas_native_webgl2_blit_framebuffer(
|
|
537
|
+
srcX0,
|
|
538
|
+
srcY0,
|
|
539
|
+
srcX1,
|
|
540
|
+
srcY1,
|
|
541
|
+
dstX0,
|
|
542
|
+
dstY0,
|
|
543
|
+
dstX1,
|
|
544
|
+
dstY1,
|
|
545
|
+
mask,
|
|
546
|
+
filter,
|
|
547
|
+
ptr->GetState()
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
void WebGL2RenderingContext::ClearBufferfv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
552
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
553
|
+
if (ptr == nullptr) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
auto isolate = args.GetIsolate();
|
|
558
|
+
auto context = isolate->GetCurrentContext();
|
|
559
|
+
|
|
560
|
+
auto values = args[2];
|
|
561
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
562
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
563
|
+
if (values->IsArray()) {
|
|
564
|
+
auto array = values.As<v8::Array>();
|
|
565
|
+
auto len = array->Length();
|
|
566
|
+
std::vector<float> buf;
|
|
567
|
+
buf.reserve(len);
|
|
568
|
+
for (int j = 0; j < len; ++j) {
|
|
569
|
+
auto item = array->Get(
|
|
570
|
+
context, j).ToLocalChecked();
|
|
571
|
+
buf.push_back(
|
|
572
|
+
static_cast<float>(item->NumberValue(context).ToChecked())
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
canvas_native_webgl2_clear_bufferfv(
|
|
577
|
+
buffer,
|
|
578
|
+
drawbuffer,
|
|
579
|
+
buf.data(),
|
|
580
|
+
buf.size(),
|
|
581
|
+
ptr->GetState()
|
|
582
|
+
);
|
|
583
|
+
|
|
584
|
+
} else if (values->IsFloat32Array()) {
|
|
585
|
+
auto buf = values.As<v8::Float32Array>();
|
|
586
|
+
auto array = buf->Buffer();
|
|
587
|
+
auto offset = buf->ByteOffset();
|
|
588
|
+
auto size = buf->Length();
|
|
589
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
590
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
canvas_native_webgl2_clear_bufferfv(
|
|
594
|
+
buffer,
|
|
595
|
+
drawbuffer,
|
|
596
|
+
data,
|
|
597
|
+
size,
|
|
598
|
+
ptr->GetState()
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
void WebGL2RenderingContext::ClearBufferiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
604
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
605
|
+
if (ptr == nullptr) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
auto isolate = args.GetIsolate();
|
|
610
|
+
auto context = isolate->GetCurrentContext();
|
|
611
|
+
|
|
612
|
+
auto values = args[2];
|
|
613
|
+
|
|
614
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
615
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
616
|
+
if (values->IsArray()) {
|
|
617
|
+
auto array = values.As<v8::Array>();
|
|
618
|
+
auto len = array->Length();
|
|
619
|
+
std::vector<int32_t> buf;
|
|
620
|
+
buf.reserve(len);
|
|
621
|
+
for (int j = 0; j < len; ++j) {
|
|
622
|
+
auto item = array->Get(
|
|
623
|
+
context, j).ToLocalChecked();
|
|
624
|
+
buf.push_back(
|
|
625
|
+
item->Int32Value(context).ToChecked()
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
canvas_native_webgl2_clear_bufferiv(
|
|
631
|
+
buffer,
|
|
632
|
+
drawbuffer,
|
|
633
|
+
buf.data(),
|
|
634
|
+
buf.size(),
|
|
635
|
+
ptr->GetState()
|
|
636
|
+
);
|
|
637
|
+
|
|
638
|
+
} else if (values->IsInt32Array()) {
|
|
639
|
+
auto buf = values.As<v8::Int32Array>();
|
|
640
|
+
|
|
641
|
+
auto array = buf->Buffer();
|
|
642
|
+
auto offset = buf->ByteOffset();
|
|
643
|
+
auto size = buf->Length();
|
|
644
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
645
|
+
auto data = static_cast<int32_t *>((void *) data_ptr);
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
canvas_native_webgl2_clear_bufferiv(
|
|
649
|
+
buffer,
|
|
650
|
+
drawbuffer,
|
|
651
|
+
data,
|
|
652
|
+
size,
|
|
653
|
+
ptr->GetState()
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
void WebGL2RenderingContext::ClearBufferfi(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
659
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
660
|
+
if (ptr == nullptr) {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
auto isolate = args.GetIsolate();
|
|
665
|
+
auto context = isolate->GetCurrentContext();
|
|
666
|
+
|
|
667
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
668
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
669
|
+
auto depth = args[2]->NumberValue(context).ToChecked();
|
|
670
|
+
auto stencil = args[3]->Int32Value(context).ToChecked();
|
|
671
|
+
canvas_native_webgl2_clear_bufferfi(
|
|
672
|
+
buffer,
|
|
673
|
+
drawbuffer,
|
|
674
|
+
static_cast<float>(depth),
|
|
675
|
+
stencil,
|
|
676
|
+
ptr->GetState()
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
void WebGL2RenderingContext::ClearBufferuiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
681
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
682
|
+
if (ptr == nullptr) {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
auto isolate = args.GetIsolate();
|
|
687
|
+
auto context = isolate->GetCurrentContext();
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
auto values = args[2];
|
|
691
|
+
|
|
692
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
693
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
694
|
+
if (values->IsArray()) {
|
|
695
|
+
auto array = values.As<v8::Array>();
|
|
696
|
+
auto len = array->Length();
|
|
697
|
+
std::vector<uint32_t> buf;
|
|
698
|
+
buf.reserve(len);
|
|
699
|
+
for (int j = 0; j < len; ++j) {
|
|
700
|
+
auto item = array->Get(
|
|
701
|
+
context, j).ToLocalChecked();
|
|
702
|
+
buf.push_back(
|
|
703
|
+
item->Uint32Value(context).ToChecked()
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
canvas_native_webgl2_clear_bufferuiv(
|
|
709
|
+
buffer,
|
|
710
|
+
drawbuffer,
|
|
711
|
+
buf.data(),
|
|
712
|
+
buf.size(),
|
|
713
|
+
ptr->GetState()
|
|
714
|
+
);
|
|
715
|
+
|
|
716
|
+
} else if (values->IsUint32Array()) {
|
|
717
|
+
auto buf = values.As<v8::Uint32Array>();
|
|
718
|
+
auto array = buf->Buffer();
|
|
719
|
+
auto offset = buf->ByteOffset();
|
|
720
|
+
auto size = buf->Length();
|
|
721
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
722
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
canvas_native_webgl2_clear_bufferuiv(
|
|
726
|
+
buffer,
|
|
727
|
+
drawbuffer,
|
|
728
|
+
data, size,
|
|
729
|
+
ptr->GetState()
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
void WebGL2RenderingContext::ClientWaitSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
735
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
736
|
+
if (ptr == nullptr) {
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
auto isolate = args.GetIsolate();
|
|
741
|
+
auto context = isolate->GetCurrentContext();
|
|
742
|
+
|
|
743
|
+
auto syncValue = args[0];
|
|
744
|
+
auto type = GetNativeType(syncValue);
|
|
745
|
+
if (args.Length() > 2 && type == NativeType::WebGLSync) {
|
|
746
|
+
auto sync = WebGLSyncImpl::GetPointer(syncValue.As<v8::Object>());
|
|
747
|
+
if (sync != nullptr) {
|
|
748
|
+
auto flags = args[1]->Uint32Value(context).ToChecked();
|
|
749
|
+
auto timeout = args[2]->NumberValue(context).ToChecked();
|
|
750
|
+
auto ret = canvas_native_webgl2_client_wait_sync(
|
|
751
|
+
sync->GetSync(),
|
|
752
|
+
flags,
|
|
753
|
+
static_cast<ssize_t>(timeout),
|
|
754
|
+
ptr->GetState()
|
|
755
|
+
);
|
|
756
|
+
|
|
757
|
+
args.GetReturnValue().Set(ret);
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
// todo decide if WAIT_FAILED should be returned here
|
|
762
|
+
args.GetReturnValue().SetUndefined();
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
void
|
|
766
|
+
WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
767
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
768
|
+
if (ptr == nullptr) {
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
auto isolate = args.GetIsolate();
|
|
773
|
+
auto context = isolate->GetCurrentContext();
|
|
774
|
+
|
|
775
|
+
if (args.Length() > 8) {
|
|
776
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
777
|
+
auto level = args[1]->Int32Value(context).ToChecked();
|
|
778
|
+
auto xoffset = args[2]->Int32Value(context).ToChecked();
|
|
779
|
+
auto yoffset = args[3]->Int32Value(context).ToChecked();
|
|
780
|
+
auto zoffset = args[4]->Int32Value(context).ToChecked();
|
|
781
|
+
auto width = args[5]->Int32Value(context).ToChecked();
|
|
782
|
+
auto height = args[6]->Int32Value(context).ToChecked();
|
|
783
|
+
auto depth = args[7]->Int32Value(context).ToChecked();
|
|
784
|
+
auto format = args[8]->Uint32Value(context).ToChecked();
|
|
785
|
+
|
|
786
|
+
auto imageSizeOrBufValue = args[0];
|
|
787
|
+
if (args[9]->IsObject()) {
|
|
788
|
+
if (imageSizeOrBufValue->IsArrayBufferView()) {
|
|
789
|
+
auto buf = imageSizeOrBufValue.As<v8::ArrayBufferView>();
|
|
790
|
+
auto array = buf->Buffer();
|
|
791
|
+
auto offset = buf->ByteOffset();
|
|
792
|
+
auto size = buf->ByteLength();
|
|
793
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
794
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
795
|
+
|
|
796
|
+
size_t srcOffset = 0;
|
|
797
|
+
if (args[10]->IsNumber()) {
|
|
798
|
+
srcOffset = static_cast<size_t>(args[10]->NumberValue(context).ToChecked());
|
|
799
|
+
}
|
|
800
|
+
size_t srcLengthOverride = 0;
|
|
801
|
+
if (args[11]->IsNumber()) {
|
|
802
|
+
srcLengthOverride = static_cast<size_t>(args[11]->NumberValue(
|
|
803
|
+
context).ToChecked());
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
canvas_native_webgl2_compressed_tex_sub_image3d(
|
|
808
|
+
target,
|
|
809
|
+
level,
|
|
810
|
+
xoffset,
|
|
811
|
+
yoffset,
|
|
812
|
+
zoffset,
|
|
813
|
+
width,
|
|
814
|
+
height,
|
|
815
|
+
depth,
|
|
816
|
+
format,
|
|
817
|
+
data,
|
|
818
|
+
size,
|
|
819
|
+
srcOffset,
|
|
820
|
+
srcLengthOverride,
|
|
821
|
+
ptr->GetState()
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
} else {
|
|
825
|
+
auto imageSizeOrBuf = imageSizeOrBufValue->Int32Value(context).ToChecked();
|
|
826
|
+
auto offset = 0;
|
|
827
|
+
if (args[10]->IsNumber()) {
|
|
828
|
+
offset = args[10]->Int32Value(context).ToChecked();
|
|
829
|
+
}
|
|
830
|
+
canvas_native_webgl2_compressed_tex_sub_image3d_none(
|
|
831
|
+
target,
|
|
832
|
+
level,
|
|
833
|
+
xoffset,
|
|
834
|
+
yoffset,
|
|
835
|
+
zoffset,
|
|
836
|
+
width,
|
|
837
|
+
height,
|
|
838
|
+
depth,
|
|
839
|
+
format,
|
|
840
|
+
imageSizeOrBuf,
|
|
841
|
+
offset,
|
|
842
|
+
ptr->GetState()
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
void WebGL2RenderingContext::CopyBufferSubData(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
849
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
850
|
+
if (ptr == nullptr) {
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
auto isolate = args.GetIsolate();
|
|
855
|
+
auto context = isolate->GetCurrentContext();
|
|
856
|
+
|
|
857
|
+
auto readTarget = args[0]->Uint32Value(context).ToChecked();
|
|
858
|
+
auto writeTarget = args[1]->Uint32Value(context).ToChecked();
|
|
859
|
+
auto readOffset = args[2]->NumberValue(context).ToChecked();
|
|
860
|
+
auto writeOffset = args[3]->NumberValue(context).ToChecked();
|
|
861
|
+
auto size = args[4]->NumberValue(context).ToChecked();
|
|
862
|
+
canvas_native_webgl2_copy_buffer_sub_data(
|
|
863
|
+
readTarget,
|
|
864
|
+
writeTarget,
|
|
865
|
+
static_cast<ssize_t>(readOffset),
|
|
866
|
+
static_cast<ssize_t>(writeOffset),
|
|
867
|
+
static_cast<ssize_t>(size),
|
|
868
|
+
ptr->GetState()
|
|
869
|
+
);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
void WebGL2RenderingContext::CopyTexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
873
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
874
|
+
if (ptr == nullptr) {
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
auto isolate = args.GetIsolate();
|
|
879
|
+
auto context = isolate->GetCurrentContext();
|
|
880
|
+
|
|
881
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
882
|
+
auto level = args[1]->Int32Value(context).ToChecked();
|
|
883
|
+
auto xoffset = args[2]->Int32Value(context).ToChecked();
|
|
884
|
+
auto yoffset = args[3]->Int32Value(context).ToChecked();
|
|
885
|
+
auto zoffset = args[4]->Int32Value(context).ToChecked();
|
|
886
|
+
auto x = args[5]->Int32Value(context).ToChecked();
|
|
887
|
+
auto y = args[6]->Int32Value(context).ToChecked();
|
|
888
|
+
auto width = args[7]->Int32Value(context).ToChecked();
|
|
889
|
+
auto height = args[8]->Int32Value(context).ToChecked();
|
|
890
|
+
canvas_native_webgl2_copy_tex_sub_image3d(
|
|
891
|
+
target,
|
|
892
|
+
level,
|
|
893
|
+
xoffset,
|
|
894
|
+
yoffset,
|
|
895
|
+
zoffset,
|
|
896
|
+
x,
|
|
897
|
+
y,
|
|
898
|
+
width,
|
|
899
|
+
height,
|
|
900
|
+
ptr->GetState()
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
void WebGL2RenderingContext::CreateQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
905
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
906
|
+
if (ptr == nullptr) {
|
|
907
|
+
args.GetReturnValue().SetUndefined();
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
auto isolate = args.GetIsolate();
|
|
912
|
+
|
|
913
|
+
auto ret = canvas_native_webgl2_create_query(
|
|
914
|
+
ptr->GetState());
|
|
915
|
+
auto query = WebGLQuery::NewInstance(isolate, new WebGLQuery(ret));
|
|
916
|
+
|
|
917
|
+
args.GetReturnValue().Set(query);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
void WebGL2RenderingContext::CreateSampler(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
921
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
922
|
+
if (ptr == nullptr) {
|
|
923
|
+
args.GetReturnValue().SetUndefined();
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
auto isolate = args.GetIsolate();
|
|
928
|
+
|
|
929
|
+
auto ret = canvas_native_webgl2_create_sampler(
|
|
930
|
+
ptr->GetState());
|
|
931
|
+
auto sampler = WebGLSampler::NewInstance(isolate, new WebGLSampler(ret));
|
|
932
|
+
|
|
933
|
+
args.GetReturnValue().Set(sampler);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
void
|
|
937
|
+
WebGL2RenderingContext::CreateTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
938
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
939
|
+
if (ptr == nullptr) {
|
|
940
|
+
args.GetReturnValue().SetUndefined();
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
auto isolate = args.GetIsolate();
|
|
945
|
+
|
|
946
|
+
auto ret = canvas_native_webgl2_create_transform_feedback(
|
|
947
|
+
ptr->GetState());
|
|
948
|
+
|
|
949
|
+
auto feedback = WebGLTransformFeedback::NewInstance(isolate, new WebGLTransformFeedback(
|
|
950
|
+
ret));
|
|
951
|
+
|
|
952
|
+
args.GetReturnValue().Set(feedback);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
void WebGL2RenderingContext::CreateVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
956
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
957
|
+
if (ptr == nullptr) {
|
|
958
|
+
args.GetReturnValue().SetUndefined();
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
auto isolate = args.GetIsolate();
|
|
963
|
+
|
|
964
|
+
auto ret = canvas_native_webgl2_create_vertex_array(
|
|
965
|
+
ptr->GetState());
|
|
966
|
+
|
|
967
|
+
auto vertexArrayObject = WebGLVertexArrayObject::NewInstance(isolate,
|
|
968
|
+
new WebGLVertexArrayObject(ret));
|
|
969
|
+
|
|
970
|
+
args.GetReturnValue().Set(vertexArrayObject);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
void WebGL2RenderingContext::DeleteQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
974
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
975
|
+
if (ptr == nullptr) {
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
auto isolate = args.GetIsolate();
|
|
980
|
+
|
|
981
|
+
auto queryValue = args[0];
|
|
982
|
+
auto type = GetNativeType(queryValue);
|
|
983
|
+
if (type == NativeType::WebGLQuery) {
|
|
984
|
+
auto query = WebGLQuery::GetPointer(queryValue.As<v8::Object>());
|
|
985
|
+
|
|
986
|
+
if (query != nullptr) {
|
|
987
|
+
canvas_native_webgl2_delete_query_with_query(
|
|
988
|
+
query->GetQuery(),
|
|
989
|
+
ptr->GetState()
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
void WebGL2RenderingContext::DeleteSampler(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
996
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
997
|
+
if (ptr == nullptr) {
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
auto isolate = args.GetIsolate();
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
auto samplerValue = args[0];
|
|
1005
|
+
auto type = GetNativeType(samplerValue);
|
|
1006
|
+
|
|
1007
|
+
if (type == NativeType::WebGLSampler) {
|
|
1008
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
1009
|
+
|
|
1010
|
+
if (sampler != nullptr) {
|
|
1011
|
+
canvas_native_webgl2_delete_sampler_with_sampler(
|
|
1012
|
+
sampler->GetSampler(),
|
|
1013
|
+
ptr->GetState()
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
void WebGL2RenderingContext::DeleteSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1020
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1021
|
+
if (ptr == nullptr) {
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
auto isolate = args.GetIsolate();
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
auto syncValue = args[0];
|
|
1029
|
+
auto type = GetNativeType(syncValue);
|
|
1030
|
+
if (type == NativeType::WebGLSync) {
|
|
1031
|
+
auto sync = WebGLSyncImpl::GetPointer(syncValue.As<v8::Object>());
|
|
1032
|
+
|
|
1033
|
+
if (sync != nullptr) {
|
|
1034
|
+
canvas_native_webgl2_delete_sync_with_sync(
|
|
1035
|
+
sync->GetSync(),
|
|
1036
|
+
ptr->GetState()
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
void
|
|
1043
|
+
WebGL2RenderingContext::DeleteTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1044
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1045
|
+
if (ptr == nullptr) {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
auto isolate = args.GetIsolate();
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
auto transformFeedbackValue = args[0];
|
|
1053
|
+
auto type = GetNativeType(transformFeedbackValue);
|
|
1054
|
+
if (type == NativeType::WebGLTransformFeedback) {
|
|
1055
|
+
auto transformFeedback = WebGLTransformFeedback::GetPointer(
|
|
1056
|
+
transformFeedbackValue.As<v8::Object>());
|
|
1057
|
+
|
|
1058
|
+
if (transformFeedback != nullptr) {
|
|
1059
|
+
canvas_native_webgl2_delete_transform_feedback(
|
|
1060
|
+
transformFeedback->GetFeedback(),
|
|
1061
|
+
ptr->GetState()
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
void WebGL2RenderingContext::DeleteVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1068
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1069
|
+
if (ptr == nullptr) {
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
auto isolate = args.GetIsolate();
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
auto vertexArrayValue = args[0];
|
|
1077
|
+
auto type = GetNativeType(vertexArrayValue);
|
|
1078
|
+
if (type == NativeType::WebGLVertexArrayObject) {
|
|
1079
|
+
|
|
1080
|
+
auto vertexArray = WebGLVertexArrayObject::GetPointer(vertexArrayValue.As<v8::Object>());
|
|
1081
|
+
if (vertexArray != nullptr) {
|
|
1082
|
+
canvas_native_webgl2_delete_vertex_array_with_vertex_array(
|
|
1083
|
+
vertexArray->GetVertexArrayObject(),
|
|
1084
|
+
ptr->GetState()
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
void WebGL2RenderingContext::DrawArraysInstanced(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1091
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1092
|
+
if (ptr == nullptr) {
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
auto isolate = args.GetIsolate();
|
|
1097
|
+
auto context = isolate->GetCurrentContext();
|
|
1098
|
+
|
|
1099
|
+
auto mode = args[0]->Uint32Value(context).ToChecked();
|
|
1100
|
+
auto first = args[1]->Int32Value(context).ToChecked();
|
|
1101
|
+
auto count_ = args[2]->Int32Value(context).ToChecked();
|
|
1102
|
+
auto instanceCount = args[3]->Int32Value(context).ToChecked();
|
|
1103
|
+
canvas_native_webgl2_draw_arrays_instanced(
|
|
1104
|
+
mode,
|
|
1105
|
+
first,
|
|
1106
|
+
count_,
|
|
1107
|
+
instanceCount,
|
|
1108
|
+
ptr->GetState()
|
|
1109
|
+
);
|
|
1110
|
+
|
|
1111
|
+
ptr->UpdateInvalidateState();
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
void WebGL2RenderingContext::DrawBuffers(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1115
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1116
|
+
if (ptr == nullptr) {
|
|
1117
|
+
return;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
auto isolate = args.GetIsolate();
|
|
1121
|
+
auto context = isolate->GetCurrentContext();
|
|
1122
|
+
|
|
1123
|
+
auto buffersObject = args[0];
|
|
1124
|
+
if (buffersObject->IsArray()) {
|
|
1125
|
+
auto array = buffersObject.As<v8::Array>();
|
|
1126
|
+
auto len = array->Length();
|
|
1127
|
+
std::vector<uint32_t> buf;
|
|
1128
|
+
buf.reserve(len);
|
|
1129
|
+
for (int j = 0; j < len; ++j) {
|
|
1130
|
+
auto item = array->Get(
|
|
1131
|
+
context, j).ToLocalChecked();
|
|
1132
|
+
buf.emplace_back(item->Uint32Value(context).ToChecked());
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
canvas_native_webgl2_draw_buffers(
|
|
1136
|
+
buf.data(), buf.size(),
|
|
1137
|
+
ptr->GetState());
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
void
|
|
1142
|
+
WebGL2RenderingContext::DrawElementsInstanced(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1143
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1144
|
+
if (ptr == nullptr) {
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
auto isolate = args.GetIsolate();
|
|
1149
|
+
auto context = isolate->GetCurrentContext();
|
|
1150
|
+
|
|
1151
|
+
auto mode = args[0]->Uint32Value(context).ToChecked();
|
|
1152
|
+
auto count_ = args[1]->Int32Value(context).ToChecked();
|
|
1153
|
+
auto type = args[2]->Uint32Value(context).ToChecked();
|
|
1154
|
+
auto offset = args[3]->NumberValue(context).ToChecked();
|
|
1155
|
+
auto instanceCount = args[4]->Int32Value(context).ToChecked();
|
|
1156
|
+
canvas_native_webgl2_draw_elements_instanced(
|
|
1157
|
+
mode,
|
|
1158
|
+
count_,
|
|
1159
|
+
type,
|
|
1160
|
+
static_cast<ssize_t>(offset),
|
|
1161
|
+
instanceCount,
|
|
1162
|
+
ptr->GetState()
|
|
1163
|
+
);
|
|
1164
|
+
|
|
1165
|
+
ptr->UpdateInvalidateState();
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
void WebGL2RenderingContext::DrawRangeElements(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1169
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1170
|
+
if (ptr == nullptr) {
|
|
1171
|
+
return;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
auto isolate = args.GetIsolate();
|
|
1175
|
+
auto context = isolate->GetCurrentContext();
|
|
1176
|
+
|
|
1177
|
+
auto mode = args[0]->Uint32Value(context).ToChecked();
|
|
1178
|
+
auto start = args[1]->Uint32Value(context).ToChecked();
|
|
1179
|
+
auto end = args[2]->Uint32Value(context).ToChecked();
|
|
1180
|
+
auto count = args[3]->Int32Value(context).ToChecked();
|
|
1181
|
+
auto type = args[4]->Uint32Value(context).ToChecked();
|
|
1182
|
+
auto offset = args[5]->NumberValue(context).ToChecked();
|
|
1183
|
+
canvas_native_webgl2_draw_range_elements(
|
|
1184
|
+
mode,
|
|
1185
|
+
start,
|
|
1186
|
+
end,
|
|
1187
|
+
count,
|
|
1188
|
+
type,
|
|
1189
|
+
static_cast<ssize_t>(offset),
|
|
1190
|
+
ptr->GetState()
|
|
1191
|
+
);
|
|
1192
|
+
|
|
1193
|
+
ptr->UpdateInvalidateState();
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
void WebGL2RenderingContext::EndQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1197
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1198
|
+
if (ptr == nullptr) {
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
auto isolate = args.GetIsolate();
|
|
1203
|
+
auto context = isolate->GetCurrentContext();
|
|
1204
|
+
|
|
1205
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1206
|
+
canvas_native_webgl2_end_query(target,
|
|
1207
|
+
ptr->GetState());
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
void WebGL2RenderingContext::EndTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1211
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1212
|
+
if (ptr == nullptr) {
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
auto isolate = args.GetIsolate();
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
canvas_native_webgl2_end_transform_feedback(
|
|
1220
|
+
ptr->GetState());
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
void WebGL2RenderingContext::FenceSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1224
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1225
|
+
if (ptr == nullptr) {
|
|
1226
|
+
args.GetReturnValue().SetUndefined();
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
auto isolate = args.GetIsolate();
|
|
1231
|
+
auto context = isolate->GetCurrentContext();
|
|
1232
|
+
|
|
1233
|
+
auto condition = args[0]->Uint32Value(context).ToChecked();
|
|
1234
|
+
auto flags = args[1]->Uint32Value(context).ToChecked();
|
|
1235
|
+
auto sync = canvas_native_webgl2_fence_sync(
|
|
1236
|
+
condition,
|
|
1237
|
+
flags,
|
|
1238
|
+
ptr->GetState()
|
|
1239
|
+
);
|
|
1240
|
+
auto ret = WebGLSyncImpl::NewInstance(isolate, new WebGLSyncImpl(sync));
|
|
1241
|
+
|
|
1242
|
+
args.GetReturnValue().Set(ret);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
void
|
|
1246
|
+
WebGL2RenderingContext::FramebufferTextureLayer(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1247
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1248
|
+
if (ptr == nullptr) {
|
|
1249
|
+
args.GetReturnValue().SetUndefined();
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
auto isolate = args.GetIsolate();
|
|
1254
|
+
auto context = isolate->GetCurrentContext();
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
auto textureValue = args[2];
|
|
1258
|
+
auto type = GetNativeType(textureValue);
|
|
1259
|
+
if (type == NativeType::WebGLTexture) {
|
|
1260
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1261
|
+
auto attachment = args[1]->Uint32Value(context).ToChecked();
|
|
1262
|
+
auto texture = WebGLTexture::GetPointer(textureValue.As<v8::Object>());
|
|
1263
|
+
auto level = args[3]->Int32Value(context).ToChecked();
|
|
1264
|
+
auto layer = args[4]->Int32Value(context).ToChecked();
|
|
1265
|
+
if (texture != nullptr) {
|
|
1266
|
+
canvas_native_webgl2_framebuffer_texture_layer(
|
|
1267
|
+
target,
|
|
1268
|
+
attachment,
|
|
1269
|
+
texture->GetTexture(),
|
|
1270
|
+
level,
|
|
1271
|
+
layer,
|
|
1272
|
+
ptr->GetState()
|
|
1273
|
+
);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
void
|
|
1280
|
+
WebGL2RenderingContext::GetActiveUniformBlockName(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1281
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1282
|
+
if (ptr == nullptr) {
|
|
1283
|
+
args.GetReturnValue().SetEmptyString();
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
auto isolate = args.GetIsolate();
|
|
1288
|
+
auto context = isolate->GetCurrentContext();
|
|
1289
|
+
|
|
1290
|
+
auto programValue = args[0];
|
|
1291
|
+
auto type = GetNativeType(programValue);
|
|
1292
|
+
if (type == NativeType::WebGLProgram) {
|
|
1293
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1294
|
+
if (program != nullptr) {
|
|
1295
|
+
auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked();
|
|
1296
|
+
auto name = canvas_native_webgl2_get_active_uniform_block_name(
|
|
1297
|
+
program->GetProgram(),
|
|
1298
|
+
uniformBlockIndex,
|
|
1299
|
+
ptr->GetState()
|
|
1300
|
+
);
|
|
1301
|
+
args.GetReturnValue().Set(ConvertToV8OneByteString(isolate, (char *) name));
|
|
1302
|
+
return;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
args.GetReturnValue().SetEmptyString();
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
void WebGL2RenderingContext::GetActiveUniformBlockParameter(
|
|
1311
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1312
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1313
|
+
if (ptr == nullptr) {
|
|
1314
|
+
args.GetReturnValue().SetNull();
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
auto isolate = args.GetIsolate();
|
|
1319
|
+
auto context = isolate->GetCurrentContext();
|
|
1320
|
+
|
|
1321
|
+
auto programValue = args[0];
|
|
1322
|
+
auto type = GetNativeType(programValue);
|
|
1323
|
+
|
|
1324
|
+
if (type == NativeType::WebGLProgram) {
|
|
1325
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1326
|
+
|
|
1327
|
+
if (program != nullptr) {
|
|
1328
|
+
auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked();
|
|
1329
|
+
auto pname = args[2]->Uint32Value(context).ToChecked();
|
|
1330
|
+
auto ret = canvas_native_webgl2_get_active_uniform_block_parameter(
|
|
1331
|
+
program->GetProgram(),
|
|
1332
|
+
uniformBlockIndex,
|
|
1333
|
+
pname,
|
|
1334
|
+
ptr->GetState()
|
|
1335
|
+
);
|
|
1336
|
+
|
|
1337
|
+
switch (pname) {
|
|
1338
|
+
case GL_UNIFORM_BLOCK_BINDING:
|
|
1339
|
+
case GL_UNIFORM_BLOCK_DATA_SIZE:
|
|
1340
|
+
case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:
|
|
1341
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1342
|
+
ret));
|
|
1343
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1344
|
+
return;
|
|
1345
|
+
case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: {
|
|
1346
|
+
auto value = canvas_native_webgl_result_get_u32_array(
|
|
1347
|
+
ret);
|
|
1348
|
+
|
|
1349
|
+
auto buf = (uint8_t *) canvas_native_u32_buffer_get_bytes(value);
|
|
1350
|
+
auto size = canvas_native_u32_buffer_get_length(value);
|
|
1351
|
+
auto bytes_size = size * sizeof(uint32_t);
|
|
1352
|
+
|
|
1353
|
+
auto store = v8::ArrayBuffer::NewBackingStore(buf, bytes_size,
|
|
1354
|
+
[](void *data, size_t length,
|
|
1355
|
+
void *deleter_data) {
|
|
1356
|
+
if (deleter_data != nullptr) {
|
|
1357
|
+
canvas_native_u32_buffer_destroy(
|
|
1358
|
+
(U32Buffer *) deleter_data);
|
|
1359
|
+
}
|
|
1360
|
+
},
|
|
1361
|
+
value);
|
|
1362
|
+
|
|
1363
|
+
auto arraybuffer = v8::ArrayBuffer::New(isolate, std::move(store));
|
|
1364
|
+
args.GetReturnValue().Set(v8::Uint32Array::New(arraybuffer, 0, size));
|
|
1365
|
+
|
|
1366
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1367
|
+
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
|
|
1371
|
+
case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
|
|
1372
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_bool(
|
|
1373
|
+
ret));
|
|
1374
|
+
|
|
1375
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1376
|
+
return;
|
|
1377
|
+
default:
|
|
1378
|
+
args.GetReturnValue().SetNull();
|
|
1379
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1387
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1388
|
+
if (ptr == nullptr) {
|
|
1389
|
+
args.GetReturnValue().SetNull();
|
|
1390
|
+
return;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
auto isolate = args.GetIsolate();
|
|
1394
|
+
auto context = isolate->GetCurrentContext();
|
|
1395
|
+
|
|
1396
|
+
auto programValue = args[0];
|
|
1397
|
+
auto type = GetNativeType(programValue);
|
|
1398
|
+
if (type == NativeType::WebGLProgram) {
|
|
1399
|
+
|
|
1400
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1401
|
+
auto uniformIndicesObject = args[1];
|
|
1402
|
+
auto pname = args[2]->Uint32Value(context).ToChecked();
|
|
1403
|
+
|
|
1404
|
+
if (uniformIndicesObject->IsArray()) {
|
|
1405
|
+
auto uniformIndices = uniformIndicesObject.As<v8::Array>();
|
|
1406
|
+
auto size = uniformIndices->Length();
|
|
1407
|
+
std::vector<uint32_t> buf;
|
|
1408
|
+
buf.reserve(size);
|
|
1409
|
+
for (int j = 0; j < size; j++) {
|
|
1410
|
+
auto item = uniformIndices->Get(
|
|
1411
|
+
context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
|
|
1412
|
+
buf.emplace_back(item);
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
auto ret = canvas_native_webgl2_get_active_uniforms(
|
|
1416
|
+
program->GetProgram(),
|
|
1417
|
+
buf.data(), buf.size(),
|
|
1418
|
+
pname,
|
|
1419
|
+
ptr->GetState()
|
|
1420
|
+
);
|
|
1421
|
+
|
|
1422
|
+
switch (pname) {
|
|
1423
|
+
case GL_UNIFORM_TYPE:
|
|
1424
|
+
case GL_UNIFORM_SIZE: {
|
|
1425
|
+
auto value = canvas_native_webgl_result_get_u32_array(
|
|
1426
|
+
ret);
|
|
1427
|
+
auto len = canvas_native_u32_buffer_get_length(value);
|
|
1428
|
+
auto buffer = canvas_native_u32_buffer_get_bytes(value);
|
|
1429
|
+
|
|
1430
|
+
auto array = v8::Array::New(
|
|
1431
|
+
isolate, (int) len);
|
|
1432
|
+
|
|
1433
|
+
for (int j = 0;
|
|
1434
|
+
j < len; ++j) {
|
|
1435
|
+
auto item = buffer[j];
|
|
1436
|
+
array->Set(
|
|
1437
|
+
context, j,
|
|
1438
|
+
v8::Integer::NewFromUnsigned(isolate, item));
|
|
1439
|
+
}
|
|
1440
|
+
args.GetReturnValue().Set(array);
|
|
1441
|
+
canvas_native_u32_buffer_destroy(value);
|
|
1442
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
case GL_UNIFORM_BLOCK_INDEX:
|
|
1446
|
+
case GL_UNIFORM_OFFSET:
|
|
1447
|
+
case GL_UNIFORM_ARRAY_STRIDE:
|
|
1448
|
+
case GL_UNIFORM_MATRIX_STRIDE: {
|
|
1449
|
+
auto value = canvas_native_webgl_result_get_i32_array(
|
|
1450
|
+
ret);
|
|
1451
|
+
auto len = canvas_native_i32_buffer_get_length(value);
|
|
1452
|
+
auto buffer = canvas_native_i32_buffer_get_bytes(value);
|
|
1453
|
+
auto array = v8::Array::New(
|
|
1454
|
+
isolate, (int) len);
|
|
1455
|
+
for (int j = 0;
|
|
1456
|
+
j < len; ++j) {
|
|
1457
|
+
auto item = buffer[j];
|
|
1458
|
+
array->Set(
|
|
1459
|
+
context, j,
|
|
1460
|
+
v8::Integer::New(isolate, item));
|
|
1461
|
+
}
|
|
1462
|
+
args.GetReturnValue().Set(array);
|
|
1463
|
+
canvas_native_i32_buffer_destroy(value);
|
|
1464
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
case GL_UNIFORM_IS_ROW_MAJOR: {
|
|
1468
|
+
auto value = canvas_native_webgl_result_get_bool_array(
|
|
1469
|
+
ret);
|
|
1470
|
+
auto len = canvas_native_u8_buffer_get_length(value);
|
|
1471
|
+
auto buffer = canvas_native_u8_buffer_get_bytes(value);
|
|
1472
|
+
auto array = v8::Array::New(
|
|
1473
|
+
isolate,
|
|
1474
|
+
(int) len);
|
|
1475
|
+
for (int j = 0;
|
|
1476
|
+
j < len; ++j) {
|
|
1477
|
+
bool item =
|
|
1478
|
+
buffer[j] == 1;
|
|
1479
|
+
array->Set(
|
|
1480
|
+
context, j,
|
|
1481
|
+
v8::Boolean::New(isolate, item));
|
|
1482
|
+
}
|
|
1483
|
+
args.GetReturnValue().Set(array);
|
|
1484
|
+
canvas_native_u8_buffer_destroy(value);
|
|
1485
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
default:
|
|
1489
|
+
args.GetReturnValue().SetNull();
|
|
1490
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
void WebGL2RenderingContext::GetBufferSubData(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1500
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1501
|
+
if (ptr == nullptr) {
|
|
1502
|
+
args.GetReturnValue().SetNull();
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
auto isolate = args.GetIsolate();
|
|
1507
|
+
auto context = isolate->GetCurrentContext();
|
|
1508
|
+
|
|
1509
|
+
auto dstDataObject = args[2];
|
|
1510
|
+
if (dstDataObject->IsArrayBufferView()) {
|
|
1511
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1512
|
+
auto srcByteOffset = args[1]->NumberValue(context).ToChecked();
|
|
1513
|
+
|
|
1514
|
+
auto array = dstDataObject.As<v8::ArrayBufferView>();
|
|
1515
|
+
|
|
1516
|
+
auto buf = array->Buffer();
|
|
1517
|
+
auto offset = array->ByteOffset();
|
|
1518
|
+
auto size = buf->ByteLength();
|
|
1519
|
+
auto data = reinterpret_cast<uint8_t *>(buf->GetBackingStore()->Data()) + offset;
|
|
1520
|
+
|
|
1521
|
+
|
|
1522
|
+
auto BYTES_PER_ELEMENT = (ssize_t) array->Get(
|
|
1523
|
+
context,
|
|
1524
|
+
ConvertToV8String(isolate, "BYTES_PER_ELEMENT")).ToLocalChecked()->NumberValue(
|
|
1525
|
+
context).ToChecked();
|
|
1526
|
+
|
|
1527
|
+
ssize_t dstOffsetValue = 0;
|
|
1528
|
+
if (args[3]->IsNumber()) {
|
|
1529
|
+
dstOffsetValue =
|
|
1530
|
+
static_cast<ssize_t>(args[3]->NumberValue(context).ToChecked()) *
|
|
1531
|
+
BYTES_PER_ELEMENT;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
ssize_t lengthValue = 0;
|
|
1535
|
+
if (args[4]->IsNumber()) {
|
|
1536
|
+
lengthValue =
|
|
1537
|
+
static_cast<ssize_t>(args[4]->NumberValue(context).ToChecked()) *
|
|
1538
|
+
BYTES_PER_ELEMENT;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
canvas_native_webgl2_get_buffer_sub_data(
|
|
1542
|
+
target,
|
|
1543
|
+
static_cast<ssize_t>(srcByteOffset),
|
|
1544
|
+
data, size,
|
|
1545
|
+
dstOffsetValue,
|
|
1546
|
+
lengthValue,
|
|
1547
|
+
ptr->GetState()
|
|
1548
|
+
);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
void WebGL2RenderingContext::GetFragDataLocation(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1553
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1554
|
+
if (ptr == nullptr) {
|
|
1555
|
+
args.GetReturnValue().SetNull();
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
auto isolate = args.GetIsolate();
|
|
1560
|
+
auto context = isolate->GetCurrentContext();
|
|
1561
|
+
|
|
1562
|
+
auto programValue = args[0];
|
|
1563
|
+
auto nameValue = args[1];
|
|
1564
|
+
auto type = GetNativeType(programValue);
|
|
1565
|
+
if (type == NativeType::WebGLProgram && nameValue->IsString()) {
|
|
1566
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1567
|
+
|
|
1568
|
+
if (program != nullptr) {
|
|
1569
|
+
auto name = ConvertFromV8String(isolate, nameValue);
|
|
1570
|
+
|
|
1571
|
+
auto ret = canvas_native_webgl2_get_frag_data_location(
|
|
1572
|
+
program->GetProgram(),
|
|
1573
|
+
name.c_str(),
|
|
1574
|
+
ptr->GetState()
|
|
1575
|
+
);
|
|
1576
|
+
|
|
1577
|
+
args.GetReturnValue().Set(ret);
|
|
1578
|
+
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
args.GetReturnValue().SetNull();
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
void WebGL2RenderingContext::GetIndexedParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1586
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1587
|
+
if (ptr == nullptr) {
|
|
1588
|
+
args.GetReturnValue().SetNull();
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
auto isolate = args.GetIsolate();
|
|
1593
|
+
auto context = isolate->GetCurrentContext();
|
|
1594
|
+
|
|
1595
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1596
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
1597
|
+
auto ret = canvas_native_webgl2_get_indexed_parameter(
|
|
1598
|
+
target,
|
|
1599
|
+
index,
|
|
1600
|
+
ptr->GetState()
|
|
1601
|
+
);
|
|
1602
|
+
|
|
1603
|
+
switch (target) {
|
|
1604
|
+
case GL_UNIFORM_BUFFER_BINDING:
|
|
1605
|
+
case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: {
|
|
1606
|
+
auto buffer = canvas_native_webgl2_indexed_parameter_get_buffer_value(
|
|
1607
|
+
ret);
|
|
1608
|
+
|
|
1609
|
+
args.GetReturnValue().Set(
|
|
1610
|
+
WebGLBuffer::NewInstance(isolate, new WebGLBuffer(buffer)));
|
|
1611
|
+
}
|
|
1612
|
+
return;
|
|
1613
|
+
case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
|
|
1614
|
+
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
|
|
1615
|
+
case GL_UNIFORM_BUFFER_SIZE:
|
|
1616
|
+
case GL_UNIFORM_BUFFER_START: {
|
|
1617
|
+
auto value = canvas_native_webgl2_indexed_parameter_get_value(
|
|
1618
|
+
ret);
|
|
1619
|
+
args.GetReturnValue().Set(static_cast<double>(value));
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
break;
|
|
1623
|
+
default:
|
|
1624
|
+
args.GetReturnValue().SetNull();
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
void WebGL2RenderingContext::GetInternalformatParameter(
|
|
1630
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1631
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1632
|
+
if (ptr == nullptr) {
|
|
1633
|
+
args.GetReturnValue().SetNull();
|
|
1634
|
+
return;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
auto isolate = args.GetIsolate();
|
|
1638
|
+
auto context = isolate->GetCurrentContext();
|
|
1639
|
+
|
|
1640
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1641
|
+
auto internalformat = args[1]->Uint32Value(context).ToChecked();
|
|
1642
|
+
auto pname = args[2]->Uint32Value(context).ToChecked();
|
|
1643
|
+
switch (internalformat) {
|
|
1644
|
+
case GL_RGB:
|
|
1645
|
+
case GL_RGBA:
|
|
1646
|
+
case GL_R8UI:
|
|
1647
|
+
case GL_R8I:
|
|
1648
|
+
case GL_R16UI:
|
|
1649
|
+
case GL_R16I:
|
|
1650
|
+
case GL_R32UI:
|
|
1651
|
+
case GL_R32I:
|
|
1652
|
+
case GL_RG8UI:
|
|
1653
|
+
case GL_RG8I:
|
|
1654
|
+
case GL_RG16UI:
|
|
1655
|
+
case GL_RG16I:
|
|
1656
|
+
case GL_RG32UI:
|
|
1657
|
+
case GL_RG32I:
|
|
1658
|
+
case GL_RGBA8UI:
|
|
1659
|
+
case GL_RGBA8I:
|
|
1660
|
+
case GL_RGB10_A2UI:
|
|
1661
|
+
case GL_RGBA16UI:
|
|
1662
|
+
case GL_RGBA16I:
|
|
1663
|
+
case GL_RGBA32UI:
|
|
1664
|
+
case GL_RGBA32I: {
|
|
1665
|
+
// empty
|
|
1666
|
+
auto arraybuffer = v8::ArrayBuffer::New(isolate, 0);
|
|
1667
|
+
|
|
1668
|
+
args.GetReturnValue().Set(v8::Int32Array::New(arraybuffer, 0, 0));
|
|
1669
|
+
return;
|
|
1670
|
+
}
|
|
1671
|
+
case GL_R8:
|
|
1672
|
+
case GL_RG8:
|
|
1673
|
+
case GL_RGB565:
|
|
1674
|
+
case GL_RGBA8:
|
|
1675
|
+
case GL_SRGB8_ALPHA8:
|
|
1676
|
+
case GL_RGB5_A1:
|
|
1677
|
+
case GL_RGBA4:
|
|
1678
|
+
case GL_RGB10_A2:
|
|
1679
|
+
case GL_DEPTH_COMPONENT16:
|
|
1680
|
+
case GL_DEPTH_COMPONENT24:
|
|
1681
|
+
case GL_DEPTH_COMPONENT32F:
|
|
1682
|
+
case GL_DEPTH24_STENCIL8:
|
|
1683
|
+
case GL_DEPTH32F_STENCIL8:
|
|
1684
|
+
case GL_STENCIL_INDEX8:
|
|
1685
|
+
// noop
|
|
1686
|
+
break;
|
|
1687
|
+
case GL_R16F:
|
|
1688
|
+
case GL_RG16F:
|
|
1689
|
+
case GL_R32F:
|
|
1690
|
+
case GL_RG32F:
|
|
1691
|
+
case GL_RGBA32F:
|
|
1692
|
+
case GL_R11F_G11F_B10F:
|
|
1693
|
+
// noop
|
|
1694
|
+
break;
|
|
1695
|
+
default:
|
|
1696
|
+
args.GetReturnValue().SetNull();
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
|
|
1701
|
+
auto ret = canvas_native_webgl2_get_internalformat_parameter(
|
|
1702
|
+
target,
|
|
1703
|
+
internalformat,
|
|
1704
|
+
pname,
|
|
1705
|
+
ptr->GetState()
|
|
1706
|
+
);
|
|
1707
|
+
|
|
1708
|
+
if (pname == GL_SAMPLES) {
|
|
1709
|
+
auto value = canvas_native_webgl_result_get_i32_array(ret);
|
|
1710
|
+
|
|
1711
|
+
auto buf = (uint8_t *) canvas_native_i32_buffer_get_bytes(value);
|
|
1712
|
+
auto size = canvas_native_i32_buffer_get_length(value);
|
|
1713
|
+
auto bytes_size = size * sizeof(int32_t);
|
|
1714
|
+
|
|
1715
|
+
auto store = v8::ArrayBuffer::NewBackingStore(buf, bytes_size,
|
|
1716
|
+
[](void *data, size_t length,
|
|
1717
|
+
void *deleter_data) {
|
|
1718
|
+
if (deleter_data != nullptr) {
|
|
1719
|
+
canvas_native_i32_buffer_destroy(
|
|
1720
|
+
(I32Buffer *) deleter_data);
|
|
1721
|
+
}
|
|
1722
|
+
},
|
|
1723
|
+
value);
|
|
1724
|
+
|
|
1725
|
+
auto arraybuffer = v8::ArrayBuffer::New(isolate, std::move(store));
|
|
1726
|
+
args.GetReturnValue().Set(v8::Int32Array::New(arraybuffer, 0, size));
|
|
1727
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1728
|
+
return;
|
|
1729
|
+
} else {
|
|
1730
|
+
args.GetReturnValue().SetNull();
|
|
1731
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
void WebGL2RenderingContext::GetParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1737
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1738
|
+
if (ptr == nullptr) {
|
|
1739
|
+
args.GetReturnValue().SetNull();
|
|
1740
|
+
return;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
auto isolate = args.GetIsolate();
|
|
1744
|
+
auto context = isolate->GetCurrentContext();
|
|
1745
|
+
|
|
1746
|
+
auto pname = args[0]->Uint32Value(context).ToChecked();
|
|
1747
|
+
auto result = canvas_native_webgl2_get_parameter(
|
|
1748
|
+
pname,
|
|
1749
|
+
ptr->GetState());
|
|
1750
|
+
switch (pname) {
|
|
1751
|
+
case GL_COPY_READ_BUFFER_BINDING:
|
|
1752
|
+
case GL_COPY_WRITE_BUFFER_BINDING:
|
|
1753
|
+
case GL_DRAW_FRAMEBUFFER_BINDING:
|
|
1754
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1755
|
+
result));
|
|
1756
|
+
|
|
1757
|
+
canvas_native_webgl_WebGLResult_destroy(result);
|
|
1758
|
+
return;
|
|
1759
|
+
default: {
|
|
1760
|
+
auto ret = ptr->GetParameterInternal(
|
|
1761
|
+
isolate, pname, result);
|
|
1762
|
+
|
|
1763
|
+
canvas_native_webgl_WebGLResult_destroy(result);
|
|
1764
|
+
|
|
1765
|
+
args.GetReturnValue().Set(ret);
|
|
1766
|
+
return;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
void WebGL2RenderingContext::GetQueryParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1772
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1773
|
+
if (ptr == nullptr) {
|
|
1774
|
+
args.GetReturnValue().SetNull();
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
auto isolate = args.GetIsolate();
|
|
1779
|
+
auto context = isolate->GetCurrentContext();
|
|
1780
|
+
|
|
1781
|
+
auto queryValue = args[0];
|
|
1782
|
+
auto type = GetNativeType(queryValue);
|
|
1783
|
+
if (type == NativeType::WebGLQuery) {
|
|
1784
|
+
auto query = WebGLQuery::GetPointer(queryValue.As<v8::Object>());
|
|
1785
|
+
if (query != nullptr) {
|
|
1786
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
auto ret = canvas_native_webgl2_get_query_parameter(
|
|
1790
|
+
query->GetQuery(),
|
|
1791
|
+
pname,
|
|
1792
|
+
ptr->GetState());
|
|
1793
|
+
if (pname == GL_QUERY_RESULT) {
|
|
1794
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_bool(
|
|
1795
|
+
ret));
|
|
1796
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1797
|
+
return;
|
|
1798
|
+
} else if (pname ==
|
|
1799
|
+
GL_QUERY_RESULT_AVAILABLE) {
|
|
1800
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_u32(
|
|
1801
|
+
ret));
|
|
1802
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
//clean up
|
|
1806
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1807
|
+
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
args.GetReturnValue().SetNull();
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
void WebGL2RenderingContext::GetQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1815
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1816
|
+
if (ptr == nullptr) {
|
|
1817
|
+
args.GetReturnValue().SetNull();
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
auto isolate = args.GetIsolate();
|
|
1822
|
+
auto context = isolate->GetCurrentContext();
|
|
1823
|
+
|
|
1824
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1825
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1826
|
+
auto ret = canvas_native_webgl2_get_query(
|
|
1827
|
+
target,
|
|
1828
|
+
pname,
|
|
1829
|
+
ptr->GetState());
|
|
1830
|
+
if (pname == GL_CURRENT_QUERY) {
|
|
1831
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1832
|
+
ret));
|
|
1833
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
// clean up
|
|
1837
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
void WebGL2RenderingContext::GetSamplerParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1841
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1842
|
+
if (ptr == nullptr) {
|
|
1843
|
+
args.GetReturnValue().SetNull();
|
|
1844
|
+
return;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
auto isolate = args.GetIsolate();
|
|
1848
|
+
auto context = isolate->GetCurrentContext();
|
|
1849
|
+
|
|
1850
|
+
auto samplerValue = args[0];
|
|
1851
|
+
auto type = GetNativeType(samplerValue);
|
|
1852
|
+
if (type == NativeType::WebGLSampler) {
|
|
1853
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
1854
|
+
if (sampler != nullptr) {
|
|
1855
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1856
|
+
auto ret = canvas_native_webgl2_get_sampler_parameter(
|
|
1857
|
+
sampler->GetSampler(),
|
|
1858
|
+
pname,
|
|
1859
|
+
ptr->GetState());
|
|
1860
|
+
|
|
1861
|
+
switch (pname) {
|
|
1862
|
+
case GL_TEXTURE_MAX_LOD:
|
|
1863
|
+
case GL_TEXTURE_MIN_LOD:
|
|
1864
|
+
args.GetReturnValue().Set(
|
|
1865
|
+
static_cast<double>(canvas_native_webgl_result_get_f32(
|
|
1866
|
+
ret)));
|
|
1867
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1868
|
+
return;
|
|
1869
|
+
case GL_TEXTURE_COMPARE_FUNC:
|
|
1870
|
+
case GL_TEXTURE_COMPARE_MODE:
|
|
1871
|
+
case GL_TEXTURE_MAG_FILTER:
|
|
1872
|
+
case GL_TEXTURE_MIN_FILTER:
|
|
1873
|
+
case GL_TEXTURE_WRAP_R:
|
|
1874
|
+
case GL_TEXTURE_WRAP_S:
|
|
1875
|
+
case GL_TEXTURE_WRAP_T:
|
|
1876
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1877
|
+
ret));
|
|
1878
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1879
|
+
return;
|
|
1880
|
+
default:
|
|
1881
|
+
args.GetReturnValue().SetNull();
|
|
1882
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1883
|
+
return;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
args.GetReturnValue().SetNull();
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
void WebGL2RenderingContext::GetSyncParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1892
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1893
|
+
if (ptr == nullptr) {
|
|
1894
|
+
args.GetReturnValue().SetNull();
|
|
1895
|
+
return;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
auto isolate = args.GetIsolate();
|
|
1899
|
+
auto context = isolate->GetCurrentContext();
|
|
1900
|
+
|
|
1901
|
+
auto syncValue = args[0];
|
|
1902
|
+
auto sync = WebGLSyncImpl::GetPointer(syncValue.As<v8::Object>());
|
|
1903
|
+
if (sync != nullptr) {
|
|
1904
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1905
|
+
auto ret = canvas_native_webgl2_get_sync_parameter(
|
|
1906
|
+
sync->GetSync(),
|
|
1907
|
+
pname,
|
|
1908
|
+
ptr->GetState());
|
|
1909
|
+
|
|
1910
|
+
switch (pname) {
|
|
1911
|
+
case GL_OBJECT_TYPE:
|
|
1912
|
+
case GL_SYNC_STATUS:
|
|
1913
|
+
case GL_SYNC_CONDITION:
|
|
1914
|
+
case GL_SYNC_FLAGS:
|
|
1915
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1916
|
+
ret));
|
|
1917
|
+
|
|
1918
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1919
|
+
return;
|
|
1920
|
+
default:
|
|
1921
|
+
args.GetReturnValue().SetNull();
|
|
1922
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1923
|
+
return;
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
args.GetReturnValue().SetNull();
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
void WebGL2RenderingContext::GetTransformFeedbackVarying(
|
|
1930
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1931
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1932
|
+
if (ptr == nullptr) {
|
|
1933
|
+
args.GetReturnValue().SetNull();
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
auto isolate = args.GetIsolate();
|
|
1938
|
+
auto context = isolate->GetCurrentContext();
|
|
1939
|
+
|
|
1940
|
+
auto programValue = args[0];
|
|
1941
|
+
auto type = GetNativeType(programValue);
|
|
1942
|
+
if (type == NativeType::WebGLProgram) {
|
|
1943
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1944
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
1945
|
+
if (program != nullptr) {
|
|
1946
|
+
auto ret = canvas_native_webgl2_get_transform_feedback_varying(
|
|
1947
|
+
program->GetProgram(),
|
|
1948
|
+
index,
|
|
1949
|
+
ptr->GetState()
|
|
1950
|
+
);
|
|
1951
|
+
|
|
1952
|
+
if (canvas_native_webgl_active_info_get_is_empty(
|
|
1953
|
+
ret)) {
|
|
1954
|
+
canvas_native_webgl_active_info_destroy(ret);
|
|
1955
|
+
args.GetReturnValue().SetNull();
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
auto info = WebGLActiveInfoImpl::NewInstance(isolate, new WebGLActiveInfoImpl(ret));
|
|
1960
|
+
args.GetReturnValue().Set(info);
|
|
1961
|
+
return;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
args.GetReturnValue().SetNull();
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
void WebGL2RenderingContext::GetUniformBlockIndex(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1969
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1970
|
+
if (ptr == nullptr) {
|
|
1971
|
+
args.GetReturnValue().SetNull();
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
auto isolate = args.GetIsolate();
|
|
1976
|
+
auto context = isolate->GetCurrentContext();
|
|
1977
|
+
|
|
1978
|
+
auto programValue = args[0];
|
|
1979
|
+
auto type = GetNativeType(programValue);
|
|
1980
|
+
if (type == NativeType::WebGLProgram) {
|
|
1981
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1982
|
+
auto index = ConvertFromV8String(isolate, args[1]);
|
|
1983
|
+
if (program != nullptr) {
|
|
1984
|
+
auto ret = canvas_native_webgl2_get_uniform_block_index(
|
|
1985
|
+
program->GetProgram(),
|
|
1986
|
+
index.c_str(),
|
|
1987
|
+
ptr->GetState());
|
|
1988
|
+
args.GetReturnValue().Set((int) ret);
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
args.GetReturnValue().SetNull();
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
void WebGL2RenderingContext::GetUniformIndices(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1997
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
1998
|
+
if (ptr == nullptr) {
|
|
1999
|
+
args.GetReturnValue().SetNull();
|
|
2000
|
+
return;
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
auto isolate = args.GetIsolate();
|
|
2004
|
+
auto context = isolate->GetCurrentContext();
|
|
2005
|
+
|
|
2006
|
+
auto programValue = args[0];
|
|
2007
|
+
auto type = GetNativeType(programValue);
|
|
2008
|
+
if (type == NativeType::WebGLProgram) {
|
|
2009
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
2010
|
+
auto uniformNamesObject = args[1];
|
|
2011
|
+
if (program != nullptr &&
|
|
2012
|
+
uniformNamesObject->IsArray()) {
|
|
2013
|
+
auto uniformNames = uniformNamesObject.As<v8::Array>();
|
|
2014
|
+
auto len = uniformNames->Length();
|
|
2015
|
+
|
|
2016
|
+
std::vector<std::string> store;
|
|
2017
|
+
store.reserve(len);
|
|
2018
|
+
|
|
2019
|
+
for (int j = 0; j < len; ++j) {
|
|
2020
|
+
auto name = ConvertFromV8String(isolate, uniformNames->Get(
|
|
2021
|
+
context, j).ToLocalChecked());
|
|
2022
|
+
|
|
2023
|
+
store.push_back(name);
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
|
|
2027
|
+
const char *cStrings[store.size()];
|
|
2028
|
+
for (size_t i = 0; i < store.size(); ++i) {
|
|
2029
|
+
cStrings[i] = store[i].c_str();
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
auto ret = canvas_native_webgl2_get_uniform_indices(
|
|
2034
|
+
program->GetProgram(),
|
|
2035
|
+
cStrings,
|
|
2036
|
+
store.size(),
|
|
2037
|
+
ptr->GetState());
|
|
2038
|
+
|
|
2039
|
+
|
|
2040
|
+
auto retSize = canvas_native_u32_buffer_get_length(ret);
|
|
2041
|
+
auto buf = canvas_native_u32_buffer_get_bytes(ret);
|
|
2042
|
+
auto result = v8::Array::New(isolate, (int) retSize);
|
|
2043
|
+
for (int j = 0; j < retSize; ++j) {
|
|
2044
|
+
auto item = buf[j];
|
|
2045
|
+
result->Set(context,
|
|
2046
|
+
j,
|
|
2047
|
+
v8::Integer::NewFromUnsigned(isolate, item));
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
args.GetReturnValue().Set(result);
|
|
2051
|
+
canvas_native_u32_buffer_destroy(ret);
|
|
2052
|
+
return;
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
args.GetReturnValue().SetNull();
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
void
|
|
2060
|
+
WebGL2RenderingContext::InvalidateFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2061
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2062
|
+
if (ptr == nullptr) {
|
|
2063
|
+
return;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
auto isolate = args.GetIsolate();
|
|
2067
|
+
auto context = isolate->GetCurrentContext();
|
|
2068
|
+
|
|
2069
|
+
auto attachments = args[1];
|
|
2070
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
2071
|
+
|
|
2072
|
+
if (attachments->IsArray()) {
|
|
2073
|
+
auto array = attachments.As<v8::Array>();
|
|
2074
|
+
auto len = array->Length();
|
|
2075
|
+
std::vector<uint32_t> buf;
|
|
2076
|
+
buf.reserve(len);
|
|
2077
|
+
for (int j = 0; j < len; ++j) {
|
|
2078
|
+
auto item = array->Get(
|
|
2079
|
+
context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
|
|
2080
|
+
buf.push_back(item);
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
canvas_native_webgl2_invalidate_framebuffer(
|
|
2084
|
+
target, buf.data(), buf.size(),
|
|
2085
|
+
ptr->GetState());
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
void
|
|
2090
|
+
WebGL2RenderingContext::InvalidateSubFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2091
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2092
|
+
if (ptr == nullptr) {
|
|
2093
|
+
return;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
auto isolate = args.GetIsolate();
|
|
2097
|
+
auto context = isolate->GetCurrentContext();
|
|
2098
|
+
|
|
2099
|
+
auto attachments = args[1];
|
|
2100
|
+
if (attachments->IsArray()) {
|
|
2101
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
2102
|
+
auto x = args[2]->Int32Value(context).ToChecked();
|
|
2103
|
+
auto y = args[3]->Int32Value(context).ToChecked();
|
|
2104
|
+
auto width = args[4]->Int32Value(context).ToChecked();
|
|
2105
|
+
auto height = args[5]->Int32Value(context).ToChecked();
|
|
2106
|
+
|
|
2107
|
+
auto array = attachments.As<v8::Array>();
|
|
2108
|
+
auto len = array->Length();
|
|
2109
|
+
std::vector<uint32_t> buf;
|
|
2110
|
+
buf.reserve(len);
|
|
2111
|
+
for (int j = 0; j < len; ++j) {
|
|
2112
|
+
auto item = array->Get(
|
|
2113
|
+
context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
|
|
2114
|
+
buf.push_back(item);
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
canvas_native_webgl2_invalidate_sub_framebuffer(
|
|
2118
|
+
target,
|
|
2119
|
+
buf.data(), buf.size(),
|
|
2120
|
+
x,
|
|
2121
|
+
y,
|
|
2122
|
+
width,
|
|
2123
|
+
height,
|
|
2124
|
+
ptr->GetState());
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
void WebGL2RenderingContext::IsQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2129
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2130
|
+
if (ptr == nullptr) {
|
|
2131
|
+
return;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
auto isolate = args.GetIsolate();
|
|
2135
|
+
auto context = isolate->GetCurrentContext();
|
|
2136
|
+
|
|
2137
|
+
auto value = args[0];
|
|
2138
|
+
auto type = GetNativeType(value);
|
|
2139
|
+
if (type == NativeType::WebGLQuery) {
|
|
2140
|
+
auto query = WebGLQuery::GetPointer(value.As<v8::Object>());
|
|
2141
|
+
if (query != nullptr) {
|
|
2142
|
+
auto ret = canvas_native_webgl2_is_query(
|
|
2143
|
+
query->GetQuery(),
|
|
2144
|
+
ptr->GetState());
|
|
2145
|
+
args.GetReturnValue().Set(ret);
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
// todo check return
|
|
2150
|
+
args.GetReturnValue().Set(false);
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
void WebGL2RenderingContext::IsSampler(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2154
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2155
|
+
if (ptr == nullptr) {
|
|
2156
|
+
return;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
auto isolate = args.GetIsolate();
|
|
2160
|
+
auto context = isolate->GetCurrentContext();
|
|
2161
|
+
|
|
2162
|
+
auto value = args[0];
|
|
2163
|
+
auto type = GetNativeType(value);
|
|
2164
|
+
if (type == NativeType::WebGLSampler) {
|
|
2165
|
+
auto query = WebGLSampler::GetPointer(value.As<v8::Object>());
|
|
2166
|
+
if (query != nullptr) {
|
|
2167
|
+
auto ret = canvas_native_webgl2_is_sampler(
|
|
2168
|
+
query->GetSampler(),
|
|
2169
|
+
ptr->GetState());
|
|
2170
|
+
args.GetReturnValue().Set(ret);
|
|
2171
|
+
return;
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
// todo check return
|
|
2175
|
+
args.GetReturnValue().Set(false);
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
void WebGL2RenderingContext::IsSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2179
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2180
|
+
if (ptr == nullptr) {
|
|
2181
|
+
return;
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
auto isolate = args.GetIsolate();
|
|
2185
|
+
auto context = isolate->GetCurrentContext();
|
|
2186
|
+
|
|
2187
|
+
auto value = args[0];
|
|
2188
|
+
auto type = GetNativeType(value);
|
|
2189
|
+
if (type == NativeType::WebGLSync) {
|
|
2190
|
+
auto query = WebGLSyncImpl::GetPointer(value.As<v8::Object>());
|
|
2191
|
+
if (query != nullptr) {
|
|
2192
|
+
auto ret = canvas_native_webgl2_is_sync(
|
|
2193
|
+
query->GetSync(),
|
|
2194
|
+
ptr->GetState());
|
|
2195
|
+
args.GetReturnValue().Set(ret);
|
|
2196
|
+
return;
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
// todo check return
|
|
2200
|
+
args.GetReturnValue().Set(false);
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
void WebGL2RenderingContext::IsTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2204
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2205
|
+
if (ptr == nullptr) {
|
|
2206
|
+
return;
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
auto isolate = args.GetIsolate();
|
|
2210
|
+
auto context = isolate->GetCurrentContext();
|
|
2211
|
+
|
|
2212
|
+
auto value = args[0];
|
|
2213
|
+
auto type = GetNativeType(value);
|
|
2214
|
+
if (type == NativeType::WebGLTransformFeedback) {
|
|
2215
|
+
auto query = WebGLTransformFeedback::GetPointer(value.As<v8::Object>());
|
|
2216
|
+
if (query != nullptr) {
|
|
2217
|
+
auto ret = canvas_native_webgl2_is_transform_feedback(
|
|
2218
|
+
query->GetFeedback(),
|
|
2219
|
+
ptr->GetState());
|
|
2220
|
+
args.GetReturnValue().Set(ret);
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
// todo check return
|
|
2225
|
+
args.GetReturnValue().Set(false);
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
void WebGL2RenderingContext::IsVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2229
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2230
|
+
if (ptr == nullptr) {
|
|
2231
|
+
return;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
auto isolate = args.GetIsolate();
|
|
2235
|
+
auto context = isolate->GetCurrentContext();
|
|
2236
|
+
|
|
2237
|
+
auto value = args[0];
|
|
2238
|
+
auto type = GetNativeType(value);
|
|
2239
|
+
if (type == NativeType::WebGLVertexArrayObject) {
|
|
2240
|
+
auto query = WebGLVertexArrayObject::GetPointer(value.As<v8::Object>());
|
|
2241
|
+
if (query != nullptr) {
|
|
2242
|
+
auto ret = canvas_native_webgl2_is_vertex_array(
|
|
2243
|
+
query->GetVertexArrayObject(),
|
|
2244
|
+
ptr->GetState());
|
|
2245
|
+
args.GetReturnValue().Set(ret);
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
// todo check return
|
|
2250
|
+
args.GetReturnValue().Set(false);
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
void
|
|
2254
|
+
WebGL2RenderingContext::PauseTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2255
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2256
|
+
if (ptr == nullptr) {
|
|
2257
|
+
return;
|
|
2258
|
+
}
|
|
2259
|
+
canvas_native_webgl2_pause_transform_feedback(
|
|
2260
|
+
ptr->GetState());
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
void WebGL2RenderingContext::ReadBuffer(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2264
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2265
|
+
if (ptr == nullptr) {
|
|
2266
|
+
return;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
auto isolate = args.GetIsolate();
|
|
2270
|
+
auto context = isolate->GetCurrentContext();
|
|
2271
|
+
|
|
2272
|
+
auto src = args[0]->Uint32Value(context).ToChecked();
|
|
2273
|
+
canvas_native_webgl2_read_buffer(
|
|
2274
|
+
src,
|
|
2275
|
+
ptr->GetState()
|
|
2276
|
+
);
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
void WebGL2RenderingContext::RenderbufferStorageMultisample(
|
|
2280
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2281
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2282
|
+
if (ptr == nullptr) {
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
auto isolate = args.GetIsolate();
|
|
2287
|
+
auto context = isolate->GetCurrentContext();
|
|
2288
|
+
|
|
2289
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
2290
|
+
auto samples = args[1]->Int32Value(context).ToChecked();
|
|
2291
|
+
auto internalFormat = args[2]->Uint32Value(context).ToChecked();
|
|
2292
|
+
auto width = args[3]->Int32Value(context).ToChecked();
|
|
2293
|
+
auto height = args[4]->Int32Value(context).ToChecked();
|
|
2294
|
+
canvas_native_webgl2_renderbuffer_storage_multisample(
|
|
2295
|
+
target,
|
|
2296
|
+
samples,
|
|
2297
|
+
internalFormat,
|
|
2298
|
+
width,
|
|
2299
|
+
height,
|
|
2300
|
+
ptr->GetState()
|
|
2301
|
+
);
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
void
|
|
2305
|
+
WebGL2RenderingContext::ResumeTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2306
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2307
|
+
if (ptr == nullptr) {
|
|
2308
|
+
return;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
canvas_native_webgl2_resume_transform_feedback(
|
|
2312
|
+
ptr->GetState());
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
void WebGL2RenderingContext::SamplerParameterf(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2316
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2317
|
+
if (ptr == nullptr) {
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
auto isolate = args.GetIsolate();
|
|
2322
|
+
auto context = isolate->GetCurrentContext();
|
|
2323
|
+
|
|
2324
|
+
auto samplerValue = args[0];
|
|
2325
|
+
auto type = GetNativeType(samplerValue);
|
|
2326
|
+
if (type == NativeType::WebGLSampler) {
|
|
2327
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
2328
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
2329
|
+
auto param = args[2]->NumberValue(context).ToChecked();
|
|
2330
|
+
if (sampler != nullptr) {
|
|
2331
|
+
canvas_native_webgl2_sampler_parameterf(
|
|
2332
|
+
sampler->GetSampler(),
|
|
2333
|
+
pname,
|
|
2334
|
+
static_cast<float>(param),
|
|
2335
|
+
ptr->GetState());
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
void WebGL2RenderingContext::SamplerParameteri(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2342
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2343
|
+
if (ptr == nullptr) {
|
|
2344
|
+
return;
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
auto isolate = args.GetIsolate();
|
|
2348
|
+
auto context = isolate->GetCurrentContext();
|
|
2349
|
+
|
|
2350
|
+
auto samplerValue = args[0];
|
|
2351
|
+
auto type = GetNativeType(samplerValue);
|
|
2352
|
+
if (type == NativeType::WebGLSampler) {
|
|
2353
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
2354
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
2355
|
+
auto param = args[2]->Int32Value(context).ToChecked();
|
|
2356
|
+
if (sampler != nullptr) {
|
|
2357
|
+
canvas_native_webgl2_sampler_parameteri(
|
|
2358
|
+
sampler->GetSampler(),
|
|
2359
|
+
pname,
|
|
2360
|
+
param,
|
|
2361
|
+
ptr->GetState());
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2368
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2369
|
+
if (ptr == nullptr) {
|
|
2370
|
+
return;
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
auto isolate = args.GetIsolate();
|
|
2374
|
+
auto context = isolate->GetCurrentContext();
|
|
2375
|
+
|
|
2376
|
+
auto count = args.Length();
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
if (count == 10) {
|
|
2380
|
+
auto target = args[0]->Int32Value(
|
|
2381
|
+
context).ToChecked();
|
|
2382
|
+
auto level = args[1]->Int32Value(
|
|
2383
|
+
context).ToChecked();
|
|
2384
|
+
auto internalformat = args[2]->Int32Value(
|
|
2385
|
+
context).ToChecked();
|
|
2386
|
+
auto width = args[3]->Int32Value(
|
|
2387
|
+
context).ToChecked();
|
|
2388
|
+
auto height = args[4]->Int32Value(
|
|
2389
|
+
context).ToChecked();
|
|
2390
|
+
auto depth = args[5]->Int32Value(
|
|
2391
|
+
context).ToChecked();
|
|
2392
|
+
auto border = args[6]->Int32Value(
|
|
2393
|
+
context).ToChecked();
|
|
2394
|
+
auto format = args[7]->Int32Value(
|
|
2395
|
+
context).ToChecked();
|
|
2396
|
+
auto type = args[8]->Uint32Value(
|
|
2397
|
+
context).ToChecked();
|
|
2398
|
+
|
|
2399
|
+
auto imageOrPixelsOrOffset = args[9];
|
|
2400
|
+
|
|
2401
|
+
if (imageOrPixelsOrOffset->IsNumber()) {
|
|
2402
|
+
auto offset = imageOrPixelsOrOffset->NumberValue(
|
|
2403
|
+
context).ToChecked();
|
|
2404
|
+
canvas_native_webgl2_tex_image3d_none(
|
|
2405
|
+
target,
|
|
2406
|
+
level,
|
|
2407
|
+
internalformat,
|
|
2408
|
+
width,
|
|
2409
|
+
height,
|
|
2410
|
+
depth,
|
|
2411
|
+
border,
|
|
2412
|
+
format,
|
|
2413
|
+
type,
|
|
2414
|
+
static_cast<ssize_t>(offset),
|
|
2415
|
+
ptr->GetState()
|
|
2416
|
+
);
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
|
|
2421
|
+
if (imageOrPixelsOrOffset->IsArrayBufferView()) {
|
|
2422
|
+
auto buf = imageOrPixelsOrOffset.As<v8::ArrayBufferView>();
|
|
2423
|
+
|
|
2424
|
+
auto array = buf->Buffer();
|
|
2425
|
+
auto offset = buf->ByteOffset();
|
|
2426
|
+
auto size = buf->ByteLength();
|
|
2427
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2428
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2429
|
+
|
|
2430
|
+
|
|
2431
|
+
canvas_native_webgl2_tex_image3d(
|
|
2432
|
+
target,
|
|
2433
|
+
level,
|
|
2434
|
+
internalformat,
|
|
2435
|
+
width,
|
|
2436
|
+
height,
|
|
2437
|
+
depth,
|
|
2438
|
+
border,
|
|
2439
|
+
format,
|
|
2440
|
+
type,
|
|
2441
|
+
data,
|
|
2442
|
+
size,
|
|
2443
|
+
ptr->GetState()
|
|
2444
|
+
);
|
|
2445
|
+
return;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
auto imageType = GetNativeType(imageOrPixelsOrOffset);
|
|
2449
|
+
|
|
2450
|
+
switch (imageType) {
|
|
2451
|
+
case NativeType::ImageAsset: {
|
|
2452
|
+
auto image_asset = ImageAssetImpl::GetPointer(
|
|
2453
|
+
imageOrPixelsOrOffset.As<v8::Object>());
|
|
2454
|
+
if (image_asset != nullptr) {
|
|
2455
|
+
canvas_native_webgl2_tex_image3d_asset(
|
|
2456
|
+
target,
|
|
2457
|
+
level,
|
|
2458
|
+
internalformat,
|
|
2459
|
+
width,
|
|
2460
|
+
height,
|
|
2461
|
+
depth,
|
|
2462
|
+
border,
|
|
2463
|
+
format,
|
|
2464
|
+
type,
|
|
2465
|
+
image_asset->GetImageAsset(),
|
|
2466
|
+
ptr->GetState()
|
|
2467
|
+
);
|
|
2468
|
+
|
|
2469
|
+
return;
|
|
2470
|
+
}
|
|
2471
|
+
return;
|
|
2472
|
+
}
|
|
2473
|
+
case NativeType::ImageBitmap: {
|
|
2474
|
+
auto image_bitmap = ImageBitmapImpl::GetPointer(
|
|
2475
|
+
imageOrPixelsOrOffset.As<v8::Object>());
|
|
2476
|
+
if (image_bitmap != nullptr) {
|
|
2477
|
+
canvas_native_webgl2_tex_image3d_asset(
|
|
2478
|
+
target,
|
|
2479
|
+
level,
|
|
2480
|
+
internalformat,
|
|
2481
|
+
width,
|
|
2482
|
+
height,
|
|
2483
|
+
depth,
|
|
2484
|
+
border,
|
|
2485
|
+
format,
|
|
2486
|
+
type,
|
|
2487
|
+
image_bitmap->GetImageAsset(),
|
|
2488
|
+
ptr->GetState()
|
|
2489
|
+
);
|
|
2490
|
+
|
|
2491
|
+
return;
|
|
2492
|
+
}
|
|
2493
|
+
return;
|
|
2494
|
+
}
|
|
2495
|
+
default:
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2498
|
+
} else if (args.Length() > 10) {
|
|
2499
|
+
|
|
2500
|
+
auto target = args[0]->Int32Value(
|
|
2501
|
+
context).ToChecked();
|
|
2502
|
+
auto level = args[1]->Int32Value(
|
|
2503
|
+
context).ToChecked();
|
|
2504
|
+
auto internalformat = args[2]->Int32Value(
|
|
2505
|
+
context).ToChecked();
|
|
2506
|
+
auto width = args[3]->Int32Value(
|
|
2507
|
+
context).ToChecked();
|
|
2508
|
+
auto height = args[4]->Int32Value(
|
|
2509
|
+
context).ToChecked();
|
|
2510
|
+
auto depth = args[5]->Int32Value(
|
|
2511
|
+
context).ToChecked();
|
|
2512
|
+
auto border = args[6]->Int32Value(
|
|
2513
|
+
context).ToChecked();
|
|
2514
|
+
auto format = args[7]->Int32Value(
|
|
2515
|
+
context).ToChecked();
|
|
2516
|
+
auto type = args[8]->Uint32Value(
|
|
2517
|
+
context).ToChecked();
|
|
2518
|
+
|
|
2519
|
+
auto imageOrPixelsOrOffset = args[9];
|
|
2520
|
+
|
|
2521
|
+
size_t srcOffsetValue = 0;
|
|
2522
|
+
if (args[9]->IsNumber()) {
|
|
2523
|
+
srcOffsetValue = static_cast<size_t>(args[9]->NumberValue(
|
|
2524
|
+
context).ToChecked());
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
if (imageOrPixelsOrOffset->IsArrayBufferView()) {
|
|
2528
|
+
auto buf = imageOrPixelsOrOffset.As<v8::ArrayBufferView>();
|
|
2529
|
+
|
|
2530
|
+
auto array = buf->Buffer();
|
|
2531
|
+
auto offset = buf->ByteOffset();
|
|
2532
|
+
auto size = buf->ByteLength();
|
|
2533
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2534
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2535
|
+
|
|
2536
|
+
srcOffsetValue =
|
|
2537
|
+
srcOffsetValue * size;
|
|
2538
|
+
if (srcOffsetValue >
|
|
2539
|
+
size) {
|
|
2540
|
+
return;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
canvas_native_webgl2_tex_image3d_offset(
|
|
2544
|
+
target,
|
|
2545
|
+
level,
|
|
2546
|
+
internalformat,
|
|
2547
|
+
width,
|
|
2548
|
+
height,
|
|
2549
|
+
depth,
|
|
2550
|
+
border,
|
|
2551
|
+
format,
|
|
2552
|
+
type,
|
|
2553
|
+
data, size,
|
|
2554
|
+
srcOffsetValue,
|
|
2555
|
+
ptr->GetState()
|
|
2556
|
+
);
|
|
2557
|
+
return;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
void WebGL2RenderingContext::TexStorage2D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2564
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2565
|
+
if (ptr == nullptr) {
|
|
2566
|
+
return;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
auto isolate = args.GetIsolate();
|
|
2570
|
+
auto context = isolate->GetCurrentContext();
|
|
2571
|
+
|
|
2572
|
+
auto target = args[0]->Uint32Value(
|
|
2573
|
+
context).ToChecked();
|
|
2574
|
+
auto levels = args[1]->Int32Value(
|
|
2575
|
+
context).ToChecked();
|
|
2576
|
+
auto internalFormat = args[2]->Uint32Value(
|
|
2577
|
+
context).ToChecked();
|
|
2578
|
+
auto width = args[3]->Int32Value(
|
|
2579
|
+
context).ToChecked();
|
|
2580
|
+
auto height = args[4]->Int32Value(
|
|
2581
|
+
context).ToChecked();
|
|
2582
|
+
canvas_native_webgl2_tex_storage2d(
|
|
2583
|
+
target,
|
|
2584
|
+
levels,
|
|
2585
|
+
internalFormat,
|
|
2586
|
+
width,
|
|
2587
|
+
height,
|
|
2588
|
+
ptr->GetState()
|
|
2589
|
+
);
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
void WebGL2RenderingContext::TexStorage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2593
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2594
|
+
if (ptr == nullptr) {
|
|
2595
|
+
return;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
auto isolate = args.GetIsolate();
|
|
2599
|
+
auto context = isolate->GetCurrentContext();
|
|
2600
|
+
|
|
2601
|
+
auto target = args[0]->Uint32Value(
|
|
2602
|
+
context).ToChecked();
|
|
2603
|
+
auto levels = args[1]->Int32Value(
|
|
2604
|
+
context).ToChecked();
|
|
2605
|
+
auto internalFormat = args[2]->Uint32Value(
|
|
2606
|
+
context).ToChecked();
|
|
2607
|
+
auto width = args[3]->Int32Value(
|
|
2608
|
+
context).ToChecked();
|
|
2609
|
+
auto height = args[4]->Int32Value(
|
|
2610
|
+
context).ToChecked();
|
|
2611
|
+
auto depth = args[5]->Int32Value(
|
|
2612
|
+
context).ToChecked();
|
|
2613
|
+
canvas_native_webgl2_tex_storage3d(
|
|
2614
|
+
target,
|
|
2615
|
+
levels,
|
|
2616
|
+
internalFormat,
|
|
2617
|
+
width,
|
|
2618
|
+
height,
|
|
2619
|
+
depth,
|
|
2620
|
+
ptr->GetState()
|
|
2621
|
+
);
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2625
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2626
|
+
if (ptr == nullptr) {
|
|
2627
|
+
return;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
auto isolate = args.GetIsolate();
|
|
2631
|
+
auto context = isolate->GetCurrentContext();
|
|
2632
|
+
|
|
2633
|
+
auto count = args.Length();
|
|
2634
|
+
if (count == 11) {
|
|
2635
|
+
auto target = args[0]->Uint32Value(
|
|
2636
|
+
context).ToChecked();
|
|
2637
|
+
auto level = args[1]->Int32Value(
|
|
2638
|
+
context).ToChecked();
|
|
2639
|
+
auto xoffset = args[2]->Int32Value(
|
|
2640
|
+
context).ToChecked();
|
|
2641
|
+
auto yoffset = args[3]->Int32Value(
|
|
2642
|
+
context).ToChecked();
|
|
2643
|
+
auto zoffset = args[4]->Int32Value(
|
|
2644
|
+
context).ToChecked();
|
|
2645
|
+
auto width = args[5]->Int32Value(
|
|
2646
|
+
context).ToChecked();
|
|
2647
|
+
auto height = args[6]->Int32Value(
|
|
2648
|
+
context).ToChecked();
|
|
2649
|
+
auto depth = args[7]->Int32Value(
|
|
2650
|
+
context).ToChecked();
|
|
2651
|
+
auto format = args[8]->Uint32Value(
|
|
2652
|
+
context).ToChecked();
|
|
2653
|
+
auto type = args[9]->Uint32Value(
|
|
2654
|
+
context).ToChecked();
|
|
2655
|
+
|
|
2656
|
+
if (args[10]->IsNumber()) {
|
|
2657
|
+
auto imageOrPixelsOrOffset = args[10]->NumberValue(
|
|
2658
|
+
context).ToChecked();
|
|
2659
|
+
canvas_native_webgl2_tex_sub_image3d_none(
|
|
2660
|
+
target,
|
|
2661
|
+
level,
|
|
2662
|
+
xoffset,
|
|
2663
|
+
yoffset,
|
|
2664
|
+
zoffset,
|
|
2665
|
+
width,
|
|
2666
|
+
height,
|
|
2667
|
+
depth,
|
|
2668
|
+
format,
|
|
2669
|
+
type,
|
|
2670
|
+
static_cast<ssize_t>(imageOrPixelsOrOffset),
|
|
2671
|
+
ptr->GetState()
|
|
2672
|
+
);
|
|
2673
|
+
return;
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
auto imageOrPixelsOrOffsetObject = args[10];
|
|
2677
|
+
|
|
2678
|
+
if (imageOrPixelsOrOffsetObject->IsArrayBufferView()) {
|
|
2679
|
+
auto buf = imageOrPixelsOrOffsetObject.As<v8::ArrayBufferView>();
|
|
2680
|
+
|
|
2681
|
+
auto array = buf->Buffer();
|
|
2682
|
+
auto offset = buf->ByteOffset();
|
|
2683
|
+
auto size = buf->ByteLength();
|
|
2684
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2685
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2686
|
+
|
|
2687
|
+
|
|
2688
|
+
canvas_native_webgl2_tex_sub_image3d(
|
|
2689
|
+
target,
|
|
2690
|
+
level,
|
|
2691
|
+
xoffset,
|
|
2692
|
+
yoffset,
|
|
2693
|
+
zoffset,
|
|
2694
|
+
width,
|
|
2695
|
+
height,
|
|
2696
|
+
depth,
|
|
2697
|
+
format,
|
|
2698
|
+
type,
|
|
2699
|
+
data, size,
|
|
2700
|
+
ptr->GetState()
|
|
2701
|
+
);
|
|
2702
|
+
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
|
|
2707
|
+
auto imageType = GetNativeType(imageOrPixelsOrOffsetObject);
|
|
2708
|
+
|
|
2709
|
+
if (imageType == NativeType::ImageAsset) {
|
|
2710
|
+
auto asset = ImageAssetImpl::GetPointer(imageOrPixelsOrOffsetObject.As<v8::Object>());
|
|
2711
|
+
if (asset != nullptr) {
|
|
2712
|
+
|
|
2713
|
+
canvas_native_webgl2_tex_sub_image3d_asset(
|
|
2714
|
+
target,
|
|
2715
|
+
level,
|
|
2716
|
+
xoffset,
|
|
2717
|
+
yoffset,
|
|
2718
|
+
zoffset,
|
|
2719
|
+
width,
|
|
2720
|
+
height,
|
|
2721
|
+
depth,
|
|
2722
|
+
format,
|
|
2723
|
+
type,
|
|
2724
|
+
asset->GetImageAsset(),
|
|
2725
|
+
ptr->GetState()
|
|
2726
|
+
);
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
} else if (count > 11) {
|
|
2731
|
+
auto target = args[0]->Uint32Value(
|
|
2732
|
+
context).ToChecked();
|
|
2733
|
+
auto level = args[1]->Int32Value(
|
|
2734
|
+
context).ToChecked();
|
|
2735
|
+
auto xoffset = args[2]->Int32Value(
|
|
2736
|
+
context).ToChecked();
|
|
2737
|
+
auto yoffset = args[3]->Int32Value(
|
|
2738
|
+
context).ToChecked();
|
|
2739
|
+
auto zoffset = args[4]->Int32Value(
|
|
2740
|
+
context).ToChecked();
|
|
2741
|
+
auto width = args[5]->Int32Value(
|
|
2742
|
+
context).ToChecked();
|
|
2743
|
+
auto height = args[6]->Int32Value(
|
|
2744
|
+
context).ToChecked();
|
|
2745
|
+
auto depth = args[7]->Int32Value(
|
|
2746
|
+
context).ToChecked();
|
|
2747
|
+
auto format = args[8]->Uint32Value(
|
|
2748
|
+
context).ToChecked();
|
|
2749
|
+
auto type = args[9]->Uint32Value(
|
|
2750
|
+
context).ToChecked();
|
|
2751
|
+
|
|
2752
|
+
size_t srcOffsetValue = 0;
|
|
2753
|
+
|
|
2754
|
+
if (args[11]->IsNumber()) {
|
|
2755
|
+
srcOffsetValue = static_cast<size_t>(args[11]->NumberValue(
|
|
2756
|
+
context).ToChecked());
|
|
2757
|
+
}
|
|
2758
|
+
|
|
2759
|
+
auto imageOrPixelsOrOffsetObject = args[10];
|
|
2760
|
+
|
|
2761
|
+
|
|
2762
|
+
if (imageOrPixelsOrOffsetObject->IsArrayBufferView()) {
|
|
2763
|
+
auto buf = imageOrPixelsOrOffsetObject.As<v8::ArrayBufferView>();
|
|
2764
|
+
|
|
2765
|
+
auto array = buf->Buffer();
|
|
2766
|
+
auto offset = buf->ByteOffset();
|
|
2767
|
+
auto size = buf->ByteLength();
|
|
2768
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2769
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
srcOffsetValue =
|
|
2773
|
+
srcOffsetValue * size;
|
|
2774
|
+
if (srcOffsetValue > size) {
|
|
2775
|
+
return;
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
|
|
2779
|
+
canvas_native_webgl2_tex_sub_image3d_offset(
|
|
2780
|
+
target,
|
|
2781
|
+
level,
|
|
2782
|
+
xoffset,
|
|
2783
|
+
yoffset,
|
|
2784
|
+
zoffset,
|
|
2785
|
+
width,
|
|
2786
|
+
height,
|
|
2787
|
+
depth,
|
|
2788
|
+
format,
|
|
2789
|
+
type,
|
|
2790
|
+
data, size,
|
|
2791
|
+
srcOffsetValue,
|
|
2792
|
+
ptr->GetState()
|
|
2793
|
+
);
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
void
|
|
2799
|
+
WebGL2RenderingContext::TransformFeedbackVaryings(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2800
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2801
|
+
if (ptr == nullptr) {
|
|
2802
|
+
return;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
auto isolate = args.GetIsolate();
|
|
2806
|
+
auto context = isolate->GetCurrentContext();
|
|
2807
|
+
|
|
2808
|
+
auto programValue = args[0];
|
|
2809
|
+
auto type = GetNativeType(programValue);
|
|
2810
|
+
if (type == NativeType::WebGLProgram) {
|
|
2811
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
2812
|
+
auto varyingsObject = args[1];
|
|
2813
|
+
auto bufferMode = args[2]->Uint32Value(
|
|
2814
|
+
context).ToChecked();
|
|
2815
|
+
|
|
2816
|
+
if (program != nullptr &&
|
|
2817
|
+
varyingsObject->IsArray()) {
|
|
2818
|
+
auto varyings = varyingsObject.As<v8::Array>();
|
|
2819
|
+
auto len = varyings->Length();
|
|
2820
|
+
|
|
2821
|
+
|
|
2822
|
+
std::vector<std::string> store;
|
|
2823
|
+
store.reserve(len);
|
|
2824
|
+
|
|
2825
|
+
for (int j = 0; j < len; ++j) {
|
|
2826
|
+
auto name = ConvertFromV8String(isolate, varyings->Get(
|
|
2827
|
+
context, j).ToLocalChecked());
|
|
2828
|
+
|
|
2829
|
+
store.push_back(name);
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
|
|
2833
|
+
const char *cStrings[store.size()];
|
|
2834
|
+
for (size_t i = 0; i < store.size(); ++i) {
|
|
2835
|
+
cStrings[i] = store[i].c_str();
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
canvas_native_webgl2_transform_feedback_varyings(
|
|
2839
|
+
program->GetProgram(),
|
|
2840
|
+
cStrings, store.size(),
|
|
2841
|
+
bufferMode,
|
|
2842
|
+
ptr->GetState()
|
|
2843
|
+
);
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
void WebGL2RenderingContext::Uniform1ui(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2850
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2851
|
+
if (ptr == nullptr) {
|
|
2852
|
+
return;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
auto isolate = args.GetIsolate();
|
|
2856
|
+
auto context = isolate->GetCurrentContext();
|
|
2857
|
+
|
|
2858
|
+
auto locationValue = args[0];
|
|
2859
|
+
auto type = GetNativeType(locationValue);
|
|
2860
|
+
|
|
2861
|
+
auto v0Value = args[1];
|
|
2862
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2863
|
+
|
|
2864
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2865
|
+
auto v0 = v0Value->Uint32Value(
|
|
2866
|
+
context).ToChecked();
|
|
2867
|
+
|
|
2868
|
+
if (location != nullptr) {
|
|
2869
|
+
canvas_native_webgl2_uniform1ui(
|
|
2870
|
+
location->GetUniformLocation(),
|
|
2871
|
+
v0,
|
|
2872
|
+
ptr->GetState()
|
|
2873
|
+
);
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
void WebGL2RenderingContext::Uniform2ui(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2880
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2881
|
+
if (ptr == nullptr) {
|
|
2882
|
+
return;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
auto isolate = args.GetIsolate();
|
|
2886
|
+
auto context = isolate->GetCurrentContext();
|
|
2887
|
+
|
|
2888
|
+
auto locationValue = args[0];
|
|
2889
|
+
auto type = GetNativeType(locationValue);
|
|
2890
|
+
|
|
2891
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2892
|
+
|
|
2893
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2894
|
+
auto v0 = args[1]->Uint32Value(
|
|
2895
|
+
context).ToChecked();
|
|
2896
|
+
auto v1 = args[2]->Uint32Value(
|
|
2897
|
+
context).ToChecked();
|
|
2898
|
+
|
|
2899
|
+
if (location != nullptr) {
|
|
2900
|
+
canvas_native_webgl2_uniform2ui(
|
|
2901
|
+
location->GetUniformLocation(),
|
|
2902
|
+
v0,
|
|
2903
|
+
v1,
|
|
2904
|
+
ptr->GetState()
|
|
2905
|
+
);
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
void WebGL2RenderingContext::Uniform3ui(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2912
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2913
|
+
if (ptr == nullptr) {
|
|
2914
|
+
return;
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
auto isolate = args.GetIsolate();
|
|
2918
|
+
auto context = isolate->GetCurrentContext();
|
|
2919
|
+
|
|
2920
|
+
auto locationValue = args[0];
|
|
2921
|
+
auto type = GetNativeType(locationValue);
|
|
2922
|
+
|
|
2923
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2924
|
+
|
|
2925
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2926
|
+
auto v0 = args[1]->Uint32Value(
|
|
2927
|
+
context).ToChecked();
|
|
2928
|
+
|
|
2929
|
+
auto v1 = args[2]->Uint32Value(
|
|
2930
|
+
context).ToChecked();
|
|
2931
|
+
|
|
2932
|
+
auto v2 = args[3]->Uint32Value(
|
|
2933
|
+
context).ToChecked();
|
|
2934
|
+
|
|
2935
|
+
if (location != nullptr) {
|
|
2936
|
+
canvas_native_webgl2_uniform3ui(
|
|
2937
|
+
location->GetUniformLocation(),
|
|
2938
|
+
v0,
|
|
2939
|
+
v1,
|
|
2940
|
+
v2,
|
|
2941
|
+
ptr->GetState()
|
|
2942
|
+
);
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
void WebGL2RenderingContext::Uniform4ui(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2949
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2950
|
+
if (ptr == nullptr) {
|
|
2951
|
+
return;
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
auto isolate = args.GetIsolate();
|
|
2955
|
+
auto context = isolate->GetCurrentContext();
|
|
2956
|
+
|
|
2957
|
+
auto locationValue = args[0];
|
|
2958
|
+
auto type = GetNativeType(locationValue);
|
|
2959
|
+
|
|
2960
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2961
|
+
|
|
2962
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2963
|
+
auto v0 = args[1]->Uint32Value(
|
|
2964
|
+
context).ToChecked();
|
|
2965
|
+
|
|
2966
|
+
auto v1 = args[2]->Uint32Value(
|
|
2967
|
+
context).ToChecked();
|
|
2968
|
+
|
|
2969
|
+
auto v2 = args[3]->Uint32Value(
|
|
2970
|
+
context).ToChecked();
|
|
2971
|
+
auto v3 = args[4]->Uint32Value(
|
|
2972
|
+
context).ToChecked();
|
|
2973
|
+
|
|
2974
|
+
|
|
2975
|
+
if (location != nullptr) {
|
|
2976
|
+
canvas_native_webgl2_uniform4ui(
|
|
2977
|
+
location->GetUniformLocation(),
|
|
2978
|
+
v0,
|
|
2979
|
+
v1,
|
|
2980
|
+
v2,
|
|
2981
|
+
v3,
|
|
2982
|
+
ptr->GetState()
|
|
2983
|
+
);
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
void WebGL2RenderingContext::Uniform1uiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2990
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
2991
|
+
if (ptr == nullptr) {
|
|
2992
|
+
return;
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
auto isolate = args.GetIsolate();
|
|
2996
|
+
auto context = isolate->GetCurrentContext();
|
|
2997
|
+
|
|
2998
|
+
|
|
2999
|
+
auto locationValue = args[0];
|
|
3000
|
+
auto type = GetNativeType(locationValue);
|
|
3001
|
+
|
|
3002
|
+
|
|
3003
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3004
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3005
|
+
auto dataValue = args[1];
|
|
3006
|
+
if (location != nullptr &&
|
|
3007
|
+
dataValue->IsUint32Array()) {
|
|
3008
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
3009
|
+
auto array = buf->Buffer();
|
|
3010
|
+
auto offset = buf->ByteOffset();
|
|
3011
|
+
auto size = buf->Length();
|
|
3012
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3013
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
3014
|
+
|
|
3015
|
+
|
|
3016
|
+
canvas_native_webgl2_uniform1uiv(
|
|
3017
|
+
location->GetUniformLocation(),
|
|
3018
|
+
data, size,
|
|
3019
|
+
ptr->GetState()
|
|
3020
|
+
);
|
|
3021
|
+
} else {
|
|
3022
|
+
std::vector<uint32_t> buf;
|
|
3023
|
+
auto array = dataValue.As<v8::Array>();
|
|
3024
|
+
auto len = array->Length();
|
|
3025
|
+
buf.reserve(len);
|
|
3026
|
+
for (int i = 0; i < len; i++) {
|
|
3027
|
+
auto item = array->Get(
|
|
3028
|
+
context,
|
|
3029
|
+
i).ToLocalChecked()->Uint32Value(
|
|
3030
|
+
context).ToChecked();
|
|
3031
|
+
buf.push_back(item);
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
canvas_native_webgl2_uniform1uiv(
|
|
3035
|
+
location->GetUniformLocation(),
|
|
3036
|
+
buf.data(), buf.size(),
|
|
3037
|
+
ptr->GetState()
|
|
3038
|
+
);
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
void WebGL2RenderingContext::Uniform2uiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3047
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3048
|
+
if (ptr == nullptr) {
|
|
3049
|
+
return;
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
auto isolate = args.GetIsolate();
|
|
3053
|
+
auto context = isolate->GetCurrentContext();
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
auto locationValue = args[0];
|
|
3057
|
+
auto type = GetNativeType(locationValue);
|
|
3058
|
+
|
|
3059
|
+
|
|
3060
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3061
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3062
|
+
auto dataValue = args[1];
|
|
3063
|
+
if (location != nullptr &&
|
|
3064
|
+
dataValue->IsUint32Array()) {
|
|
3065
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
3066
|
+
auto array = buf->Buffer();
|
|
3067
|
+
auto offset = buf->ByteOffset();
|
|
3068
|
+
auto size = buf->Length();
|
|
3069
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3070
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
3071
|
+
|
|
3072
|
+
|
|
3073
|
+
canvas_native_webgl2_uniform2uiv(
|
|
3074
|
+
location->GetUniformLocation(),
|
|
3075
|
+
data, size,
|
|
3076
|
+
ptr->GetState()
|
|
3077
|
+
);
|
|
3078
|
+
} else {
|
|
3079
|
+
std::vector<uint32_t> buf;
|
|
3080
|
+
auto array = dataValue.As<v8::Array>();
|
|
3081
|
+
auto len = array->Length();
|
|
3082
|
+
buf.reserve(len);
|
|
3083
|
+
for (int i = 0; i < len; i++) {
|
|
3084
|
+
auto item = array->Get(
|
|
3085
|
+
context,
|
|
3086
|
+
i).ToLocalChecked()->Uint32Value(
|
|
3087
|
+
context).ToChecked();
|
|
3088
|
+
buf.push_back(item);
|
|
3089
|
+
}
|
|
3090
|
+
canvas_native_webgl2_uniform2uiv(
|
|
3091
|
+
location->GetUniformLocation(),
|
|
3092
|
+
buf.data(), buf.size(),
|
|
3093
|
+
ptr->GetState()
|
|
3094
|
+
);
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
void WebGL2RenderingContext::Uniform3uiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3103
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3104
|
+
if (ptr == nullptr) {
|
|
3105
|
+
return;
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3108
|
+
auto isolate = args.GetIsolate();
|
|
3109
|
+
auto context = isolate->GetCurrentContext();
|
|
3110
|
+
|
|
3111
|
+
|
|
3112
|
+
auto locationValue = args[0];
|
|
3113
|
+
auto type = GetNativeType(locationValue);
|
|
3114
|
+
|
|
3115
|
+
|
|
3116
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3117
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3118
|
+
auto dataValue = args[1];
|
|
3119
|
+
if (location != nullptr &&
|
|
3120
|
+
dataValue->IsUint32Array()) {
|
|
3121
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
3122
|
+
|
|
3123
|
+
auto array = buf->Buffer();
|
|
3124
|
+
auto offset = buf->ByteOffset();
|
|
3125
|
+
auto size = buf->Length();
|
|
3126
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3127
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
3128
|
+
|
|
3129
|
+
|
|
3130
|
+
canvas_native_webgl2_uniform3uiv(
|
|
3131
|
+
location->GetUniformLocation(),
|
|
3132
|
+
data, size,
|
|
3133
|
+
ptr->GetState()
|
|
3134
|
+
);
|
|
3135
|
+
} else {
|
|
3136
|
+
std::vector<uint32_t> buf;
|
|
3137
|
+
auto array = dataValue.As<v8::Array>();
|
|
3138
|
+
auto len = array->Length();
|
|
3139
|
+
buf.reserve(len);
|
|
3140
|
+
for (int i = 0; i < len; i++) {
|
|
3141
|
+
auto item = array->Get(
|
|
3142
|
+
context,
|
|
3143
|
+
i).ToLocalChecked()->Uint32Value(
|
|
3144
|
+
context).ToChecked();
|
|
3145
|
+
buf.push_back(item);
|
|
3146
|
+
}
|
|
3147
|
+
canvas_native_webgl2_uniform3uiv(
|
|
3148
|
+
location->GetUniformLocation(),
|
|
3149
|
+
buf.data(), buf.size(),
|
|
3150
|
+
ptr->GetState()
|
|
3151
|
+
);
|
|
3152
|
+
}
|
|
3153
|
+
|
|
3154
|
+
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3160
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3161
|
+
if (ptr == nullptr) {
|
|
3162
|
+
return;
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
auto isolate = args.GetIsolate();
|
|
3166
|
+
auto context = isolate->GetCurrentContext();
|
|
3167
|
+
|
|
3168
|
+
|
|
3169
|
+
auto locationValue = args[0];
|
|
3170
|
+
auto type = GetNativeType(locationValue);
|
|
3171
|
+
|
|
3172
|
+
|
|
3173
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3174
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3175
|
+
auto dataValue = args[1];
|
|
3176
|
+
if (location != nullptr) {
|
|
3177
|
+
if (dataValue->IsUint32Array()) {
|
|
3178
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
3179
|
+
|
|
3180
|
+
auto array = buf->Buffer();
|
|
3181
|
+
auto offset = buf->ByteOffset();
|
|
3182
|
+
auto size = buf->Length();
|
|
3183
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3184
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
3185
|
+
|
|
3186
|
+
|
|
3187
|
+
canvas_native_webgl2_uniform4uiv(
|
|
3188
|
+
location->GetUniformLocation(),
|
|
3189
|
+
data, size,
|
|
3190
|
+
ptr->GetState()
|
|
3191
|
+
);
|
|
3192
|
+
} else {
|
|
3193
|
+
std::vector<uint32_t> buf;
|
|
3194
|
+
auto array = dataValue.As<v8::Array>();
|
|
3195
|
+
auto len = array->Length();
|
|
3196
|
+
buf.reserve(len);
|
|
3197
|
+
for (int i = 0; i < len; i++) {
|
|
3198
|
+
auto item = array->Get(
|
|
3199
|
+
context,
|
|
3200
|
+
i).ToLocalChecked()->Uint32Value(
|
|
3201
|
+
context).ToChecked();
|
|
3202
|
+
buf.push_back(item);
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3205
|
+
canvas_native_webgl2_uniform4uiv(
|
|
3206
|
+
location->GetUniformLocation(),
|
|
3207
|
+
buf.data(), buf.size(),
|
|
3208
|
+
ptr->GetState()
|
|
3209
|
+
);
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
void WebGL2RenderingContext::UniformBlockBinding(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3217
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3218
|
+
if (ptr == nullptr) {
|
|
3219
|
+
return;
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
auto isolate = args.GetIsolate();
|
|
3223
|
+
auto context = isolate->GetCurrentContext();
|
|
3224
|
+
|
|
3225
|
+
|
|
3226
|
+
auto programValue = args[0];
|
|
3227
|
+
auto type = GetNativeType(programValue);
|
|
3228
|
+
if (type == NativeType::WebGLProgram) {
|
|
3229
|
+
|
|
3230
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
3231
|
+
auto uniformBlockIndex = args[1]->Uint32Value(
|
|
3232
|
+
context).ToChecked();
|
|
3233
|
+
auto uniformBlockBinding = args[2]->Uint32Value(
|
|
3234
|
+
context).ToChecked();
|
|
3235
|
+
|
|
3236
|
+
if (program != nullptr) {
|
|
3237
|
+
canvas_native_webgl2_uniform_block_binding(
|
|
3238
|
+
program->GetProgram(),
|
|
3239
|
+
uniformBlockIndex,
|
|
3240
|
+
uniformBlockBinding,
|
|
3241
|
+
ptr->GetState()
|
|
3242
|
+
);
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
}
|
|
3248
|
+
|
|
3249
|
+
void WebGL2RenderingContext::UniformMatrix2x3fv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3250
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3251
|
+
if (ptr == nullptr) {
|
|
3252
|
+
return;
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
auto isolate = args.GetIsolate();
|
|
3256
|
+
auto context = isolate->GetCurrentContext();
|
|
3257
|
+
|
|
3258
|
+
|
|
3259
|
+
auto locationValue = args[0];
|
|
3260
|
+
auto type = GetNativeType(locationValue);
|
|
3261
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3262
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3263
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3264
|
+
auto dataValue = args[2];
|
|
3265
|
+
|
|
3266
|
+
if (dataValue->IsFloat32Array()) {
|
|
3267
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3268
|
+
auto array = buf->Buffer();
|
|
3269
|
+
auto offset = buf->ByteOffset();
|
|
3270
|
+
auto size = buf->Length();
|
|
3271
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3272
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3273
|
+
|
|
3274
|
+
|
|
3275
|
+
canvas_native_webgl2_uniform_matrix2x3fv(
|
|
3276
|
+
location->GetUniformLocation(),
|
|
3277
|
+
transpose,
|
|
3278
|
+
data, size,
|
|
3279
|
+
ptr->GetState()
|
|
3280
|
+
);
|
|
3281
|
+
} else if (dataValue->IsArray()) {
|
|
3282
|
+
std::vector<float> buf;
|
|
3283
|
+
auto array = dataValue.As<v8::Array>();
|
|
3284
|
+
auto len = array->Length();
|
|
3285
|
+
for (int i = 0; i < len; i++) {
|
|
3286
|
+
auto item = array->Get(
|
|
3287
|
+
context, i).ToLocalChecked();
|
|
3288
|
+
buf.push_back(
|
|
3289
|
+
static_cast<float>(item->NumberValue(
|
|
3290
|
+
context).ToChecked()));
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
|
|
3294
|
+
canvas_native_webgl2_uniform_matrix2x3fv(
|
|
3295
|
+
location->GetUniformLocation(),
|
|
3296
|
+
transpose,
|
|
3297
|
+
buf.data(), buf.size(),
|
|
3298
|
+
ptr->GetState()
|
|
3299
|
+
);
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
void WebGL2RenderingContext::UniformMatrix2x4fv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3306
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3307
|
+
if (ptr == nullptr) {
|
|
3308
|
+
return;
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
auto isolate = args.GetIsolate();
|
|
3312
|
+
auto context = isolate->GetCurrentContext();
|
|
3313
|
+
|
|
3314
|
+
|
|
3315
|
+
auto locationValue = args[0];
|
|
3316
|
+
auto type = GetNativeType(locationValue);
|
|
3317
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3318
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3319
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3320
|
+
auto dataValue = args[2];
|
|
3321
|
+
|
|
3322
|
+
if (dataValue->IsFloat32Array()) {
|
|
3323
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3324
|
+
|
|
3325
|
+
auto array = buf->Buffer();
|
|
3326
|
+
auto offset = buf->ByteOffset();
|
|
3327
|
+
auto size = buf->Length();
|
|
3328
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3329
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3330
|
+
|
|
3331
|
+
|
|
3332
|
+
canvas_native_webgl2_uniform_matrix2x4fv(
|
|
3333
|
+
location->GetUniformLocation(),
|
|
3334
|
+
transpose,
|
|
3335
|
+
data, size,
|
|
3336
|
+
ptr->GetState()
|
|
3337
|
+
);
|
|
3338
|
+
} else if (dataValue->IsArray()) {
|
|
3339
|
+
std::vector<float> buf;
|
|
3340
|
+
auto array = dataValue.As<v8::Array>();
|
|
3341
|
+
auto len = array->Length();
|
|
3342
|
+
for (int i = 0; i < len; i++) {
|
|
3343
|
+
auto item = array->Get(
|
|
3344
|
+
context, i).ToLocalChecked();
|
|
3345
|
+
buf.push_back(
|
|
3346
|
+
static_cast<float>(item->NumberValue(
|
|
3347
|
+
context).ToChecked()));
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
|
|
3351
|
+
canvas_native_webgl2_uniform_matrix2x4fv(
|
|
3352
|
+
location->GetUniformLocation(),
|
|
3353
|
+
transpose,
|
|
3354
|
+
buf.data(), buf.size(),
|
|
3355
|
+
ptr->GetState()
|
|
3356
|
+
);
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
void WebGL2RenderingContext::UniformMatrix3x2fv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3363
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3364
|
+
if (ptr == nullptr) {
|
|
3365
|
+
return;
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
auto isolate = args.GetIsolate();
|
|
3369
|
+
auto context = isolate->GetCurrentContext();
|
|
3370
|
+
|
|
3371
|
+
|
|
3372
|
+
auto locationValue = args[0];
|
|
3373
|
+
auto type = GetNativeType(locationValue);
|
|
3374
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3375
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3376
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3377
|
+
auto dataValue = args[2];
|
|
3378
|
+
|
|
3379
|
+
if (dataValue->IsFloat32Array()) {
|
|
3380
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3381
|
+
|
|
3382
|
+
|
|
3383
|
+
auto array = buf->Buffer();
|
|
3384
|
+
auto offset = buf->ByteOffset();
|
|
3385
|
+
auto size = buf->Length();
|
|
3386
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3387
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3388
|
+
|
|
3389
|
+
|
|
3390
|
+
canvas_native_webgl2_uniform_matrix3x2fv(
|
|
3391
|
+
location->GetUniformLocation(),
|
|
3392
|
+
transpose,
|
|
3393
|
+
data, size,
|
|
3394
|
+
ptr->GetState()
|
|
3395
|
+
);
|
|
3396
|
+
} else if (dataValue->IsArray()) {
|
|
3397
|
+
std::vector<float> buf;
|
|
3398
|
+
auto array = dataValue.As<v8::Array>();
|
|
3399
|
+
auto len = array->Length();
|
|
3400
|
+
for (int i = 0; i < len; i++) {
|
|
3401
|
+
auto item = array->Get(
|
|
3402
|
+
context, i).ToLocalChecked();
|
|
3403
|
+
buf.push_back(
|
|
3404
|
+
static_cast<float>(item->NumberValue(
|
|
3405
|
+
context).ToChecked()));
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
|
|
3409
|
+
canvas_native_webgl2_uniform_matrix3x2fv(
|
|
3410
|
+
location->GetUniformLocation(),
|
|
3411
|
+
transpose,
|
|
3412
|
+
buf.data(), buf.size(),
|
|
3413
|
+
ptr->GetState()
|
|
3414
|
+
);
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
void WebGL2RenderingContext::UniformMatrix3x4fv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3421
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3422
|
+
if (ptr == nullptr) {
|
|
3423
|
+
return;
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
auto isolate = args.GetIsolate();
|
|
3427
|
+
auto context = isolate->GetCurrentContext();
|
|
3428
|
+
|
|
3429
|
+
|
|
3430
|
+
auto locationValue = args[0];
|
|
3431
|
+
auto type = GetNativeType(locationValue);
|
|
3432
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3433
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3434
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3435
|
+
auto dataValue = args[2];
|
|
3436
|
+
|
|
3437
|
+
if (dataValue->IsFloat32Array()) {
|
|
3438
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3439
|
+
auto array = buf->Buffer();
|
|
3440
|
+
auto offset = buf->ByteOffset();
|
|
3441
|
+
auto size = buf->Length();
|
|
3442
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3443
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3444
|
+
|
|
3445
|
+
|
|
3446
|
+
canvas_native_webgl2_uniform_matrix3x4fv(
|
|
3447
|
+
location->GetUniformLocation(),
|
|
3448
|
+
transpose,
|
|
3449
|
+
data, size,
|
|
3450
|
+
ptr->GetState()
|
|
3451
|
+
);
|
|
3452
|
+
} else if (dataValue->IsArray()) {
|
|
3453
|
+
std::vector<float> buf;
|
|
3454
|
+
auto array = dataValue.As<v8::Array>();
|
|
3455
|
+
auto len = array->Length();
|
|
3456
|
+
for (int i = 0; i < len; i++) {
|
|
3457
|
+
auto item = array->Get(
|
|
3458
|
+
context, i).ToLocalChecked();
|
|
3459
|
+
buf.push_back(
|
|
3460
|
+
static_cast<float>(item->NumberValue(
|
|
3461
|
+
context).ToChecked()));
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
|
|
3465
|
+
canvas_native_webgl2_uniform_matrix3x4fv(
|
|
3466
|
+
location->GetUniformLocation(),
|
|
3467
|
+
transpose,
|
|
3468
|
+
buf.data(), buf.size(),
|
|
3469
|
+
ptr->GetState()
|
|
3470
|
+
);
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3476
|
+
void WebGL2RenderingContext::UniformMatrix4x2fv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3477
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3478
|
+
if (ptr == nullptr) {
|
|
3479
|
+
return;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
auto isolate = args.GetIsolate();
|
|
3483
|
+
auto context = isolate->GetCurrentContext();
|
|
3484
|
+
|
|
3485
|
+
|
|
3486
|
+
auto locationValue = args[0];
|
|
3487
|
+
auto type = GetNativeType(locationValue);
|
|
3488
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3489
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3490
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3491
|
+
auto dataValue = args[2];
|
|
3492
|
+
|
|
3493
|
+
if (dataValue->IsFloat32Array()) {
|
|
3494
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3495
|
+
|
|
3496
|
+
auto array = buf->Buffer();
|
|
3497
|
+
auto offset = buf->ByteOffset();
|
|
3498
|
+
auto size = buf->Length();
|
|
3499
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3500
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3501
|
+
|
|
3502
|
+
canvas_native_webgl2_uniform_matrix4x2fv(
|
|
3503
|
+
location->GetUniformLocation(),
|
|
3504
|
+
transpose,
|
|
3505
|
+
data, size,
|
|
3506
|
+
ptr->GetState()
|
|
3507
|
+
);
|
|
3508
|
+
} else if (dataValue->IsArray()) {
|
|
3509
|
+
std::vector<float> buf;
|
|
3510
|
+
auto array = dataValue.As<v8::Array>();
|
|
3511
|
+
auto len = array->Length();
|
|
3512
|
+
for (int i = 0; i < len; i++) {
|
|
3513
|
+
auto item = array->Get(
|
|
3514
|
+
context, i).ToLocalChecked();
|
|
3515
|
+
buf.push_back(
|
|
3516
|
+
static_cast<float>(item->NumberValue(
|
|
3517
|
+
context).ToChecked()));
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3520
|
+
|
|
3521
|
+
canvas_native_webgl2_uniform_matrix4x2fv(
|
|
3522
|
+
location->GetUniformLocation(),
|
|
3523
|
+
transpose,
|
|
3524
|
+
buf.data(), buf.size(),
|
|
3525
|
+
ptr->GetState()
|
|
3526
|
+
);
|
|
3527
|
+
}
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
void WebGL2RenderingContext::UniformMatrix4x3fv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3533
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3534
|
+
if (ptr == nullptr) {
|
|
3535
|
+
return;
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
auto isolate = args.GetIsolate();
|
|
3539
|
+
auto context = isolate->GetCurrentContext();
|
|
3540
|
+
|
|
3541
|
+
|
|
3542
|
+
auto locationValue = args[0];
|
|
3543
|
+
auto type = GetNativeType(locationValue);
|
|
3544
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3545
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3546
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3547
|
+
auto dataValue = args[2];
|
|
3548
|
+
|
|
3549
|
+
if (dataValue->IsFloat32Array()) {
|
|
3550
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3551
|
+
auto array = buf->Buffer();
|
|
3552
|
+
auto offset = buf->ByteOffset();
|
|
3553
|
+
auto size = buf->Length();
|
|
3554
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3555
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3556
|
+
|
|
3557
|
+
canvas_native_webgl2_uniform_matrix4x3fv(
|
|
3558
|
+
location->GetUniformLocation(),
|
|
3559
|
+
transpose,
|
|
3560
|
+
data, size,
|
|
3561
|
+
ptr->GetState()
|
|
3562
|
+
);
|
|
3563
|
+
} else if (dataValue->IsArray()) {
|
|
3564
|
+
std::vector<float> buf;
|
|
3565
|
+
auto array = dataValue.As<v8::Array>();
|
|
3566
|
+
auto len = array->Length();
|
|
3567
|
+
for (int i = 0; i < len; i++) {
|
|
3568
|
+
auto item = array->Get(
|
|
3569
|
+
context, i).ToLocalChecked();
|
|
3570
|
+
buf.push_back(
|
|
3571
|
+
static_cast<float>(item->NumberValue(
|
|
3572
|
+
context).ToChecked()));
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
|
|
3576
|
+
canvas_native_webgl2_uniform_matrix4x3fv(
|
|
3577
|
+
location->GetUniformLocation(),
|
|
3578
|
+
transpose,
|
|
3579
|
+
buf.data(), buf.size(),
|
|
3580
|
+
ptr->GetState()
|
|
3581
|
+
);
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
void WebGL2RenderingContext::VertexAttribDivisor(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3588
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3589
|
+
if (ptr == nullptr) {
|
|
3590
|
+
return;
|
|
3591
|
+
}
|
|
3592
|
+
|
|
3593
|
+
auto isolate = args.GetIsolate();
|
|
3594
|
+
auto context = isolate->GetCurrentContext();
|
|
3595
|
+
|
|
3596
|
+
|
|
3597
|
+
auto index = args[0]->Uint32Value(
|
|
3598
|
+
context).ToChecked();
|
|
3599
|
+
auto divisor = args[1]->Uint32Value(
|
|
3600
|
+
context).ToChecked();
|
|
3601
|
+
canvas_native_webgl2_vertex_attrib_divisor(
|
|
3602
|
+
index,
|
|
3603
|
+
divisor,
|
|
3604
|
+
ptr->GetState()
|
|
3605
|
+
);
|
|
3606
|
+
|
|
3607
|
+
}
|
|
3608
|
+
|
|
3609
|
+
void WebGL2RenderingContext::VertexAttribI4i(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3610
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3611
|
+
if (ptr == nullptr) {
|
|
3612
|
+
return;
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3615
|
+
auto isolate = args.GetIsolate();
|
|
3616
|
+
auto context = isolate->GetCurrentContext();
|
|
3617
|
+
|
|
3618
|
+
|
|
3619
|
+
auto index = args[0]->Int32Value(
|
|
3620
|
+
context).ToChecked();
|
|
3621
|
+
auto v0 = args[1]->Int32Value(
|
|
3622
|
+
context).ToChecked();
|
|
3623
|
+
auto v1 = args[2]->Int32Value(
|
|
3624
|
+
context).ToChecked();
|
|
3625
|
+
auto v2 = args[3]->Int32Value(
|
|
3626
|
+
context).ToChecked();
|
|
3627
|
+
auto v3 = args[4]->Int32Value(
|
|
3628
|
+
context).ToChecked();
|
|
3629
|
+
canvas_native_webgl2_vertex_attrib_i4i(
|
|
3630
|
+
index,
|
|
3631
|
+
v0,
|
|
3632
|
+
v1,
|
|
3633
|
+
v2,
|
|
3634
|
+
v3,
|
|
3635
|
+
ptr->GetState()
|
|
3636
|
+
);
|
|
3637
|
+
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3641
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3642
|
+
if (ptr == nullptr) {
|
|
3643
|
+
return;
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
auto isolate = args.GetIsolate();
|
|
3647
|
+
auto context = isolate->GetCurrentContext();
|
|
3648
|
+
|
|
3649
|
+
|
|
3650
|
+
auto index = args[0]->Uint32Value(
|
|
3651
|
+
context).ToChecked();
|
|
3652
|
+
auto value = args[1];
|
|
3653
|
+
if (value->IsInt32Array()) {
|
|
3654
|
+
auto buf = value.As<v8::Int32Array>();
|
|
3655
|
+
|
|
3656
|
+
auto array = buf->Buffer();
|
|
3657
|
+
auto offset = buf->ByteOffset();
|
|
3658
|
+
auto size = buf->Length();
|
|
3659
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3660
|
+
auto data = static_cast<int32_t *>((void *) data_ptr);
|
|
3661
|
+
|
|
3662
|
+
|
|
3663
|
+
canvas_native_webgl2_vertex_attrib_i4iv(
|
|
3664
|
+
index,
|
|
3665
|
+
data, size,
|
|
3666
|
+
ptr->GetState()
|
|
3667
|
+
);
|
|
3668
|
+
} else if (value->IsArray()) {
|
|
3669
|
+
auto array = value.As<v8::Array>();
|
|
3670
|
+
auto len = array->Length();
|
|
3671
|
+
std::vector<int32_t> buf;
|
|
3672
|
+
buf.reserve(len);
|
|
3673
|
+
for (int i = 0; i < len; i++) {
|
|
3674
|
+
auto item = array->Get(
|
|
3675
|
+
context,
|
|
3676
|
+
i).ToLocalChecked()->Int32Value(
|
|
3677
|
+
context).ToChecked();
|
|
3678
|
+
buf.push_back(item);
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
|
|
3682
|
+
canvas_native_webgl2_vertex_attrib_i4iv(
|
|
3683
|
+
index,
|
|
3684
|
+
buf.data(), buf.size(),
|
|
3685
|
+
ptr->GetState()
|
|
3686
|
+
);
|
|
3687
|
+
}
|
|
3688
|
+
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
void WebGL2RenderingContext::VertexAttribI4ui(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3692
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3693
|
+
if (ptr == nullptr) {
|
|
3694
|
+
return;
|
|
3695
|
+
}
|
|
3696
|
+
|
|
3697
|
+
auto isolate = args.GetIsolate();
|
|
3698
|
+
auto context = isolate->GetCurrentContext();
|
|
3699
|
+
|
|
3700
|
+
|
|
3701
|
+
auto index = args[0]->Uint32Value(
|
|
3702
|
+
context).ToChecked();
|
|
3703
|
+
auto v0 = args[1]->Uint32Value(
|
|
3704
|
+
context).ToChecked();
|
|
3705
|
+
auto v1 = args[2]->Uint32Value(
|
|
3706
|
+
context).ToChecked();
|
|
3707
|
+
auto v2 = args[3]->Uint32Value(
|
|
3708
|
+
context).ToChecked();
|
|
3709
|
+
auto v3 = args[4]->Uint32Value(
|
|
3710
|
+
context).ToChecked();
|
|
3711
|
+
|
|
3712
|
+
canvas_native_webgl2_vertex_attrib_i4ui(
|
|
3713
|
+
index,
|
|
3714
|
+
v0,
|
|
3715
|
+
v1,
|
|
3716
|
+
v2,
|
|
3717
|
+
v3,
|
|
3718
|
+
ptr->GetState()
|
|
3719
|
+
);
|
|
3720
|
+
|
|
3721
|
+
}
|
|
3722
|
+
|
|
3723
|
+
void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3724
|
+
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
3725
|
+
if (ptr == nullptr) {
|
|
3726
|
+
return;
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3729
|
+
auto isolate = args.GetIsolate();
|
|
3730
|
+
auto context = isolate->GetCurrentContext();
|
|
3731
|
+
|
|
3732
|
+
auto index = args[0]->Uint32Value(
|
|
3733
|
+
context).ToChecked();
|
|
3734
|
+
auto value = args[1];
|
|
3735
|
+
if (value->IsUint32Array()) {
|
|
3736
|
+
auto buf = value.As<v8::Uint32Array>();
|
|
3737
|
+
auto array = buf->Buffer();
|
|
3738
|
+
auto offset = buf->ByteOffset();
|
|
3739
|
+
auto size = buf->Length();
|
|
3740
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3741
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
3742
|
+
|
|
3743
|
+
|
|
3744
|
+
canvas_native_webgl2_vertex_attrib_i4uiv(
|
|
3745
|
+
index,
|
|
3746
|
+
data, size,
|
|
3747
|
+
ptr->GetState()
|
|
3748
|
+
);
|
|
3749
|
+
} else if (value->IsArray()) {
|
|
3750
|
+
auto array = value.As<v8::Array>();
|
|
3751
|
+
auto len = array->Length();
|
|
3752
|
+
std::vector<uint32_t> buf;
|
|
3753
|
+
buf.reserve(len);
|
|
3754
|
+
for (int i = 0; i < len; i++) {
|
|
3755
|
+
auto item = array->Get(
|
|
3756
|
+
context,
|
|
3757
|
+
i).ToLocalChecked()->Uint32Value(
|
|
3758
|
+
context).ToChecked();
|
|
3759
|
+
buf.push_back(item);
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
|
|
3763
|
+
canvas_native_webgl2_vertex_attrib_i4uiv(
|
|
3764
|
+
index,
|
|
3765
|
+
buf.data(), buf.size(),
|
|
3766
|
+
ptr->GetState()
|
|
3767
|
+
);
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
void WebGL2RenderingContext::SetConstants(v8::Isolate *isolate,
|
|
3773
|
+
const v8::Local<v8::ObjectTemplate> &tmpl) {
|
|
3774
|
+
/* Getting GL parameter information */
|
|
3775
|
+
|
|
3776
|
+
tmpl->Set(isolate, "READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x0C02));
|
|
3777
|
+
|
|
3778
|
+
tmpl->Set(isolate, "UNPACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0CF2));
|
|
3779
|
+
|
|
3780
|
+
tmpl->Set(isolate, "UNPACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0CF3));
|
|
3781
|
+
|
|
3782
|
+
tmpl->Set(isolate, "UNPACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0CF4));
|
|
3783
|
+
|
|
3784
|
+
tmpl->Set(isolate, "PACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0D02));
|
|
3785
|
+
|
|
3786
|
+
tmpl->Set(isolate, "PACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0D03));
|
|
3787
|
+
|
|
3788
|
+
tmpl->Set(isolate, "PACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0D04));
|
|
3789
|
+
|
|
3790
|
+
tmpl->Set(isolate, "TEXTURE_BINDING_3D", v8::Integer::NewFromUnsigned(isolate, 0x806A));
|
|
3791
|
+
|
|
3792
|
+
tmpl->Set(isolate, "UNPACK_SKIP_IMAGES", v8::Integer::NewFromUnsigned(isolate, 0x806D));
|
|
3793
|
+
|
|
3794
|
+
tmpl->Set(isolate, "UNPACK_IMAGE_HEIGHT", v8::Integer::NewFromUnsigned(isolate, 0x806E));
|
|
3795
|
+
|
|
3796
|
+
tmpl->Set(isolate, "MAX_3D_TEXTURE_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8073));
|
|
3797
|
+
|
|
3798
|
+
tmpl->Set(isolate, "MAX_ELEMENTS_VERTICES", v8::Integer::NewFromUnsigned(isolate, 0x80E8));
|
|
3799
|
+
|
|
3800
|
+
tmpl->Set(isolate, "MAX_ELEMENTS_INDICES", v8::Integer::NewFromUnsigned(isolate, 0x80E9));
|
|
3801
|
+
|
|
3802
|
+
tmpl->Set(isolate, "MAX_TEXTURE_LOD_BIAS", v8::Integer::NewFromUnsigned(isolate, 0x84FD));
|
|
3803
|
+
|
|
3804
|
+
tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_COMPONENTS",
|
|
3805
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8B49));
|
|
3806
|
+
|
|
3807
|
+
tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_COMPONENTS",
|
|
3808
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8B4A));
|
|
3809
|
+
|
|
3810
|
+
tmpl->Set(isolate, "MAX_ARRAY_TEXTURE_LAYERS", v8::Integer::NewFromUnsigned(isolate, 0x88FF));
|
|
3811
|
+
|
|
3812
|
+
tmpl->Set(isolate, "MIN_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8904));
|
|
3813
|
+
|
|
3814
|
+
tmpl->Set(isolate, "MAX_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8905));
|
|
3815
|
+
|
|
3816
|
+
tmpl->Set(isolate, "MAX_VARYING_COMPONENTS", v8::Integer::NewFromUnsigned(isolate, 0x8B4B));
|
|
3817
|
+
|
|
3818
|
+
tmpl->Set(isolate, "FRAGMENT_SHADER_DERIVATIVE_HINT",
|
|
3819
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8B8B));
|
|
3820
|
+
|
|
3821
|
+
tmpl->Set(isolate, "RASTERIZER_DISCARD", v8::Integer::NewFromUnsigned(isolate, 0x8C89));
|
|
3822
|
+
|
|
3823
|
+
tmpl->Set(isolate, "VERTEX_ARRAY_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x85B5));
|
|
3824
|
+
tmpl->Set(isolate, "MAX_VERTEX_OUTPUT_COMPONENTS",
|
|
3825
|
+
v8::Integer::NewFromUnsigned(isolate, 0x9122));
|
|
3826
|
+
tmpl->Set(isolate, "MAX_FRAGMENT_INPUT_COMPONENTS",
|
|
3827
|
+
v8::Integer::NewFromUnsigned(isolate, 0x9125));
|
|
3828
|
+
tmpl->Set(isolate, "MAX_SERVER_WAIT_TIMEOUT", v8::Integer::NewFromUnsigned(isolate, 0x9111));
|
|
3829
|
+
tmpl->Set(isolate, "MAX_ELEMENT_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8D6B));
|
|
3830
|
+
|
|
3831
|
+
tmpl->Set(isolate, "RED", v8::Integer::NewFromUnsigned(isolate, 0x1903));
|
|
3832
|
+
tmpl->Set(isolate, "RGB8", v8::Integer::NewFromUnsigned(isolate, 0x8051));
|
|
3833
|
+
tmpl->Set(isolate, "RGBA8", v8::Integer::NewFromUnsigned(isolate, 0x8058));
|
|
3834
|
+
tmpl->Set(isolate, "RGB10_A2", v8::Integer::NewFromUnsigned(isolate, 0x8059));
|
|
3835
|
+
tmpl->Set(isolate, "TEXTURE_3D", v8::Integer::NewFromUnsigned(isolate, 0x806F));
|
|
3836
|
+
|
|
3837
|
+
tmpl->Set(isolate, "TEXTURE_WRAP_R", v8::Integer::NewFromUnsigned(isolate, 0x8072));
|
|
3838
|
+
tmpl->Set(isolate, "TEXTURE_MIN_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813A));
|
|
3839
|
+
tmpl->Set(isolate, "TEXTURE_MAX_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813B));
|
|
3840
|
+
tmpl->Set(isolate, "TEXTURE_BASE_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813C));
|
|
3841
|
+
tmpl->Set(isolate, "TEXTURE_MAX_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813D));
|
|
3842
|
+
|
|
3843
|
+
|
|
3844
|
+
tmpl->Set(isolate, "TEXTURE_COMPARE_MODE", v8::Integer::NewFromUnsigned(isolate, 0x884C));
|
|
3845
|
+
tmpl->Set(isolate, "TEXTURE_COMPARE_FUNC", v8::Integer::NewFromUnsigned(isolate, 0x884D));
|
|
3846
|
+
tmpl->Set(isolate, "SRGB", v8::Integer::NewFromUnsigned(isolate, 0x8C40));
|
|
3847
|
+
tmpl->Set(isolate, "SRGB8", v8::Integer::NewFromUnsigned(isolate, 0x8C41));
|
|
3848
|
+
tmpl->Set(isolate, "SRGB8_ALPHA8", v8::Integer::NewFromUnsigned(isolate, 0x8C43));
|
|
3849
|
+
|
|
3850
|
+
tmpl->Set(isolate, "COMPARE_REF_TO_TEXTURE", v8::Integer::NewFromUnsigned(isolate, 0x884E));
|
|
3851
|
+
tmpl->Set(isolate, "RGBA32F", v8::Integer::NewFromUnsigned(isolate, 0x8814));
|
|
3852
|
+
tmpl->Set(isolate, "RGB32F", v8::Integer::NewFromUnsigned(isolate, 0x8815));
|
|
3853
|
+
tmpl->Set(isolate, "RGBA16F", v8::Integer::NewFromUnsigned(isolate, 0x881A));
|
|
3854
|
+
tmpl->Set(isolate, "RGB16F", v8::Integer::NewFromUnsigned(isolate, 0x881B));
|
|
3855
|
+
|
|
3856
|
+
tmpl->Set(isolate, "TEXTURE_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1A));
|
|
3857
|
+
tmpl->Set(isolate, "TEXTURE_BINDING_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1D));
|
|
3858
|
+
tmpl->Set(isolate, "R11F_G11F_B10F", v8::Integer::NewFromUnsigned(isolate, 0x8C3A));
|
|
3859
|
+
tmpl->Set(isolate, "RGB9_E5", v8::Integer::NewFromUnsigned(isolate, 0x8C3D));
|
|
3860
|
+
tmpl->Set(isolate, "RGBA32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D70));
|
|
3861
|
+
|
|
3862
|
+
|
|
3863
|
+
tmpl->Set(isolate, "RGB32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D71));
|
|
3864
|
+
tmpl->Set(isolate, "RGBA16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D76));
|
|
3865
|
+
tmpl->Set(isolate, "RGB16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D77));
|
|
3866
|
+
tmpl->Set(isolate, "RGBA8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7C));
|
|
3867
|
+
tmpl->Set(isolate, "RGB8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7D));
|
|
3868
|
+
|
|
3869
|
+
|
|
3870
|
+
tmpl->Set(isolate, "RGBA32I", v8::Integer::NewFromUnsigned(isolate, 0x8D82));
|
|
3871
|
+
tmpl->Set(isolate, "RGB32I", v8::Integer::NewFromUnsigned(isolate, 0x8D83));
|
|
3872
|
+
tmpl->Set(isolate, "RGBA16I", v8::Integer::NewFromUnsigned(isolate, 0x8D88));
|
|
3873
|
+
tmpl->Set(isolate, "RGB16I", v8::Integer::NewFromUnsigned(isolate, 0x8D89));
|
|
3874
|
+
tmpl->Set(isolate, "RGBA8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8E));
|
|
3875
|
+
|
|
3876
|
+
|
|
3877
|
+
tmpl->Set(isolate, "RGB8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8F));
|
|
3878
|
+
tmpl->Set(isolate, "RED_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D94));
|
|
3879
|
+
tmpl->Set(isolate, "RGB_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D98));
|
|
3880
|
+
tmpl->Set(isolate, "RGBA_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D99));
|
|
3881
|
+
tmpl->Set(isolate, "R8", v8::Integer::NewFromUnsigned(isolate, 0x8229));
|
|
3882
|
+
|
|
3883
|
+
|
|
3884
|
+
tmpl->Set(isolate, "RG8", v8::Integer::NewFromUnsigned(isolate, 0x822B));
|
|
3885
|
+
tmpl->Set(isolate, "R16F", v8::Integer::NewFromUnsigned(isolate, 0x822D));
|
|
3886
|
+
tmpl->Set(isolate, "R32F", v8::Integer::NewFromUnsigned(isolate, 0x822E));
|
|
3887
|
+
tmpl->Set(isolate, "RG16F", v8::Integer::NewFromUnsigned(isolate, 0x822F));
|
|
3888
|
+
tmpl->Set(isolate, "RG32F", v8::Integer::NewFromUnsigned(isolate, 0x8230));
|
|
3889
|
+
|
|
3890
|
+
|
|
3891
|
+
tmpl->Set(isolate, "R8I", v8::Integer::NewFromUnsigned(isolate, 0x8231));
|
|
3892
|
+
tmpl->Set(isolate, "R8UI", v8::Integer::NewFromUnsigned(isolate, 0x8232));
|
|
3893
|
+
tmpl->Set(isolate, "R16I", v8::Integer::NewFromUnsigned(isolate, 0x8233));
|
|
3894
|
+
tmpl->Set(isolate, "R16UI", v8::Integer::NewFromUnsigned(isolate, 0x8234));
|
|
3895
|
+
tmpl->Set(isolate, "R32I", v8::Integer::NewFromUnsigned(isolate, 0x8235));
|
|
3896
|
+
|
|
3897
|
+
|
|
3898
|
+
tmpl->Set(isolate, "R32UI", v8::Integer::NewFromUnsigned(isolate, 0x8236));
|
|
3899
|
+
tmpl->Set(isolate, "RG8I", v8::Integer::NewFromUnsigned(isolate, 0x8237));
|
|
3900
|
+
tmpl->Set(isolate, "RG8UI", v8::Integer::NewFromUnsigned(isolate, 0x8238));
|
|
3901
|
+
tmpl->Set(isolate, "RG16I", v8::Integer::NewFromUnsigned(isolate, 0x8239));
|
|
3902
|
+
tmpl->Set(isolate, "RG16UI", v8::Integer::NewFromUnsigned(isolate, 0x823A));
|
|
3903
|
+
|
|
3904
|
+
tmpl->Set(isolate, "RG32I", v8::Integer::NewFromUnsigned(isolate, 0x823B));
|
|
3905
|
+
tmpl->Set(isolate, "RG32UI", v8::Integer::NewFromUnsigned(isolate, 0x823C));
|
|
3906
|
+
tmpl->Set(isolate, "R8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F94));
|
|
3907
|
+
tmpl->Set(isolate, "RG8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F95));
|
|
3908
|
+
tmpl->Set(isolate, "RGB8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F96));
|
|
3909
|
+
|
|
3910
|
+
|
|
3911
|
+
tmpl->Set(isolate, "RGBA8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F97));
|
|
3912
|
+
tmpl->Set(isolate, "RGB10_A2UI", v8::Integer::NewFromUnsigned(isolate, 0x906F));
|
|
3913
|
+
tmpl->Set(isolate, "TEXTURE_IMMUTABLE_FORMAT", v8::Integer::NewFromUnsigned(isolate, 0x912F));
|
|
3914
|
+
tmpl->Set(isolate, "TEXTURE_IMMUTABLE_LEVELS", v8::Integer::NewFromUnsigned(isolate, 0x82DF));
|
|
3915
|
+
tmpl->Set(isolate, "UNSIGNED_INT_2_10_10_10_REV",
|
|
3916
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8368));
|
|
3917
|
+
|
|
3918
|
+
|
|
3919
|
+
tmpl->Set(isolate, "UNSIGNED_INT_10F_11F_11F_REV",
|
|
3920
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C3B));
|
|
3921
|
+
tmpl->Set(isolate, "UNSIGNED_INT_5_9_9_9_REV", v8::Integer::NewFromUnsigned(isolate, 0x8C3E));
|
|
3922
|
+
tmpl->Set(isolate, "FLOAT_32_UNSIGNED_INT_24_8_REV",
|
|
3923
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8DAD));
|
|
3924
|
+
tmpl->Set(isolate, "UNSIGNED_INT_24_8", v8::Integer::NewFromUnsigned(isolate, 0x84FA));
|
|
3925
|
+
tmpl->Set(isolate, "HALF_FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x140B));
|
|
3926
|
+
|
|
3927
|
+
|
|
3928
|
+
tmpl->Set(isolate, "RG", v8::Integer::NewFromUnsigned(isolate, 0x8227));
|
|
3929
|
+
tmpl->Set(isolate, "RG_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8228));
|
|
3930
|
+
tmpl->Set(isolate, "INT_2_10_10_10_REV", v8::Integer::NewFromUnsigned(isolate, 0x8D9F));
|
|
3931
|
+
tmpl->Set(isolate, "QUERY_RESULT_AVAILABLE", v8::Integer::NewFromUnsigned(isolate, 0x8865));
|
|
3932
|
+
tmpl->Set(isolate, "QUERY_RESULT", v8::Integer::NewFromUnsigned(isolate, 0x8866));
|
|
3933
|
+
|
|
3934
|
+
|
|
3935
|
+
tmpl->Set(isolate, "CURRENT_QUERY", v8::Integer::NewFromUnsigned(isolate, 0x8867));
|
|
3936
|
+
tmpl->Set(isolate, "ANY_SAMPLES_PASSED", v8::Integer::NewFromUnsigned(isolate, 0x8C2F));
|
|
3937
|
+
tmpl->Set(isolate, "ANY_SAMPLES_PASSED_CONSERVATIVE",
|
|
3938
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8D6A));
|
|
3939
|
+
tmpl->Set(isolate, "MAX_DRAW_BUFFERS", v8::Integer::NewFromUnsigned(isolate, 0x8824));
|
|
3940
|
+
|
|
3941
|
+
tmpl->Set(isolate, "DRAW_BUFFER0", v8::Integer::NewFromUnsigned(isolate, 0x8825));
|
|
3942
|
+
tmpl->Set(isolate, "DRAW_BUFFER1", v8::Integer::NewFromUnsigned(isolate, 0x8826));
|
|
3943
|
+
tmpl->Set(isolate, "DRAW_BUFFER2", v8::Integer::NewFromUnsigned(isolate, 0x8827));
|
|
3944
|
+
tmpl->Set(isolate, "DRAW_BUFFER3", v8::Integer::NewFromUnsigned(isolate, 0x8828));
|
|
3945
|
+
tmpl->Set(isolate, "DRAW_BUFFER4", v8::Integer::NewFromUnsigned(isolate, 0x8829));
|
|
3946
|
+
tmpl->Set(isolate, "DRAW_BUFFER5", v8::Integer::NewFromUnsigned(isolate, 0x882A));
|
|
3947
|
+
tmpl->Set(isolate, "DRAW_BUFFER6", v8::Integer::NewFromUnsigned(isolate, 0x882B));
|
|
3948
|
+
tmpl->Set(isolate, "DRAW_BUFFER7", v8::Integer::NewFromUnsigned(isolate, 0x882C));
|
|
3949
|
+
tmpl->Set(isolate, "DRAW_BUFFER8", v8::Integer::NewFromUnsigned(isolate, 0x882D));
|
|
3950
|
+
tmpl->Set(isolate, "DRAW_BUFFER9", v8::Integer::NewFromUnsigned(isolate, 0x882E));
|
|
3951
|
+
tmpl->Set(isolate, "DRAW_BUFFER10", v8::Integer::NewFromUnsigned(isolate, 0x882F));
|
|
3952
|
+
|
|
3953
|
+
/* Getting GL parameter information */
|
|
3954
|
+
|
|
3955
|
+
/* Textures */
|
|
3956
|
+
|
|
3957
|
+
tmpl->Set(isolate, "DRAW_BUFFER11", v8::Integer::NewFromUnsigned(isolate, 0x8830));
|
|
3958
|
+
tmpl->Set(isolate, "DRAW_BUFFER12", v8::Integer::NewFromUnsigned(isolate, 0x8831));
|
|
3959
|
+
tmpl->Set(isolate, "DRAW_BUFFER13", v8::Integer::NewFromUnsigned(isolate, 0x8832));
|
|
3960
|
+
tmpl->Set(isolate, "DRAW_BUFFER14", v8::Integer::NewFromUnsigned(isolate, 0x8833));
|
|
3961
|
+
tmpl->Set(isolate, "DRAW_BUFFER15", v8::Integer::NewFromUnsigned(isolate, 0x8834));
|
|
3962
|
+
|
|
3963
|
+
tmpl->Set(isolate, "MAX_COLOR_ATTACHMENTS", v8::Integer::NewFromUnsigned(isolate, 0x8CDF));
|
|
3964
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT1", v8::Integer::NewFromUnsigned(isolate, 0x8CE1));
|
|
3965
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT2", v8::Integer::NewFromUnsigned(isolate, 0x8CE2));
|
|
3966
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT3", v8::Integer::NewFromUnsigned(isolate, 0x8CE3));
|
|
3967
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT4", v8::Integer::NewFromUnsigned(isolate, 0x8CE4));
|
|
3968
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT5", v8::Integer::NewFromUnsigned(isolate, 0x8CE5));
|
|
3969
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT6", v8::Integer::NewFromUnsigned(isolate, 0x8CE6));
|
|
3970
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT7", v8::Integer::NewFromUnsigned(isolate, 0x8CE7));
|
|
3971
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT8", v8::Integer::NewFromUnsigned(isolate, 0x8CE8));
|
|
3972
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT9", v8::Integer::NewFromUnsigned(isolate, 0x8CE9));
|
|
3973
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT10", v8::Integer::NewFromUnsigned(isolate, 0x8CEA));
|
|
3974
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT11", v8::Integer::NewFromUnsigned(isolate, 0x8CEB));
|
|
3975
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT12", v8::Integer::NewFromUnsigned(isolate, 0x8CEC));
|
|
3976
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT13", v8::Integer::NewFromUnsigned(isolate, 0x8CED));
|
|
3977
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT14", v8::Integer::NewFromUnsigned(isolate, 0x8CEE));
|
|
3978
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT15", v8::Integer::NewFromUnsigned(isolate, 0x8CEF));
|
|
3979
|
+
|
|
3980
|
+
tmpl->Set(isolate, "SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8B5F));
|
|
3981
|
+
tmpl->Set(isolate, "SAMPLER_2D_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8B62));
|
|
3982
|
+
tmpl->Set(isolate, "SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DC1));
|
|
3983
|
+
tmpl->Set(isolate, "SAMPLER_2D_ARRAY_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC4));
|
|
3984
|
+
tmpl->Set(isolate, "SAMPLER_CUBE_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC5));
|
|
3985
|
+
|
|
3986
|
+
tmpl->Set(isolate, "INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DCA));
|
|
3987
|
+
tmpl->Set(isolate, "INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DCB));
|
|
3988
|
+
tmpl->Set(isolate, "INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DCC));
|
|
3989
|
+
tmpl->Set(isolate, "INT_SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DCF));
|
|
3990
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DD2));
|
|
3991
|
+
|
|
3992
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DD3));
|
|
3993
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DD4));
|
|
3994
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D_ARRAY",
|
|
3995
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8DD7));
|
|
3996
|
+
tmpl->Set(isolate, "MAX_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8D57));
|
|
3997
|
+
tmpl->Set(isolate, "SAMPLER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8919));
|
|
3998
|
+
|
|
3999
|
+
tmpl->Set(isolate, "PIXEL_PACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EB));
|
|
4000
|
+
tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EC));
|
|
4001
|
+
tmpl->Set(isolate, "PIXEL_PACK_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x88ED));
|
|
4002
|
+
tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER_BINDING",
|
|
4003
|
+
v8::Integer::NewFromUnsigned(isolate, 0x88EF));
|
|
4004
|
+
tmpl->Set(isolate, "COPY_READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F36));
|
|
4005
|
+
|
|
4006
|
+
tmpl->Set(isolate, "COPY_WRITE_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F37));
|
|
4007
|
+
tmpl->Set(isolate, "COPY_READ_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F36));
|
|
4008
|
+
tmpl->Set(isolate, "COPY_WRITE_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F37));
|
|
4009
|
+
tmpl->Set(isolate, "FLOAT_MAT2x3", v8::Integer::NewFromUnsigned(isolate, 0x8B65));
|
|
4010
|
+
tmpl->Set(isolate, "FLOAT_MAT2x4", v8::Integer::NewFromUnsigned(isolate, 0x8B66));
|
|
4011
|
+
|
|
4012
|
+
tmpl->Set(isolate, "FLOAT_MAT3x2", v8::Integer::NewFromUnsigned(isolate, 0x8B67));
|
|
4013
|
+
tmpl->Set(isolate, "FLOAT_MAT3x4", v8::Integer::NewFromUnsigned(isolate, 0x8B68));
|
|
4014
|
+
tmpl->Set(isolate, "FLOAT_MAT4x2", v8::Integer::NewFromUnsigned(isolate, 0x8B69));
|
|
4015
|
+
tmpl->Set(isolate, "FLOAT_MAT4x3", v8::Integer::NewFromUnsigned(isolate, 0x8B6A));
|
|
4016
|
+
tmpl->Set(isolate, "UNSIGNED_INT_VEC2", v8::Integer::NewFromUnsigned(isolate, 0x8DC6));
|
|
4017
|
+
|
|
4018
|
+
tmpl->Set(isolate, "UNSIGNED_INT_VEC3", v8::Integer::NewFromUnsigned(isolate, 0x8DC7));
|
|
4019
|
+
tmpl->Set(isolate, "UNSIGNED_INT_VEC4", v8::Integer::NewFromUnsigned(isolate, 0x8DC8));
|
|
4020
|
+
tmpl->Set(isolate, "UNSIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8C17));
|
|
4021
|
+
tmpl->Set(isolate, "SIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8F9C));
|
|
4022
|
+
|
|
4023
|
+
/* Vertex attributes */
|
|
4024
|
+
|
|
4025
|
+
tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_INTEGER",
|
|
4026
|
+
v8::Integer::NewFromUnsigned(isolate, 0x88FD));
|
|
4027
|
+
tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_DIVISOR",
|
|
4028
|
+
v8::Integer::NewFromUnsigned(isolate, 0x88FE));
|
|
4029
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_MODE",
|
|
4030
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C7F));
|
|
4031
|
+
tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",
|
|
4032
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C80));
|
|
4033
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_VARYINGS",
|
|
4034
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C83));
|
|
4035
|
+
|
|
4036
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_START",
|
|
4037
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C84));
|
|
4038
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_SIZE",
|
|
4039
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C85));
|
|
4040
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",
|
|
4041
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C88));
|
|
4042
|
+
tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",
|
|
4043
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C8A));
|
|
4044
|
+
|
|
4045
|
+
/* Textures */
|
|
4046
|
+
|
|
4047
|
+
/* Pixel types */
|
|
4048
|
+
|
|
4049
|
+
tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",
|
|
4050
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C8B));
|
|
4051
|
+
tmpl->Set(isolate, "INTERLEAVED_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8C));
|
|
4052
|
+
tmpl->Set(isolate, "SEPARATE_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8D));
|
|
4053
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8C8E));
|
|
4054
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_BINDING",
|
|
4055
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C8F));
|
|
4056
|
+
|
|
4057
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK", v8::Integer::NewFromUnsigned(isolate, 0x8E22));
|
|
4058
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PAUSED", v8::Integer::NewFromUnsigned(isolate, 0x8E23));
|
|
4059
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_ACTIVE", v8::Integer::NewFromUnsigned(isolate, 0x8E24));
|
|
4060
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8E25));
|
|
4061
|
+
|
|
4062
|
+
/* Pixel types */
|
|
4063
|
+
|
|
4064
|
+
/* Queries */
|
|
4065
|
+
|
|
4066
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",
|
|
4067
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8210));
|
|
4068
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",
|
|
4069
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8211));
|
|
4070
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_RED_SIZE",
|
|
4071
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8212));
|
|
4072
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",
|
|
4073
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8213));
|
|
4074
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",
|
|
4075
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8214));
|
|
4076
|
+
|
|
4077
|
+
/* Queries */
|
|
4078
|
+
|
|
4079
|
+
/* Draw buffers */
|
|
4080
|
+
|
|
4081
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",
|
|
4082
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8215));
|
|
4083
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",
|
|
4084
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8216));
|
|
4085
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",
|
|
4086
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8217));
|
|
4087
|
+
tmpl->Set(isolate, "FRAMEBUFFER_DEFAULT", v8::Integer::NewFromUnsigned(isolate, 0x8218));
|
|
4088
|
+
tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Integer::NewFromUnsigned(isolate, 0x821A));
|
|
4089
|
+
|
|
4090
|
+
tmpl->Set(isolate, "DEPTH_STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x84F9));
|
|
4091
|
+
tmpl->Set(isolate, "DEPTH24_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x88F0));
|
|
4092
|
+
tmpl->Set(isolate, "DRAW_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CA6));
|
|
4093
|
+
tmpl->Set(isolate, "READ_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA8));
|
|
4094
|
+
tmpl->Set(isolate, "DRAW_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA9));
|
|
4095
|
+
|
|
4096
|
+
tmpl->Set(isolate, "READ_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CAA));
|
|
4097
|
+
tmpl->Set(isolate, "RENDERBUFFER_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8CAB));
|
|
4098
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",
|
|
4099
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8CD4));
|
|
4100
|
+
tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",
|
|
4101
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8D56));
|
|
4102
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8A11));
|
|
4103
|
+
|
|
4104
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A28));
|
|
4105
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_START", v8::Integer::NewFromUnsigned(isolate, 0x8A29));
|
|
4106
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A2A));
|
|
4107
|
+
tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A2B));
|
|
4108
|
+
tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_BLOCKS",
|
|
4109
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A2D));
|
|
4110
|
+
|
|
4111
|
+
tmpl->Set(isolate, "MAX_COMBINED_UNIFORM_BLOCKS",
|
|
4112
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A2E));
|
|
4113
|
+
tmpl->Set(isolate, "MAX_UNIFORM_BUFFER_BINDINGS",
|
|
4114
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A2F));
|
|
4115
|
+
tmpl->Set(isolate, "MAX_UNIFORM_BLOCK_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A30));
|
|
4116
|
+
tmpl->Set(isolate, "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",
|
|
4117
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A31));
|
|
4118
|
+
tmpl->Set(isolate, "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",
|
|
4119
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A33));
|
|
4120
|
+
|
|
4121
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_OFFSET_ALIGNMENT",
|
|
4122
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A34));
|
|
4123
|
+
tmpl->Set(isolate, "ACTIVE_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A36));
|
|
4124
|
+
tmpl->Set(isolate, "UNIFORM_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x8A37));
|
|
4125
|
+
tmpl->Set(isolate, "UNIFORM_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A38));
|
|
4126
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8A3A));
|
|
4127
|
+
|
|
4128
|
+
tmpl->Set(isolate, "UNIFORM_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8A3B));
|
|
4129
|
+
tmpl->Set(isolate, "UNIFORM_ARRAY_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3C));
|
|
4130
|
+
tmpl->Set(isolate, "UNIFORM_MATRIX_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3D));
|
|
4131
|
+
|
|
4132
|
+
/* Draw buffers */
|
|
4133
|
+
|
|
4134
|
+
/* Samplers */
|
|
4135
|
+
|
|
4136
|
+
tmpl->Set(isolate, "UNIFORM_IS_ROW_MAJOR", v8::Integer::NewFromUnsigned(isolate, 0x8A3E));
|
|
4137
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A3F));
|
|
4138
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_DATA_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A40));
|
|
4139
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORMS",
|
|
4140
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A42));
|
|
4141
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",
|
|
4142
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A43));
|
|
4143
|
+
|
|
4144
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",
|
|
4145
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A44));
|
|
4146
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",
|
|
4147
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A46));
|
|
4148
|
+
tmpl->Set(isolate, "OBJECT_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x9112));
|
|
4149
|
+
tmpl->Set(isolate, "SYNC_CONDITION", v8::Integer::NewFromUnsigned(isolate, 0x9113));
|
|
4150
|
+
tmpl->Set(isolate, "SYNC_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x9114));
|
|
4151
|
+
|
|
4152
|
+
tmpl->Set(isolate, "SYNC_FLAGS", v8::Integer::NewFromUnsigned(isolate, 0x9115));
|
|
4153
|
+
tmpl->Set(isolate, "SYNC_FENCE", v8::Integer::NewFromUnsigned(isolate, 0x9116));
|
|
4154
|
+
tmpl->Set(isolate, "SYNC_GPU_COMMANDS_COMPLETE", v8::Integer::NewFromUnsigned(isolate, 0x9117));
|
|
4155
|
+
tmpl->Set(isolate, "UNSIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9118));
|
|
4156
|
+
tmpl->Set(isolate, "SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9119));
|
|
4157
|
+
|
|
4158
|
+
/* Samplers */
|
|
4159
|
+
|
|
4160
|
+
/* Buffers */
|
|
4161
|
+
|
|
4162
|
+
tmpl->Set(isolate, "ALREADY_SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x911A));
|
|
4163
|
+
tmpl->Set(isolate, "TIMEOUT_EXPIRED", v8::Integer::NewFromUnsigned(isolate, 0x911B));
|
|
4164
|
+
tmpl->Set(isolate, "CONDITION_SATISFIED", v8::Integer::NewFromUnsigned(isolate, 0x911C));
|
|
4165
|
+
tmpl->Set(isolate, "WAIT_FAILED", v8::Integer::NewFromUnsigned(isolate, 0x911D));
|
|
4166
|
+
tmpl->Set(isolate, "SYNC_FLUSH_COMMANDS_BIT",
|
|
4167
|
+
v8::Integer::NewFromUnsigned(isolate, 0x00000001));
|
|
4168
|
+
|
|
4169
|
+
tmpl->Set(isolate, "COLOR", v8::Integer::NewFromUnsigned(isolate, 0x1800));
|
|
4170
|
+
tmpl->Set(isolate, "DEPTH", v8::Integer::NewFromUnsigned(isolate, 0x1801));
|
|
4171
|
+
tmpl->Set(isolate, "STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x1802));
|
|
4172
|
+
|
|
4173
|
+
/* Buffers */
|
|
4174
|
+
|
|
4175
|
+
/* Data types */
|
|
4176
|
+
|
|
4177
|
+
tmpl->Set(isolate, "MIN", v8::Integer::NewFromUnsigned(isolate, 0x8007));
|
|
4178
|
+
tmpl->Set(isolate, "MAX", v8::Integer::NewFromUnsigned(isolate, 0x8008));
|
|
4179
|
+
tmpl->Set(isolate, "DEPTH_COMPONENT24", v8::Integer::NewFromUnsigned(isolate, 0x81A6));
|
|
4180
|
+
tmpl->Set(isolate, "STREAM_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E1));
|
|
4181
|
+
tmpl->Set(isolate, "STREAM_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E2));
|
|
4182
|
+
|
|
4183
|
+
tmpl->Set(isolate, "STATIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E5));
|
|
4184
|
+
tmpl->Set(isolate, "STATIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E6));
|
|
4185
|
+
tmpl->Set(isolate, "DYNAMIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E9));
|
|
4186
|
+
tmpl->Set(isolate, "DYNAMIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88EA));
|
|
4187
|
+
tmpl->Set(isolate, "DEPTH_COMPONENT32F", v8::Integer::NewFromUnsigned(isolate, 0x8CAC));
|
|
4188
|
+
tmpl->Set(isolate, "DEPTH32F_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x8CAD));
|
|
4189
|
+
|
|
4190
|
+
/* Data types */
|
|
4191
|
+
|
|
4192
|
+
tmpl->Set(isolate, "INVALID_INDEX", v8::Integer::NewFromUnsigned(isolate, 0xFFFFFFFF));
|
|
4193
|
+
tmpl->Set(isolate, "TIMEOUT_IGNORED", v8::Int32::New(isolate, -1));
|
|
4194
|
+
|
|
4195
|
+
/* Vertex attributes */
|
|
4196
|
+
|
|
4197
|
+
/* Transform feedback */
|
|
4198
|
+
|
|
4199
|
+
tmpl->Set(isolate, "MAX_CLIENT_WAIT_TIMEOUT_WEBGL",
|
|
4200
|
+
v8::Integer::NewFromUnsigned(isolate, 0x9247));
|
|
4201
|
+
|
|
4202
|
+
/* Transform feedback */
|
|
4203
|
+
|
|
4204
|
+
}
|
|
4205
|
+
|
|
4206
|
+
|
|
4207
|
+
void WebGL2RenderingContext::SetMethods(v8::Isolate *isolate,
|
|
4208
|
+
const v8::Local<v8::ObjectTemplate> &tmpl) {
|
|
4209
|
+
|
|
4210
|
+
SetFastMethod(isolate, tmpl, "beginQuery", BeginQuery, &fast_begin_query_,
|
|
4211
|
+
v8::Local<v8::Value>());
|
|
4212
|
+
|
|
4213
|
+
SetFastMethod(isolate, tmpl, "beginTransformFeedback", BeginTransformFeedback,
|
|
4214
|
+
&fast_begin_transform_feedback_, v8::Local<v8::Value>());
|
|
4215
|
+
|
|
4216
|
+
SetFastMethod(isolate, tmpl, "bindBufferBase", BindBufferBase, &fast_bind_buffer_base_,
|
|
4217
|
+
v8::Local<v8::Value>());
|
|
4218
|
+
|
|
4219
|
+
SetFastMethod(isolate, tmpl, "bindBufferRange", BindBufferRange, &fast_bind_buffer_range_,
|
|
4220
|
+
v8::Local<v8::Value>());
|
|
4221
|
+
|
|
4222
|
+
SetFastMethod(isolate, tmpl, "bindSampler", BindSampler, &fast_bind_sampler_,
|
|
4223
|
+
v8::Local<v8::Value>());
|
|
4224
|
+
|
|
4225
|
+
SetFastMethod(isolate, tmpl, "bindTransformFeedback", BindTransformFeedback,
|
|
4226
|
+
&fast_bind_transform_feedback_, v8::Local<v8::Value>());
|
|
4227
|
+
|
|
4228
|
+
|
|
4229
|
+
SetFastMethod(isolate, tmpl, "bindVertexArray", BindVertexArray, &fast_bind_vertex_array_,
|
|
4230
|
+
v8::Local<v8::Value>());
|
|
4231
|
+
|
|
4232
|
+
|
|
4233
|
+
SetFastMethod(isolate, tmpl, "blitFramebuffer", BlitFramebuffer, &fast_blit_framebuffer_,
|
|
4234
|
+
v8::Local<v8::Value>());
|
|
4235
|
+
|
|
4236
|
+
SetFastMethod(isolate, tmpl, "clearBufferfi", ClearBufferfi, &fast_clear_buffer_fi_,
|
|
4237
|
+
v8::Local<v8::Value>());
|
|
4238
|
+
|
|
4239
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "clearBufferfv", ClearBufferfv,
|
|
4240
|
+
fast_clear_buffer_fv_overloads_, v8::Local<v8::Value>());
|
|
4241
|
+
|
|
4242
|
+
|
|
4243
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "clearBufferiv", ClearBufferiv,
|
|
4244
|
+
fast_clear_buffer_iv_overloads_, v8::Local<v8::Value>());
|
|
4245
|
+
|
|
4246
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "clearBufferuiv", ClearBufferuiv,
|
|
4247
|
+
fast_clear_buffer_uiv_overloads_, v8::Local<v8::Value>());
|
|
4248
|
+
|
|
4249
|
+
|
|
4250
|
+
tmpl->Set(
|
|
4251
|
+
ConvertToV8String(isolate, "clientWaitSync"),
|
|
4252
|
+
v8::FunctionTemplate::New(isolate, &ClientWaitSync)
|
|
4253
|
+
);
|
|
4254
|
+
|
|
4255
|
+
tmpl->Set(
|
|
4256
|
+
ConvertToV8String(isolate, "compressedTexSubImage3D"),
|
|
4257
|
+
v8::FunctionTemplate::New(isolate, &CompressedTexSubImage3D)
|
|
4258
|
+
);
|
|
4259
|
+
|
|
4260
|
+
SetFastMethod(isolate, tmpl, "copyBufferSubData", CopyBufferSubData,
|
|
4261
|
+
&fast_copy_buffer_sub_data_, v8::Local<v8::Value>());
|
|
4262
|
+
|
|
4263
|
+
|
|
4264
|
+
SetFastMethod(isolate, tmpl, "copyTexSubImage3D", CopyTexSubImage3D,
|
|
4265
|
+
&fast_copy_tex_sub_image_3d_, v8::Local<v8::Value>());
|
|
4266
|
+
|
|
4267
|
+
|
|
4268
|
+
tmpl->Set(
|
|
4269
|
+
ConvertToV8String(isolate, "createQuery"),
|
|
4270
|
+
v8::FunctionTemplate::New(isolate, &CreateQuery)
|
|
4271
|
+
);
|
|
4272
|
+
|
|
4273
|
+
tmpl->Set(
|
|
4274
|
+
ConvertToV8String(isolate, "createSampler"),
|
|
4275
|
+
v8::FunctionTemplate::New(isolate, &CreateSampler)
|
|
4276
|
+
);
|
|
4277
|
+
|
|
4278
|
+
tmpl->Set(
|
|
4279
|
+
ConvertToV8String(isolate, "createTransformFeedback"),
|
|
4280
|
+
v8::FunctionTemplate::New(isolate, &CreateTransformFeedback)
|
|
4281
|
+
);
|
|
4282
|
+
|
|
4283
|
+
tmpl->Set(
|
|
4284
|
+
ConvertToV8String(isolate, "createVertexArray"),
|
|
4285
|
+
v8::FunctionTemplate::New(isolate, &CreateVertexArray)
|
|
4286
|
+
);
|
|
4287
|
+
|
|
4288
|
+
|
|
4289
|
+
SetFastMethod(isolate, tmpl, "deleteQuery", DeleteQuery,
|
|
4290
|
+
&fast_delete_query_, v8::Local<v8::Value>());
|
|
4291
|
+
|
|
4292
|
+
SetFastMethod(isolate, tmpl, "deleteSampler", DeleteSampler,
|
|
4293
|
+
&fast_delete_sampler_, v8::Local<v8::Value>());
|
|
4294
|
+
|
|
4295
|
+
SetFastMethod(isolate, tmpl, "deleteSync", DeleteSync,
|
|
4296
|
+
&fast_delete_sync_, v8::Local<v8::Value>());
|
|
4297
|
+
|
|
4298
|
+
SetFastMethod(isolate, tmpl, "deleteTransformFeedback", DeleteTransformFeedback,
|
|
4299
|
+
&fast_delete_transform_feedback_, v8::Local<v8::Value>());
|
|
4300
|
+
|
|
4301
|
+
SetFastMethod(isolate, tmpl, "deleteVertexArray", DeleteVertexArray,
|
|
4302
|
+
&fast_delete_vertex_array_, v8::Local<v8::Value>());
|
|
4303
|
+
|
|
4304
|
+
SetFastMethod(isolate, tmpl, "drawArraysInstanced", DrawArraysInstanced,
|
|
4305
|
+
&fast_draw_arrays_instanced_, v8::Local<v8::Value>());
|
|
4306
|
+
|
|
4307
|
+
SetFastMethod(isolate, tmpl, "drawBuffers", DrawBuffers, &fast_draw_buffers_,
|
|
4308
|
+
v8::Local<v8::Value>());
|
|
4309
|
+
|
|
4310
|
+
SetFastMethod(isolate, tmpl, "drawElementsInstanced", DrawElementsInstanced,
|
|
4311
|
+
&fast_draw_elements_instanced_, v8::Local<v8::Value>());
|
|
4312
|
+
|
|
4313
|
+
|
|
4314
|
+
SetFastMethod(isolate, tmpl, "drawRangeElements", DrawRangeElements, &fast_draw_range_elements_,
|
|
4315
|
+
v8::Local<v8::Value>());
|
|
4316
|
+
|
|
4317
|
+
|
|
4318
|
+
SetFastMethod(isolate, tmpl, "endQuery", EndQuery, &fast_end_query_,
|
|
4319
|
+
v8::Local<v8::Value>());
|
|
4320
|
+
|
|
4321
|
+
SetFastMethod(isolate, tmpl, "endTransformFeedback", EndTransformFeedback, &fast_end_transform_feedback_,
|
|
4322
|
+
v8::Local<v8::Value>());
|
|
4323
|
+
|
|
4324
|
+
|
|
4325
|
+
tmpl->Set(
|
|
4326
|
+
ConvertToV8String(isolate, "fenceSync"),
|
|
4327
|
+
v8::FunctionTemplate::New(isolate, &FenceSync)
|
|
4328
|
+
);
|
|
4329
|
+
|
|
4330
|
+
|
|
4331
|
+
SetFastMethod(isolate, tmpl, "framebufferTextureLayer", FramebufferTextureLayer, &fast_framebuffer_texture_layer_,
|
|
4332
|
+
v8::Local<v8::Value>());
|
|
4333
|
+
|
|
4334
|
+
SetFastMethod(isolate, tmpl, "uniform1ui", Uniform1ui, &fast_uniform_1ui_,
|
|
4335
|
+
v8::Local<v8::Value>());
|
|
4336
|
+
|
|
4337
|
+
SetFastMethod(isolate, tmpl, "uniform1uiv", Uniform1uiv, &fast_uniform_1uiv_,
|
|
4338
|
+
v8::Local<v8::Value>());
|
|
4339
|
+
|
|
4340
|
+
SetFastMethod(isolate, tmpl, "uniform2ui", Uniform2ui, &fast_uniform_2ui_,
|
|
4341
|
+
v8::Local<v8::Value>());
|
|
4342
|
+
|
|
4343
|
+
SetFastMethod(isolate, tmpl, "uniform2uiv", Uniform2uiv, &fast_uniform_2uiv_,
|
|
4344
|
+
v8::Local<v8::Value>());
|
|
4345
|
+
|
|
4346
|
+
SetFastMethod(isolate, tmpl, "uniform3ui", Uniform3ui, &fast_uniform_3ui_,
|
|
4347
|
+
v8::Local<v8::Value>());
|
|
4348
|
+
|
|
4349
|
+
SetFastMethod(isolate, tmpl, "uniform3uiv", Uniform3uiv, &fast_uniform_3uiv_,
|
|
4350
|
+
v8::Local<v8::Value>());
|
|
4351
|
+
|
|
4352
|
+
SetFastMethod(isolate, tmpl, "uniform4ui", Uniform4ui, &fast_uniform_4ui_,
|
|
4353
|
+
v8::Local<v8::Value>());
|
|
4354
|
+
|
|
4355
|
+
SetFastMethod(isolate, tmpl, "uniform4uiv", Uniform4uiv, &fast_uniform_4uiv_,
|
|
4356
|
+
v8::Local<v8::Value>());
|
|
4357
|
+
|
|
4358
|
+
SetFastMethod(isolate, tmpl, "uniformBlockBinding", UniformBlockBinding,
|
|
4359
|
+
&fast_uniform_block_binding_, v8::Local<v8::Value>());
|
|
4360
|
+
|
|
4361
|
+
|
|
4362
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "uniformMatrix2x3fv", UniformMatrix2x3fv,
|
|
4363
|
+
fast_uniform_matrix_2x3fv_overloads_, v8::Local<v8::Value>());
|
|
4364
|
+
|
|
4365
|
+
|
|
4366
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "uniformMatrix2x4fv", UniformMatrix2x4fv,
|
|
4367
|
+
fast_uniform_matrix_2x4fv_overloads_, v8::Local<v8::Value>());
|
|
4368
|
+
|
|
4369
|
+
|
|
4370
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "uniformMatrix3x2fv", UniformMatrix3x2fv,
|
|
4371
|
+
fast_uniform_matrix_3x2fv_overloads_, v8::Local<v8::Value>());
|
|
4372
|
+
|
|
4373
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "uniformMatrix3x4fv", UniformMatrix3x4fv,
|
|
4374
|
+
fast_uniform_matrix_3x4fv_overloads_, v8::Local<v8::Value>());
|
|
4375
|
+
|
|
4376
|
+
|
|
4377
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "uniformMatrix4x2fv", UniformMatrix4x2fv,
|
|
4378
|
+
fast_uniform_matrix_4x2fv_overloads_, v8::Local<v8::Value>());
|
|
4379
|
+
|
|
4380
|
+
|
|
4381
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "uniformMatrix4x3fv", UniformMatrix4x3fv,
|
|
4382
|
+
fast_uniform_matrix_4x3fv_overloads_, v8::Local<v8::Value>());
|
|
4383
|
+
|
|
4384
|
+
|
|
4385
|
+
SetFastMethod(isolate, tmpl, "vertexAttribDivisor", VertexAttribDivisor,
|
|
4386
|
+
&fast_vertex_attrib_divisor_, v8::Local<v8::Value>());
|
|
4387
|
+
|
|
4388
|
+
|
|
4389
|
+
SetFastMethod(isolate, tmpl, "vertexAttribI4i", VertexAttribI4i, &fast_vertex_attrib_i_4i_,
|
|
4390
|
+
v8::Local<v8::Value>());
|
|
4391
|
+
|
|
4392
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "vertexAttribI4iv", VertexAttribI4iv,
|
|
4393
|
+
fast_vertex_attrib_i_4iv_overloads_, v8::Local<v8::Value>());
|
|
4394
|
+
|
|
4395
|
+
|
|
4396
|
+
SetFastMethod(isolate, tmpl, "vertexAttribI4ui", VertexAttribI4ui, &fast_vertex_attrib_i_4ui_,
|
|
4397
|
+
v8::Local<v8::Value>());
|
|
4398
|
+
|
|
4399
|
+
|
|
4400
|
+
SetFastMethodWithOverLoads(isolate, tmpl, "vertexAttribI4uiv", VertexAttribI4uiv,
|
|
4401
|
+
fast_vertex_attrib_i_4uiv_overloads_, v8::Local<v8::Value>());
|
|
4402
|
+
|
|
4403
|
+
|
|
4404
|
+
tmpl->Set(
|
|
4405
|
+
ConvertToV8String(isolate, "getActiveUniformBlockName"),
|
|
4406
|
+
v8::FunctionTemplate::New(isolate, &GetActiveUniformBlockName)
|
|
4407
|
+
);
|
|
4408
|
+
|
|
4409
|
+
tmpl->Set(
|
|
4410
|
+
ConvertToV8String(isolate, "getActiveUniformBlockParameter"),
|
|
4411
|
+
v8::FunctionTemplate::New(isolate, &GetActiveUniformBlockParameter)
|
|
4412
|
+
);
|
|
4413
|
+
|
|
4414
|
+
tmpl->Set(
|
|
4415
|
+
ConvertToV8String(isolate, "getActiveUniforms"),
|
|
4416
|
+
v8::FunctionTemplate::New(isolate, &GetActiveUniforms)
|
|
4417
|
+
);
|
|
4418
|
+
|
|
4419
|
+
tmpl->Set(
|
|
4420
|
+
ConvertToV8String(isolate, "getBufferSubData"),
|
|
4421
|
+
v8::FunctionTemplate::New(isolate, &GetBufferSubData)
|
|
4422
|
+
);
|
|
4423
|
+
|
|
4424
|
+
|
|
4425
|
+
tmpl->Set(
|
|
4426
|
+
ConvertToV8String(isolate, "getFragDataLocation"),
|
|
4427
|
+
v8::FunctionTemplate::New(isolate, &GetFragDataLocation)
|
|
4428
|
+
);
|
|
4429
|
+
|
|
4430
|
+
|
|
4431
|
+
tmpl->Set(
|
|
4432
|
+
ConvertToV8String(isolate, "getIndexedParameter"),
|
|
4433
|
+
v8::FunctionTemplate::New(isolate, &GetIndexedParameter)
|
|
4434
|
+
);
|
|
4435
|
+
|
|
4436
|
+
tmpl->Set(
|
|
4437
|
+
ConvertToV8String(isolate, "getInternalformatParameter"),
|
|
4438
|
+
v8::FunctionTemplate::New(isolate, &GetInternalformatParameter)
|
|
4439
|
+
);
|
|
4440
|
+
|
|
4441
|
+
tmpl->Set(
|
|
4442
|
+
ConvertToV8String(isolate, "getParameter"),
|
|
4443
|
+
v8::FunctionTemplate::New(isolate, &GetParameter)
|
|
4444
|
+
);
|
|
4445
|
+
|
|
4446
|
+
tmpl->Set(
|
|
4447
|
+
ConvertToV8String(isolate, "getQueryParameter"),
|
|
4448
|
+
v8::FunctionTemplate::New(isolate, &GetQueryParameter)
|
|
4449
|
+
);
|
|
4450
|
+
|
|
4451
|
+
|
|
4452
|
+
tmpl->Set(
|
|
4453
|
+
ConvertToV8String(isolate, "getQuery"),
|
|
4454
|
+
v8::FunctionTemplate::New(isolate, &GetQuery)
|
|
4455
|
+
);
|
|
4456
|
+
|
|
4457
|
+
tmpl->Set(
|
|
4458
|
+
ConvertToV8String(isolate, "getSamplerParameter"),
|
|
4459
|
+
v8::FunctionTemplate::New(isolate, &GetSamplerParameter)
|
|
4460
|
+
);
|
|
4461
|
+
|
|
4462
|
+
tmpl->Set(
|
|
4463
|
+
ConvertToV8String(isolate, "getSyncParameter"),
|
|
4464
|
+
v8::FunctionTemplate::New(isolate, &GetSyncParameter)
|
|
4465
|
+
);
|
|
4466
|
+
|
|
4467
|
+
tmpl->Set(
|
|
4468
|
+
ConvertToV8String(isolate, "getTransformFeedbackVarying"),
|
|
4469
|
+
v8::FunctionTemplate::New(isolate, &GetTransformFeedbackVarying)
|
|
4470
|
+
);
|
|
4471
|
+
|
|
4472
|
+
tmpl->Set(
|
|
4473
|
+
ConvertToV8String(isolate, "getUniformBlockIndex"),
|
|
4474
|
+
v8::FunctionTemplate::New(isolate, &GetUniformBlockIndex)
|
|
4475
|
+
);
|
|
4476
|
+
|
|
4477
|
+
tmpl->Set(
|
|
4478
|
+
ConvertToV8String(isolate, "getUniformIndices"),
|
|
4479
|
+
v8::FunctionTemplate::New(isolate, &GetUniformIndices)
|
|
4480
|
+
);
|
|
4481
|
+
|
|
4482
|
+
SetFastMethod(isolate, tmpl, "invalidateFramebuffer", InvalidateFramebuffer,
|
|
4483
|
+
&fast_invalidate_framebuffer_, v8::Local<v8::Value>());
|
|
4484
|
+
|
|
4485
|
+
|
|
4486
|
+
SetFastMethod(isolate, tmpl, "invalidateSubFramebuffer", InvalidateSubFramebuffer,
|
|
4487
|
+
&fast_invalidate_sub_framebuffer_, v8::Local<v8::Value>());
|
|
4488
|
+
|
|
4489
|
+
|
|
4490
|
+
|
|
4491
|
+
SetFastMethod(isolate, tmpl, "isQuery", IsQuery,
|
|
4492
|
+
&fast_is_query_, v8::Local<v8::Value>());
|
|
4493
|
+
|
|
4494
|
+
|
|
4495
|
+
SetFastMethod(isolate, tmpl, "isSampler", IsSampler,
|
|
4496
|
+
&fast_is_sampler_, v8::Local<v8::Value>());
|
|
4497
|
+
|
|
4498
|
+
|
|
4499
|
+
|
|
4500
|
+
SetFastMethod(isolate, tmpl, "isSync", IsSync,
|
|
4501
|
+
&fast_is_sync_, v8::Local<v8::Value>());
|
|
4502
|
+
|
|
4503
|
+
|
|
4504
|
+
|
|
4505
|
+
SetFastMethod(isolate, tmpl, "isTransformFeedback", IsTransformFeedback,
|
|
4506
|
+
&fast_is_transform_feedback_, v8::Local<v8::Value>());
|
|
4507
|
+
|
|
4508
|
+
SetFastMethod(isolate, tmpl, "isVertexArray", IsVertexArray,
|
|
4509
|
+
&fast_is_vertex_array_, v8::Local<v8::Value>());
|
|
4510
|
+
|
|
4511
|
+
|
|
4512
|
+
SetFastMethod(isolate, tmpl, "pauseTransformFeedback", PauseTransformFeedback,
|
|
4513
|
+
&fast_pause_transform_feedback_, v8::Local<v8::Value>());
|
|
4514
|
+
|
|
4515
|
+
|
|
4516
|
+
SetFastMethod(isolate, tmpl, "readBuffer", ReadBuffer,
|
|
4517
|
+
&fast_read_buffer_, v8::Local<v8::Value>());
|
|
4518
|
+
|
|
4519
|
+
|
|
4520
|
+
SetFastMethod(isolate, tmpl, "renderbufferStorageMultisample", RenderbufferStorageMultisample,
|
|
4521
|
+
&fast_renderbuffer_storage_multisample_, v8::Local<v8::Value>());
|
|
4522
|
+
|
|
4523
|
+
|
|
4524
|
+
SetFastMethod(isolate, tmpl, "resumeTransformFeedback", ResumeTransformFeedback,
|
|
4525
|
+
&fast_resume_transform_feedback_, v8::Local<v8::Value>());
|
|
4526
|
+
|
|
4527
|
+
SetFastMethod(isolate, tmpl, "samplerParameterf", SamplerParameterf, &fast_sampler_parameterf_,
|
|
4528
|
+
v8::Local<v8::Value>());
|
|
4529
|
+
|
|
4530
|
+
SetFastMethod(isolate, tmpl, "samplerParameteri", SamplerParameteri, &fast_sampler_parameteri_,
|
|
4531
|
+
v8::Local<v8::Value>());
|
|
4532
|
+
|
|
4533
|
+
|
|
4534
|
+
tmpl->Set(
|
|
4535
|
+
ConvertToV8String(isolate, "texImage3D"),
|
|
4536
|
+
v8::FunctionTemplate::New(isolate, &TexImage3D)
|
|
4537
|
+
);
|
|
4538
|
+
|
|
4539
|
+
|
|
4540
|
+
tmpl->Set(
|
|
4541
|
+
ConvertToV8String(isolate, "texStorage2D"),
|
|
4542
|
+
v8::FunctionTemplate::New(isolate, &TexStorage2D)
|
|
4543
|
+
);
|
|
4544
|
+
|
|
4545
|
+
tmpl->Set(
|
|
4546
|
+
ConvertToV8String(isolate, "texStorage3D"),
|
|
4547
|
+
v8::FunctionTemplate::New(isolate, &TexStorage3D)
|
|
4548
|
+
);
|
|
4549
|
+
|
|
4550
|
+
tmpl->Set(
|
|
4551
|
+
ConvertToV8String(isolate, "texSubImage3D"),
|
|
4552
|
+
v8::FunctionTemplate::New(isolate, &TexSubImage3D)
|
|
4553
|
+
);
|
|
4554
|
+
|
|
4555
|
+
tmpl->Set(
|
|
4556
|
+
ConvertToV8String(isolate, "transformFeedbackVaryings"),
|
|
4557
|
+
v8::FunctionTemplate::New(isolate, &TransformFeedbackVaryings)
|
|
4558
|
+
);
|
|
4559
|
+
}
|
|
4560
|
+
|
|
4561
|
+
void WebGL2RenderingContext::SetProps(v8::Isolate *isolate,
|
|
4562
|
+
const v8::Local<v8::ObjectTemplate> &webgl2RenderingContextTpl) {
|
|
4563
|
+
|
|
4564
|
+
}
|