@luma.gl/webgl 8.6.0-alpha.5 → 9.0.0-alpha.4
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/README.md +3 -67
- package/dist/adapter/converters/device-parameters.d.ts +17 -0
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -0
- package/dist/adapter/converters/{set-device-parameters.js → device-parameters.js} +36 -5
- package/dist/adapter/converters/device-parameters.js.map +1 -0
- package/dist/{classes → adapter/converters}/renderbuffer-formats.d.ts +0 -0
- package/dist/adapter/converters/renderbuffer-formats.d.ts.map +1 -0
- package/dist/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
- package/dist/adapter/converters/renderbuffer-formats.js.map +1 -0
- package/dist/adapter/converters/sampler-parameters.d.ts +19 -0
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -0
- package/dist/adapter/converters/sampler-parameters.js +208 -0
- package/dist/adapter/converters/sampler-parameters.js.map +1 -0
- package/dist/adapter/converters/texture-formats.d.ts +93 -0
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -0
- package/dist/adapter/converters/texture-formats.js +954 -0
- package/dist/adapter/converters/texture-formats.js.map +1 -0
- package/dist/adapter/converters/vertex-formats.d.ts +4 -0
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -0
- package/dist/adapter/converters/vertex-formats.js +35 -0
- package/dist/adapter/converters/vertex-formats.js.map +1 -0
- package/dist/adapter/device-helpers/device-features.d.ts +3 -6
- package/dist/adapter/device-helpers/device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +27 -48
- package/dist/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/adapter/device-helpers/device-limits.d.ts +1 -0
- package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +1 -0
- package/dist/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.js +7 -7
- package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/adapter/helpers/attribute-utils.d.ts +11 -0
- package/dist/adapter/helpers/attribute-utils.d.ts.map +1 -0
- package/dist/adapter/helpers/attribute-utils.js +81 -0
- package/dist/adapter/helpers/attribute-utils.js.map +1 -0
- package/dist/adapter/helpers/get-shader-layout.d.ts +55 -0
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -0
- package/dist/adapter/helpers/get-shader-layout.js +306 -0
- package/dist/adapter/helpers/get-shader-layout.js.map +1 -0
- package/dist/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.d.ts +0 -0
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -0
- package/dist/{esm/webgl-utils → adapter/helpers}/parse-shader-compiler-log.js +0 -0
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
- package/dist/adapter/helpers/set-uniform.d.ts +4 -0
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -0
- package/dist/adapter/helpers/set-uniform.js +115 -0
- package/dist/adapter/helpers/set-uniform.js.map +1 -0
- package/dist/adapter/helpers/uniforms.d.ts +26 -0
- package/dist/adapter/helpers/uniforms.d.ts.map +1 -0
- package/dist/adapter/helpers/uniforms.js +99 -0
- package/dist/adapter/helpers/uniforms.js.map +1 -0
- package/dist/adapter/objects/constants-to-keys.d.ts +5 -0
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -0
- package/dist/{esm/webgl-utils → adapter/objects}/constants-to-keys.js +1 -0
- package/dist/adapter/objects/constants-to-keys.js.map +1 -0
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +40 -0
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -0
- package/dist/{esm/classes/renderbuffer.js → adapter/objects/webgl-renderbuffer.js} +38 -72
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -0
- package/dist/{classes → adapter/objects}/webgl-resource.d.ts +15 -14
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -0
- package/dist/{classes → adapter/objects}/webgl-resource.js +7 -3
- package/dist/adapter/objects/webgl-resource.js.map +1 -0
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts +27 -0
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -0
- package/dist/adapter/objects/webgl-vertex-array-object.js +84 -0
- package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -0
- package/dist/adapter/resources/webgl-buffer.d.ts +27 -0
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-buffer.js +164 -0
- package/dist/adapter/resources/webgl-buffer.js.map +1 -0
- package/dist/adapter/resources/webgl-command-buffer.d.ts +25 -0
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-command-buffer.js +65 -0
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -0
- package/dist/adapter/resources/webgl-command-encoder.d.ts +18 -0
- package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-command-encoder.js +53 -0
- package/dist/adapter/resources/webgl-command-encoder.js.map +1 -0
- package/dist/adapter/resources/webgl-external-texture.d.ts +1 -0
- package/dist/adapter/resources/webgl-external-texture.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-external-texture.js +2 -0
- package/dist/{es5/helpers/program-bindings.js.map → adapter/resources/webgl-external-texture.js.map} +1 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts +40 -0
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-framebuffer.js +265 -0
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -0
- package/dist/adapter/resources/webgl-render-pass.d.ts +11 -0
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-render-pass.js +19 -0
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -0
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +55 -0
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-render-pipeline.js +400 -0
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -0
- package/dist/adapter/resources/webgl-sampler.d.ts +20 -0
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-sampler.js +50 -0
- package/dist/adapter/resources/webgl-sampler.js.map +1 -0
- package/dist/adapter/{webgl-shader.d.ts → resources/webgl-shader.d.ts} +3 -6
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -0
- package/dist/{esm/adapter → adapter/resources}/webgl-shader.js +13 -20
- package/dist/adapter/resources/webgl-shader.js.map +1 -0
- package/dist/adapter/resources/webgl-texture.d.ts +193 -0
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -0
- package/dist/{classes/texture.js → adapter/resources/webgl-texture.js} +274 -229
- package/dist/adapter/resources/webgl-texture.js.map +1 -0
- package/dist/adapter/webgl-canvas-context.d.ts +36 -0
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -0
- package/dist/adapter/webgl-canvas-context.js +54 -0
- package/dist/adapter/webgl-canvas-context.js.map +1 -0
- package/dist/adapter/webgl-device.d.ts +58 -76
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +184 -111
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/classic/accessor.d.ts +32 -0
- package/dist/classic/accessor.d.ts.map +1 -0
- package/dist/{classes → classic}/accessor.js +33 -1
- package/dist/classic/accessor.js.map +1 -0
- package/dist/{classes/webgl-buffer.d.ts → classic/buffer.d.ts} +28 -33
- package/dist/classic/buffer.d.ts.map +1 -0
- package/dist/{esm/classes/webgl-buffer.js → classic/buffer.js} +53 -51
- package/dist/classic/buffer.js.map +1 -0
- package/dist/{webgl-utils → classic}/typed-array-utils.d.ts +3 -2
- package/dist/classic/typed-array-utils.d.ts.map +1 -0
- package/dist/{esm/webgl-utils → classic}/typed-array-utils.js +0 -0
- package/dist/classic/typed-array-utils.js.map +1 -0
- package/dist/context/context/context-state.d.ts.map +1 -1
- package/dist/context/context/context-state.js +1 -1
- package/dist/context/context/context-state.js.map +1 -1
- package/dist/context/context/create-context.d.ts +1 -0
- package/dist/context/context/create-context.d.ts.map +1 -1
- package/dist/context/context/create-context.js +12 -0
- package/dist/context/context/create-context.js.map +1 -1
- package/dist/context/context/device-pixels.d.ts +1 -1
- package/dist/context/context/device-pixels.d.ts.map +1 -1
- package/dist/context/context/device-pixels.js.map +1 -1
- package/dist/context/debug/spector.d.ts +18 -0
- package/dist/context/debug/spector.d.ts.map +1 -0
- package/dist/context/debug/spector.js +76 -0
- package/dist/context/debug/spector.js.map +1 -0
- package/dist/context/debug/webgl-developer-tools.d.ts +19 -0
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -0
- package/dist/context/debug/webgl-developer-tools.js +121 -0
- package/dist/context/debug/webgl-developer-tools.js.map +1 -0
- package/dist/context/parameters/unified-parameter-api.d.ts +3 -2
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +4 -4
- package/dist/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.d.ts +40 -36
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/context/polyfill/polyfill-context.js +4 -3
- package/dist/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
- package/dist/context/state-tracker/deep-array-equal.js.map +1 -1
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +25 -11
- package/dist/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/es5/adapter/converters/{set-device-parameters.js → device-parameters.js} +37 -5
- package/dist/es5/adapter/converters/device-parameters.js.map +1 -0
- package/dist/es5/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
- package/dist/es5/adapter/converters/renderbuffer-formats.js.map +1 -0
- package/dist/es5/adapter/converters/sampler-parameters.js +226 -0
- package/dist/es5/adapter/converters/sampler-parameters.js.map +1 -0
- package/dist/es5/adapter/converters/texture-formats.js +1031 -0
- package/dist/es5/adapter/converters/texture-formats.js.map +1 -0
- package/dist/es5/adapter/converters/vertex-formats.js +45 -0
- package/dist/es5/adapter/converters/vertex-formats.js.map +1 -0
- package/dist/es5/adapter/device-helpers/device-features.js +46 -54
- package/dist/es5/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/es5/adapter/device-helpers/device-limits.js +1 -1
- package/dist/es5/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/es5/adapter/device-helpers/get-device-info.js +7 -7
- package/dist/es5/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/es5/adapter/helpers/attribute-utils.js +91 -0
- package/dist/es5/adapter/helpers/attribute-utils.js.map +1 -0
- package/dist/es5/{helpers/get-program-bindings.js → adapter/helpers/get-shader-layout.js} +184 -87
- package/dist/es5/adapter/helpers/get-shader-layout.js.map +1 -0
- package/dist/es5/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.js +0 -0
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
- package/dist/es5/adapter/helpers/set-uniform.js +125 -0
- package/dist/es5/adapter/helpers/set-uniform.js.map +1 -0
- package/dist/es5/adapter/helpers/uniforms.js +112 -0
- package/dist/es5/adapter/helpers/uniforms.js.map +1 -0
- package/dist/es5/{webgl-utils → adapter/objects}/constants-to-keys.js +1 -0
- package/dist/es5/adapter/objects/constants-to-keys.js.map +1 -0
- package/dist/es5/{classes/renderbuffer.js → adapter/objects/webgl-renderbuffer.js} +48 -98
- package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +1 -0
- package/dist/es5/{classes → adapter/objects}/webgl-resource.js +8 -3
- package/dist/es5/adapter/objects/webgl-resource.js.map +1 -0
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js +137 -0
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +1 -0
- package/dist/es5/adapter/resources/webgl-buffer.js +243 -0
- package/dist/es5/adapter/resources/webgl-buffer.js.map +1 -0
- package/dist/es5/adapter/resources/webgl-command-buffer.js +96 -0
- package/dist/es5/adapter/resources/webgl-command-buffer.js.map +1 -0
- package/dist/es5/adapter/resources/webgl-command-encoder.js +98 -0
- package/dist/es5/adapter/resources/webgl-command-encoder.js.map +1 -0
- package/dist/es5/adapter/resources/webgl-external-texture.js +2 -0
- package/dist/{esm/helpers/program-bindings.js.map → es5/adapter/resources/webgl-external-texture.js.map} +1 -1
- package/dist/es5/adapter/resources/webgl-framebuffer.js +345 -0
- package/dist/es5/adapter/resources/webgl-framebuffer.js.map +1 -0
- package/dist/es5/{classes/texture-2d.js → adapter/resources/webgl-render-pass.js} +25 -45
- package/dist/es5/adapter/resources/webgl-render-pass.js.map +1 -0
- package/dist/es5/adapter/resources/webgl-render-pipeline.js +505 -0
- package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +1 -0
- package/dist/es5/adapter/resources/webgl-sampler.js +96 -0
- package/dist/es5/adapter/resources/webgl-sampler.js.map +1 -0
- package/dist/es5/adapter/{webgl-shader.js → resources/webgl-shader.js} +12 -18
- package/dist/es5/adapter/resources/webgl-shader.js.map +1 -0
- package/dist/es5/{classes/texture.js → adapter/resources/webgl-texture.js} +336 -260
- package/dist/es5/adapter/resources/webgl-texture.js.map +1 -0
- package/dist/es5/adapter/webgl-canvas-context.js +97 -0
- package/dist/es5/adapter/webgl-canvas-context.js.map +1 -0
- package/dist/es5/adapter/webgl-device.js +253 -133
- package/dist/es5/adapter/webgl-device.js.map +1 -1
- package/dist/es5/{classes → classic}/accessor.js +25 -1
- package/dist/es5/classic/accessor.js.map +1 -0
- package/dist/es5/{classes/webgl-buffer.js → classic/buffer.js} +74 -66
- package/dist/es5/classic/buffer.js.map +1 -0
- package/dist/es5/{webgl-utils → classic}/typed-array-utils.js +0 -0
- package/dist/es5/classic/typed-array-utils.js.map +1 -0
- package/dist/es5/context/context/context-state.js +1 -1
- package/dist/es5/context/context/context-state.js.map +1 -1
- package/dist/es5/context/context/create-context.js +12 -0
- package/dist/es5/context/context/create-context.js.map +1 -1
- package/dist/es5/context/context/device-pixels.js.map +1 -1
- package/dist/es5/context/debug/spector.js +133 -0
- package/dist/es5/context/debug/spector.js.map +1 -0
- package/dist/es5/context/debug/webgl-developer-tools.js +198 -0
- package/dist/es5/context/debug/webgl-developer-tools.js.map +1 -0
- package/dist/es5/context/parameters/unified-parameter-api.js +7 -5
- package/dist/es5/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/es5/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/es5/context/polyfill/polyfill-context.js +4 -3
- package/dist/es5/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/es5/context/state-tracker/deep-array-equal.js.map +1 -1
- package/dist/es5/context/state-tracker/track-context-state.js +26 -11
- package/dist/es5/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/es5/index.js +65 -307
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/init.js +1 -41
- package/dist/es5/init.js.map +1 -1
- package/dist/es5/{context/parameters/webgl-parameters.js → types/webgl.js} +1 -1
- package/dist/es5/types/webgl.js.map +1 -0
- package/dist/esm/adapter/converters/{set-device-parameters.js → device-parameters.js} +36 -5
- package/dist/esm/adapter/converters/device-parameters.js.map +1 -0
- package/dist/esm/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
- package/dist/esm/adapter/converters/renderbuffer-formats.js.map +1 -0
- package/dist/esm/adapter/converters/sampler-parameters.js +208 -0
- package/dist/esm/adapter/converters/sampler-parameters.js.map +1 -0
- package/dist/esm/adapter/converters/texture-formats.js +954 -0
- package/dist/esm/adapter/converters/texture-formats.js.map +1 -0
- package/dist/esm/adapter/converters/vertex-formats.js +35 -0
- package/dist/esm/adapter/converters/vertex-formats.js.map +1 -0
- package/dist/esm/adapter/device-helpers/device-features.js +27 -48
- package/dist/esm/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/esm/adapter/device-helpers/device-limits.js +1 -0
- package/dist/esm/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/esm/adapter/device-helpers/get-device-info.js +7 -7
- package/dist/esm/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/esm/adapter/helpers/attribute-utils.js +81 -0
- package/dist/esm/adapter/helpers/attribute-utils.js.map +1 -0
- package/dist/esm/adapter/helpers/get-shader-layout.js +306 -0
- package/dist/esm/adapter/helpers/get-shader-layout.js.map +1 -0
- package/dist/{webgl-utils → esm/adapter/helpers}/parse-shader-compiler-log.js +0 -0
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
- package/dist/esm/adapter/helpers/set-uniform.js +115 -0
- package/dist/esm/adapter/helpers/set-uniform.js.map +1 -0
- package/dist/esm/adapter/helpers/uniforms.js +99 -0
- package/dist/esm/adapter/helpers/uniforms.js.map +1 -0
- package/dist/{webgl-utils → esm/adapter/objects}/constants-to-keys.js +1 -0
- package/dist/esm/adapter/objects/constants-to-keys.js.map +1 -0
- package/dist/{classes/renderbuffer.js → esm/adapter/objects/webgl-renderbuffer.js} +38 -72
- package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +1 -0
- package/dist/esm/{classes → adapter/objects}/webgl-resource.js +7 -3
- package/dist/esm/adapter/objects/webgl-resource.js.map +1 -0
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js +84 -0
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +1 -0
- package/dist/esm/adapter/resources/webgl-buffer.js +164 -0
- package/dist/esm/adapter/resources/webgl-buffer.js.map +1 -0
- package/dist/esm/adapter/resources/webgl-command-buffer.js +65 -0
- package/dist/esm/adapter/resources/webgl-command-buffer.js.map +1 -0
- package/dist/esm/adapter/resources/webgl-command-encoder.js +53 -0
- package/dist/esm/adapter/resources/webgl-command-encoder.js.map +1 -0
- package/dist/esm/adapter/resources/webgl-external-texture.js +2 -0
- package/dist/{helpers/program-bindings.js.map → esm/adapter/resources/webgl-external-texture.js.map} +1 -1
- package/dist/esm/adapter/resources/webgl-framebuffer.js +265 -0
- package/dist/esm/adapter/resources/webgl-framebuffer.js.map +1 -0
- package/dist/esm/adapter/resources/webgl-render-pass.js +19 -0
- package/dist/esm/adapter/resources/webgl-render-pass.js.map +1 -0
- package/dist/esm/adapter/resources/webgl-render-pipeline.js +400 -0
- package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +1 -0
- package/dist/esm/adapter/resources/webgl-sampler.js +50 -0
- package/dist/esm/adapter/resources/webgl-sampler.js.map +1 -0
- package/dist/{adapter → esm/adapter/resources}/webgl-shader.js +13 -20
- package/dist/esm/adapter/resources/webgl-shader.js.map +1 -0
- package/dist/esm/{classes/texture.js → adapter/resources/webgl-texture.js} +274 -229
- package/dist/esm/adapter/resources/webgl-texture.js.map +1 -0
- package/dist/esm/adapter/webgl-canvas-context.js +54 -0
- package/dist/esm/adapter/webgl-canvas-context.js.map +1 -0
- package/dist/esm/adapter/webgl-device.js +184 -111
- package/dist/esm/adapter/webgl-device.js.map +1 -1
- package/dist/esm/{classes → classic}/accessor.js +33 -1
- package/dist/esm/classic/accessor.js.map +1 -0
- package/dist/{classes/webgl-buffer.js → esm/classic/buffer.js} +53 -51
- package/dist/esm/classic/buffer.js.map +1 -0
- package/dist/{webgl-utils → esm/classic}/typed-array-utils.js +0 -0
- package/dist/esm/classic/typed-array-utils.js.map +1 -0
- package/dist/esm/context/context/context-state.js +1 -1
- package/dist/esm/context/context/context-state.js.map +1 -1
- package/dist/esm/context/context/create-context.js +12 -0
- package/dist/esm/context/context/create-context.js.map +1 -1
- package/dist/esm/context/context/device-pixels.js.map +1 -1
- package/dist/esm/context/debug/spector.js +76 -0
- package/dist/esm/context/debug/spector.js.map +1 -0
- package/dist/esm/context/debug/webgl-developer-tools.js +121 -0
- package/dist/esm/context/debug/webgl-developer-tools.js.map +1 -0
- package/dist/esm/context/parameters/unified-parameter-api.js +4 -4
- package/dist/esm/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/esm/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/esm/context/polyfill/polyfill-context.js +4 -3
- package/dist/esm/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/esm/context/state-tracker/deep-array-equal.js.map +1 -1
- package/dist/esm/context/state-tracker/track-context-state.js +25 -11
- package/dist/esm/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/esm/index.js +19 -31
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/init.js +2 -31
- package/dist/esm/init.js.map +1 -1
- package/dist/esm/types/webgl.js +2 -0
- package/dist/esm/types/webgl.js.map +1 -0
- package/dist/index.d.ts +22 -46
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -31
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +1 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +2 -31
- package/dist/init.js.map +1 -1
- package/dist/types/webgl.d.ts +144 -0
- package/dist/types/webgl.d.ts.map +1 -0
- package/dist/types/webgl.js +2 -0
- package/dist/types/webgl.js.map +1 -0
- package/package.json +5 -5
- package/src/adapter/converters/{set-device-parameters.ts → device-parameters.ts} +52 -9
- package/src/{classes → adapter/converters}/renderbuffer-formats.ts +1 -1
- package/src/adapter/converters/sampler-parameters.ts +175 -0
- package/src/adapter/converters/texture-formats.ts +633 -0
- package/src/adapter/converters/vertex-formats.ts +22 -0
- package/src/adapter/device-helpers/device-features.ts +46 -123
- package/src/adapter/device-helpers/device-limits.ts +5 -2
- package/src/adapter/device-helpers/get-device-info.ts +8 -8
- package/src/adapter/helpers/attribute-utils.ts +61 -0
- package/src/adapter/helpers/get-shader-layout.ts +388 -0
- package/src/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.ts +0 -0
- package/src/adapter/helpers/set-uniform.ts +87 -0
- package/src/adapter/helpers/uniforms.ts +110 -0
- package/src/{webgl-utils → adapter/objects}/constants-to-keys.ts +6 -3
- package/src/adapter/objects/webgl-renderbuffer.ts +104 -0
- package/src/{classes → adapter/objects}/webgl-resource.ts +23 -17
- package/src/adapter/objects/webgl-vertex-array-object.ts +111 -0
- package/src/adapter/resources/webgl-buffer.ts +219 -0
- package/src/adapter/resources/webgl-command-buffer.ts +94 -0
- package/src/adapter/resources/webgl-command-encoder.ts +58 -0
- package/src/adapter/resources/webgl-external-texture.ts +92 -0
- package/src/adapter/resources/webgl-framebuffer.ts +279 -0
- package/src/adapter/resources/webgl-render-pass.ts +23 -0
- package/src/adapter/resources/webgl-render-pipeline.ts +413 -0
- package/src/adapter/resources/webgl-sampler.ts +54 -0
- package/src/adapter/{webgl-shader.ts → resources/webgl-shader.ts} +14 -20
- package/src/adapter/resources/webgl-texture.ts +1023 -0
- package/src/adapter/webgl-canvas-context.ts +74 -0
- package/src/adapter/webgl-device.ts +226 -275
- package/{dist/esm/classes/accessor.ts.disabled → src/classic/accessor.ts} +50 -36
- package/src/{classes/webgl-buffer.ts → classic/buffer.ts} +69 -77
- package/src/{webgl-utils → classic}/typed-array-utils.ts +3 -1
- package/src/context/context/context-state.ts +4 -2
- package/src/context/context/create-context.ts +28 -1
- package/src/context/context/device-pixels.ts +9 -4
- package/src/context/debug/spector.ts +92 -0
- package/src/context/debug/webgl-developer-tools.ts +162 -0
- package/src/context/parameters/unified-parameter-api.ts +6 -4
- package/src/context/parameters/webgl-parameter-tables.ts +38 -36
- package/src/context/polyfill/get-parameter-polyfill.ts +1 -1
- package/src/context/polyfill/polyfill-context.ts +4 -3
- package/src/context/state-tracker/deep-array-equal.ts +1 -1
- package/src/context/state-tracker/track-context-state.ts +27 -20
- package/src/index.ts +33 -102
- package/src/init.ts +2 -46
- package/src/types/webgl.ts +283 -0
- package/dist/_deprecated/context-api.d.ts +0 -85
- package/dist/_deprecated/context-api.d.ts.map +0 -1
- package/dist/_deprecated/context-api.js +0 -76
- package/dist/_deprecated/context-api.js.map +0 -1
- package/dist/_deprecated/features.d.ts +0 -27
- package/dist/_deprecated/features.d.ts.map +0 -1
- package/dist/_deprecated/features.js +0 -111
- package/dist/_deprecated/features.js.map +0 -1
- package/dist/adapter/converters/set-device-parameters.d.ts +0 -5
- package/dist/adapter/converters/set-device-parameters.d.ts.map +0 -1
- package/dist/adapter/converters/set-device-parameters.js.map +0 -1
- package/dist/adapter/converters/webgpu-texture-formats.d.ts +0 -281
- package/dist/adapter/converters/webgpu-texture-formats.d.ts.map +0 -1
- package/dist/adapter/converters/webgpu-texture-formats.js +0 -285
- package/dist/adapter/converters/webgpu-texture-formats.js.map +0 -1
- package/dist/adapter/webgl-shader.d.ts.map +0 -1
- package/dist/adapter/webgl-shader.js.map +0 -1
- package/dist/classes/accessor.d.ts +0 -28
- package/dist/classes/accessor.d.ts.map +0 -1
- package/dist/classes/accessor.js.map +0 -1
- package/dist/classes/accessor.ts.disabled +0 -159
- package/dist/classes/clear.d.ts +0 -17
- package/dist/classes/clear.d.ts.map +0 -1
- package/dist/classes/clear.js +0 -105
- package/dist/classes/clear.js.map +0 -1
- package/dist/classes/copy-and-blit.d.ts +0 -86
- package/dist/classes/copy-and-blit.d.ts.map +0 -1
- package/dist/classes/copy-and-blit.js +0 -338
- package/dist/classes/copy-and-blit.js.map +0 -1
- package/dist/classes/framebuffer.d.ts +0 -139
- package/dist/classes/framebuffer.d.ts.map +0 -1
- package/dist/classes/framebuffer.js +0 -656
- package/dist/classes/framebuffer.js.map +0 -1
- package/dist/classes/program-configuration.d.ts +0 -24
- package/dist/classes/program-configuration.d.ts.map +0 -1
- package/dist/classes/program-configuration.js +0 -73
- package/dist/classes/program-configuration.js.map +0 -1
- package/dist/classes/program.d.ts +0 -66
- package/dist/classes/program.d.ts.map +0 -1
- package/dist/classes/program.js +0 -379
- package/dist/classes/program.js.map +0 -1
- package/dist/classes/query.d.ts +0 -27
- package/dist/classes/query.d.ts.map +0 -1
- package/dist/classes/query.js +0 -145
- package/dist/classes/query.js.map +0 -1
- package/dist/classes/renderbuffer-formats.d.ts.map +0 -1
- package/dist/classes/renderbuffer-formats.js.map +0 -1
- package/dist/classes/renderbuffer.d.ts +0 -60
- package/dist/classes/renderbuffer.d.ts.map +0 -1
- package/dist/classes/renderbuffer.js.map +0 -1
- package/dist/classes/shader.d.ts +0 -42
- package/dist/classes/shader.d.ts.map +0 -1
- package/dist/classes/shader.js +0 -118
- package/dist/classes/shader.js.map +0 -1
- package/dist/classes/texture-2d.d.ts +0 -9
- package/dist/classes/texture-2d.d.ts.map +0 -1
- package/dist/classes/texture-2d.js +0 -36
- package/dist/classes/texture-2d.js.map +0 -1
- package/dist/classes/texture-3d.d.ts +0 -29
- package/dist/classes/texture-3d.d.ts.map +0 -1
- package/dist/classes/texture-3d.js +0 -76
- package/dist/classes/texture-3d.js.map +0 -1
- package/dist/classes/texture-cube.d.ts +0 -28
- package/dist/classes/texture-cube.d.ts.map +0 -1
- package/dist/classes/texture-cube.js +0 -130
- package/dist/classes/texture-cube.js.map +0 -1
- package/dist/classes/texture-formats.d.ts +0 -37
- package/dist/classes/texture-formats.d.ts.map +0 -1
- package/dist/classes/texture-formats.js +0 -98
- package/dist/classes/texture-formats.js.map +0 -1
- package/dist/classes/texture.d.ts +0 -123
- package/dist/classes/texture.d.ts.map +0 -1
- package/dist/classes/texture.js.map +0 -1
- package/dist/classes/transform-feedback.d.ts +0 -33
- package/dist/classes/transform-feedback.d.ts.map +0 -1
- package/dist/classes/transform-feedback.js +0 -198
- package/dist/classes/transform-feedback.js.map +0 -1
- package/dist/classes/uniform-buffer-layout.d.ts +0 -17
- package/dist/classes/uniform-buffer-layout.d.ts.map +0 -1
- package/dist/classes/uniform-buffer-layout.js +0 -104
- package/dist/classes/uniform-buffer-layout.js.map +0 -1
- package/dist/classes/uniforms.d.ts +0 -37
- package/dist/classes/uniforms.d.ts.map +0 -1
- package/dist/classes/uniforms.js +0 -250
- package/dist/classes/uniforms.js.map +0 -1
- package/dist/classes/vertex-array-object.d.ts +0 -76
- package/dist/classes/vertex-array-object.d.ts.map +0 -1
- package/dist/classes/vertex-array-object.js +0 -261
- package/dist/classes/vertex-array-object.js.map +0 -1
- package/dist/classes/vertex-array.d.ts +0 -75
- package/dist/classes/vertex-array.d.ts.map +0 -1
- package/dist/classes/vertex-array.js +0 -408
- package/dist/classes/vertex-array.js.map +0 -1
- package/dist/classes/webgl-buffer.d.ts.map +0 -1
- package/dist/classes/webgl-buffer.js.map +0 -1
- package/dist/classes/webgl-resource.d.ts.map +0 -1
- package/dist/classes/webgl-resource.js.map +0 -1
- package/dist/context/context/get-canvas.d.ts +0 -13
- package/dist/context/context/get-canvas.d.ts.map +0 -1
- package/dist/context/context/get-canvas.js +0 -31
- package/dist/context/context/get-canvas.js.map +0 -1
- package/dist/context/context/resize-context.d.ts +0 -20
- package/dist/context/context/resize-context.d.ts.map +0 -1
- package/dist/context/context/resize-context.js +0 -15
- package/dist/context/context/resize-context.js.map +0 -1
- package/dist/context/parameters/webgl-parameters.d.ts +0 -144
- package/dist/context/parameters/webgl-parameters.d.ts.map +0 -1
- package/dist/context/parameters/webgl-parameters.js +0 -2
- package/dist/context/parameters/webgl-parameters.js.map +0 -1
- package/dist/debug/debug-program-configuration.d.ts +0 -2
- package/dist/debug/debug-program-configuration.d.ts.map +0 -1
- package/dist/debug/debug-program-configuration.js +0 -40
- package/dist/debug/debug-program-configuration.js.map +0 -1
- package/dist/debug/debug-uniforms.d.ts +0 -12
- package/dist/debug/debug-uniforms.d.ts.map +0 -1
- package/dist/debug/debug-uniforms.js +0 -108
- package/dist/debug/debug-uniforms.js.map +0 -1
- package/dist/debug/debug-vertex-array.d.ts +0 -5
- package/dist/debug/debug-vertex-array.d.ts.map +0 -1
- package/dist/debug/debug-vertex-array.js +0 -118
- package/dist/debug/debug-vertex-array.js.map +0 -1
- package/dist/es5/_deprecated/context-api.js +0 -116
- package/dist/es5/_deprecated/context-api.js.map +0 -1
- package/dist/es5/_deprecated/features.js +0 -118
- package/dist/es5/_deprecated/features.js.map +0 -1
- package/dist/es5/adapter/converters/set-device-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/webgpu-texture-formats.js +0 -296
- package/dist/es5/adapter/converters/webgpu-texture-formats.js.map +0 -1
- package/dist/es5/adapter/webgl-shader.js.map +0 -1
- package/dist/es5/classes/accessor.d.ts +0 -28
- package/dist/es5/classes/accessor.js.map +0 -1
- package/dist/es5/classes/accessor.ts.disabled +0 -159
- package/dist/es5/classes/clear.js +0 -135
- package/dist/es5/classes/clear.js.map +0 -1
- package/dist/es5/classes/copy-and-blit.js +0 -382
- package/dist/es5/classes/copy-and-blit.js.map +0 -1
- package/dist/es5/classes/framebuffer.js +0 -807
- package/dist/es5/classes/framebuffer.js.map +0 -1
- package/dist/es5/classes/program-configuration.js +0 -119
- package/dist/es5/classes/program-configuration.js.map +0 -1
- package/dist/es5/classes/program.js +0 -471
- package/dist/es5/classes/program.js.map +0 -1
- package/dist/es5/classes/query.js +0 -222
- package/dist/es5/classes/query.js.map +0 -1
- package/dist/es5/classes/renderbuffer-formats.js.map +0 -1
- package/dist/es5/classes/renderbuffer.js.map +0 -1
- package/dist/es5/classes/shader.js +0 -195
- package/dist/es5/classes/shader.js.map +0 -1
- package/dist/es5/classes/texture-2d.js.map +0 -1
- package/dist/es5/classes/texture-3d.js +0 -142
- package/dist/es5/classes/texture-3d.js.map +0 -1
- package/dist/es5/classes/texture-cube.js +0 -202
- package/dist/es5/classes/texture-cube.js.map +0 -1
- package/dist/es5/classes/texture-formats.js +0 -87
- package/dist/es5/classes/texture-formats.js.map +0 -1
- package/dist/es5/classes/texture.js.map +0 -1
- package/dist/es5/classes/transform-feedback.js +0 -267
- package/dist/es5/classes/transform-feedback.js.map +0 -1
- package/dist/es5/classes/uniform-buffer-layout.js +0 -130
- package/dist/es5/classes/uniform-buffer-layout.js.map +0 -1
- package/dist/es5/classes/uniforms.js +0 -232
- package/dist/es5/classes/uniforms.js.map +0 -1
- package/dist/es5/classes/vertex-array-object.js +0 -337
- package/dist/es5/classes/vertex-array-object.js.map +0 -1
- package/dist/es5/classes/vertex-array.js +0 -465
- package/dist/es5/classes/vertex-array.js.map +0 -1
- package/dist/es5/classes/webgl-buffer.js.map +0 -1
- package/dist/es5/classes/webgl-resource.js.map +0 -1
- package/dist/es5/context/context/get-canvas.js +0 -40
- package/dist/es5/context/context/get-canvas.js.map +0 -1
- package/dist/es5/context/context/resize-context.js +0 -23
- package/dist/es5/context/context/resize-context.js.map +0 -1
- package/dist/es5/context/parameters/webgl-parameters.js.map +0 -1
- package/dist/es5/debug/debug-program-configuration.js +0 -76
- package/dist/es5/debug/debug-program-configuration.js.map +0 -1
- package/dist/es5/debug/debug-uniforms.js +0 -156
- package/dist/es5/debug/debug-uniforms.js.map +0 -1
- package/dist/es5/debug/debug-vertex-array.js +0 -126
- package/dist/es5/debug/debug-vertex-array.js.map +0 -1
- package/dist/es5/helpers/get-program-bindings.js.map +0 -1
- package/dist/es5/helpers/program-bindings.js +0 -2
- package/dist/es5/types/accessor.d.ts +0 -29
- package/dist/es5/webgl-utils/attribute-utils.js +0 -186
- package/dist/es5/webgl-utils/attribute-utils.js.map +0 -1
- package/dist/es5/webgl-utils/constants-to-keys.js.map +0 -1
- package/dist/es5/webgl-utils/format-utils.js +0 -58
- package/dist/es5/webgl-utils/format-utils.js.map +0 -1
- package/dist/es5/webgl-utils/get-error.js +0 -49
- package/dist/es5/webgl-utils/get-error.js.map +0 -1
- package/dist/es5/webgl-utils/index.js +0 -74
- package/dist/es5/webgl-utils/index.js.map +0 -1
- package/dist/es5/webgl-utils/parse-shader-compiler-log.js.map +0 -1
- package/dist/es5/webgl-utils/request-animation-frame.js +0 -16
- package/dist/es5/webgl-utils/request-animation-frame.js.map +0 -1
- package/dist/es5/webgl-utils/texture-utils.js +0 -61
- package/dist/es5/webgl-utils/texture-utils.js.map +0 -1
- package/dist/es5/webgl-utils/typed-array-utils.js.map +0 -1
- package/dist/esm/_deprecated/context-api.js +0 -76
- package/dist/esm/_deprecated/context-api.js.map +0 -1
- package/dist/esm/_deprecated/features.js +0 -111
- package/dist/esm/_deprecated/features.js.map +0 -1
- package/dist/esm/adapter/converters/set-device-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/webgpu-texture-formats.js +0 -285
- package/dist/esm/adapter/converters/webgpu-texture-formats.js.map +0 -1
- package/dist/esm/adapter/webgl-shader.js.map +0 -1
- package/dist/esm/classes/accessor.d.ts +0 -28
- package/dist/esm/classes/accessor.js.map +0 -1
- package/dist/esm/classes/clear.js +0 -105
- package/dist/esm/classes/clear.js.map +0 -1
- package/dist/esm/classes/copy-and-blit.js +0 -338
- package/dist/esm/classes/copy-and-blit.js.map +0 -1
- package/dist/esm/classes/framebuffer.js +0 -656
- package/dist/esm/classes/framebuffer.js.map +0 -1
- package/dist/esm/classes/program-configuration.js +0 -73
- package/dist/esm/classes/program-configuration.js.map +0 -1
- package/dist/esm/classes/program.js +0 -379
- package/dist/esm/classes/program.js.map +0 -1
- package/dist/esm/classes/query.js +0 -145
- package/dist/esm/classes/query.js.map +0 -1
- package/dist/esm/classes/renderbuffer-formats.js.map +0 -1
- package/dist/esm/classes/renderbuffer.js.map +0 -1
- package/dist/esm/classes/shader.js +0 -118
- package/dist/esm/classes/shader.js.map +0 -1
- package/dist/esm/classes/texture-2d.js +0 -36
- package/dist/esm/classes/texture-2d.js.map +0 -1
- package/dist/esm/classes/texture-3d.js +0 -76
- package/dist/esm/classes/texture-3d.js.map +0 -1
- package/dist/esm/classes/texture-cube.js +0 -130
- package/dist/esm/classes/texture-cube.js.map +0 -1
- package/dist/esm/classes/texture-formats.js +0 -98
- package/dist/esm/classes/texture-formats.js.map +0 -1
- package/dist/esm/classes/texture.js.map +0 -1
- package/dist/esm/classes/transform-feedback.js +0 -198
- package/dist/esm/classes/transform-feedback.js.map +0 -1
- package/dist/esm/classes/uniform-buffer-layout.js +0 -104
- package/dist/esm/classes/uniform-buffer-layout.js.map +0 -1
- package/dist/esm/classes/uniforms.js +0 -250
- package/dist/esm/classes/uniforms.js.map +0 -1
- package/dist/esm/classes/vertex-array-object.js +0 -261
- package/dist/esm/classes/vertex-array-object.js.map +0 -1
- package/dist/esm/classes/vertex-array.js +0 -408
- package/dist/esm/classes/vertex-array.js.map +0 -1
- package/dist/esm/classes/webgl-buffer.js.map +0 -1
- package/dist/esm/classes/webgl-resource.js.map +0 -1
- package/dist/esm/context/context/get-canvas.js +0 -31
- package/dist/esm/context/context/get-canvas.js.map +0 -1
- package/dist/esm/context/context/resize-context.js +0 -15
- package/dist/esm/context/context/resize-context.js.map +0 -1
- package/dist/esm/context/parameters/webgl-parameters.js +0 -2
- package/dist/esm/context/parameters/webgl-parameters.js.map +0 -1
- package/dist/esm/debug/debug-program-configuration.js +0 -40
- package/dist/esm/debug/debug-program-configuration.js.map +0 -1
- package/dist/esm/debug/debug-uniforms.js +0 -108
- package/dist/esm/debug/debug-uniforms.js.map +0 -1
- package/dist/esm/debug/debug-vertex-array.js +0 -118
- package/dist/esm/debug/debug-vertex-array.js.map +0 -1
- package/dist/esm/helpers/get-program-bindings.js +0 -228
- package/dist/esm/helpers/get-program-bindings.js.map +0 -1
- package/dist/esm/helpers/program-bindings.js +0 -2
- package/dist/esm/types/accessor.d.ts +0 -29
- package/dist/esm/webgl-utils/attribute-utils.js +0 -182
- package/dist/esm/webgl-utils/attribute-utils.js.map +0 -1
- package/dist/esm/webgl-utils/constants-to-keys.js.map +0 -1
- package/dist/esm/webgl-utils/format-utils.js +0 -45
- package/dist/esm/webgl-utils/format-utils.js.map +0 -1
- package/dist/esm/webgl-utils/get-error.js +0 -41
- package/dist/esm/webgl-utils/get-error.js.map +0 -1
- package/dist/esm/webgl-utils/index.js +0 -5
- package/dist/esm/webgl-utils/index.js.map +0 -1
- package/dist/esm/webgl-utils/parse-shader-compiler-log.js.map +0 -1
- package/dist/esm/webgl-utils/request-animation-frame.js +0 -7
- package/dist/esm/webgl-utils/request-animation-frame.js.map +0 -1
- package/dist/esm/webgl-utils/texture-utils.js +0 -48
- package/dist/esm/webgl-utils/texture-utils.js.map +0 -1
- package/dist/esm/webgl-utils/typed-array-utils.js.map +0 -1
- package/dist/helpers/get-program-bindings.d.ts +0 -8
- package/dist/helpers/get-program-bindings.d.ts.map +0 -1
- package/dist/helpers/get-program-bindings.js +0 -228
- package/dist/helpers/get-program-bindings.js.map +0 -1
- package/dist/helpers/program-bindings.d.ts +0 -41
- package/dist/helpers/program-bindings.d.ts.map +0 -1
- package/dist/helpers/program-bindings.js +0 -2
- package/dist/types/accessor.d.ts +0 -29
- package/dist/webgl-utils/attribute-utils.d.ts +0 -18
- package/dist/webgl-utils/attribute-utils.d.ts.map +0 -1
- package/dist/webgl-utils/attribute-utils.js +0 -182
- package/dist/webgl-utils/attribute-utils.js.map +0 -1
- package/dist/webgl-utils/constants-to-keys.d.ts +0 -4
- package/dist/webgl-utils/constants-to-keys.d.ts.map +0 -1
- package/dist/webgl-utils/constants-to-keys.js.map +0 -1
- package/dist/webgl-utils/format-utils.d.ts +0 -3
- package/dist/webgl-utils/format-utils.d.ts.map +0 -1
- package/dist/webgl-utils/format-utils.js +0 -45
- package/dist/webgl-utils/format-utils.js.map +0 -1
- package/dist/webgl-utils/get-error.d.ts +0 -3
- package/dist/webgl-utils/get-error.d.ts.map +0 -1
- package/dist/webgl-utils/get-error.js +0 -41
- package/dist/webgl-utils/get-error.js.map +0 -1
- package/dist/webgl-utils/index.d.ts +0 -5
- package/dist/webgl-utils/index.d.ts.map +0 -1
- package/dist/webgl-utils/index.js +0 -5
- package/dist/webgl-utils/index.js.map +0 -1
- package/dist/webgl-utils/parse-shader-compiler-log.d.ts.map +0 -1
- package/dist/webgl-utils/parse-shader-compiler-log.js.map +0 -1
- package/dist/webgl-utils/request-animation-frame.d.ts +0 -4
- package/dist/webgl-utils/request-animation-frame.d.ts.map +0 -1
- package/dist/webgl-utils/request-animation-frame.js +0 -7
- package/dist/webgl-utils/request-animation-frame.js.map +0 -1
- package/dist/webgl-utils/texture-utils.d.ts +0 -15
- package/dist/webgl-utils/texture-utils.d.ts.map +0 -1
- package/dist/webgl-utils/texture-utils.js +0 -48
- package/dist/webgl-utils/texture-utils.js.map +0 -1
- package/dist/webgl-utils/typed-array-utils.d.ts.map +0 -1
- package/dist/webgl-utils/typed-array-utils.js.map +0 -1
- package/src/.DS_Store +0 -0
- package/src/_deprecated/context-api.ts +0 -146
- package/src/_deprecated/features.ts +0 -159
- package/src/adapter/converters/webgpu-texture-formats.ts +0 -167
- package/src/classes/accessor.d.ts +0 -28
- package/src/classes/accessor.js +0 -129
- package/src/classes/accessor.ts.disabled +0 -159
- package/src/classes/clear.ts +0 -108
- package/src/classes/copy-and-blit.ts +0 -460
- package/src/classes/framebuffer.ts +0 -763
- package/src/classes/program-configuration.ts +0 -77
- package/src/classes/program.ts +0 -431
- package/src/classes/query.ts +0 -171
- package/src/classes/renderbuffer.ts +0 -154
- package/src/classes/shader.ts +0 -129
- package/src/classes/texture-2d.ts +0 -35
- package/src/classes/texture-3d.ts +0 -123
- package/src/classes/texture-cube.ts +0 -162
- package/src/classes/texture-formats.ts +0 -171
- package/src/classes/texture.ts +0 -965
- package/src/classes/transform-feedback.ts +0 -191
- package/src/classes/uniform-buffer-layout.ts +0 -113
- package/src/classes/uniforms.ts +0 -394
- package/src/classes/vertex-array-object.ts +0 -339
- package/src/classes/vertex-array.ts +0 -484
- package/src/context/context/get-canvas.ts +0 -37
- package/src/context/context/resize-context.ts +0 -37
- package/src/context/parameters/webgl-parameters.ts +0 -197
- package/src/debug/debug-program-configuration.ts +0 -32
- package/src/debug/debug-uniforms.ts +0 -100
- package/src/debug/debug-vertex-array.ts +0 -123
- package/src/helpers/get-program-bindings.ts +0 -244
- package/src/helpers/program-bindings.ts +0 -46
- package/src/types/accessor.d.ts +0 -29
- package/src/webgl-utils/attribute-utils.ts +0 -171
- package/src/webgl-utils/format-utils.ts +0 -43
- package/src/webgl-utils/get-error.ts +0 -56
- package/src/webgl-utils/index.ts +0 -12
- package/src/webgl-utils/request-animation-frame.ts +0 -14
- package/src/webgl-utils/texture-utils.ts +0 -60
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { log, loadScript } from '@luma.gl/api';
|
|
2
|
+
const DEFAULT_SPECTOR_PROPS = {
|
|
3
|
+
spector: log.get('spector') || log.get('inspect')
|
|
4
|
+
};
|
|
5
|
+
const SPECTOR_CDN_URL = 'https://spectorcdn.babylonjs.com/spector.bundle.js';
|
|
6
|
+
const LOG_LEVEL = 1;
|
|
7
|
+
let spector = null;
|
|
8
|
+
let initialized = false;
|
|
9
|
+
export async function loadSpectorJS(props) {
|
|
10
|
+
if (!globalThis.SPECTOR) {
|
|
11
|
+
try {
|
|
12
|
+
await loadScript(SPECTOR_CDN_URL);
|
|
13
|
+
} catch (error) {
|
|
14
|
+
log.warn(error);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function initializeSpectorJS(props) {
|
|
19
|
+
var _props, _props2;
|
|
20
|
+
|
|
21
|
+
props = { ...DEFAULT_SPECTOR_PROPS,
|
|
22
|
+
...props
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
if (!((_props = props) !== null && _props !== void 0 && _props.spector)) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!spector && globalThis.SPECTOR) {
|
|
30
|
+
log.probe(LOG_LEVEL, "SPECTOR found and initialized")();
|
|
31
|
+
spector = new globalThis.SPECTOR.Spector();
|
|
32
|
+
|
|
33
|
+
if (globalThis.luma) {
|
|
34
|
+
globalThis.luma.spector = spector;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!spector) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!initialized) {
|
|
43
|
+
var _spector, _spector2;
|
|
44
|
+
|
|
45
|
+
initialized = true;
|
|
46
|
+
spector.spyCanvases();
|
|
47
|
+
(_spector = spector) === null || _spector === void 0 ? void 0 : _spector.onCaptureStarted.add(capture => log.info("Spector capture started:", capture)());
|
|
48
|
+
(_spector2 = spector) === null || _spector2 === void 0 ? void 0 : _spector2.onCapture.add(capture => {
|
|
49
|
+
var _spector3, _spector4, _spector5;
|
|
50
|
+
|
|
51
|
+
log.info("Spector capture complete:", capture)();
|
|
52
|
+
(_spector3 = spector) === null || _spector3 === void 0 ? void 0 : _spector3.getResultUI();
|
|
53
|
+
(_spector4 = spector) === null || _spector4 === void 0 ? void 0 : _spector4.resultView.display();
|
|
54
|
+
(_spector5 = spector) === null || _spector5 === void 0 ? void 0 : _spector5.resultView.addCapture(capture);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if ((_props2 = props) !== null && _props2 !== void 0 && _props2.canvas) {
|
|
59
|
+
var _spector6, _props3;
|
|
60
|
+
|
|
61
|
+
if (typeof props.spector === 'string' && props.spector !== props.canvas.id) {
|
|
62
|
+
return spector;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
(_spector6 = spector) === null || _spector6 === void 0 ? void 0 : _spector6.startCapture((_props3 = props) === null || _props3 === void 0 ? void 0 : _props3.canvas, 500);
|
|
66
|
+
new Promise(resolve => setTimeout(resolve, 2000)).then(_ => {
|
|
67
|
+
var _spector7;
|
|
68
|
+
|
|
69
|
+
log.info("Spector capture stopped after 2 seconds")();
|
|
70
|
+
(_spector7 = spector) === null || _spector7 === void 0 ? void 0 : _spector7.stopCapture();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return spector;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=spector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/debug/spector.ts"],"names":["log","loadScript","DEFAULT_SPECTOR_PROPS","spector","get","SPECTOR_CDN_URL","LOG_LEVEL","initialized","loadSpectorJS","props","globalThis","SPECTOR","error","warn","initializeSpectorJS","probe","Spector","luma","spyCanvases","onCaptureStarted","add","capture","info","onCapture","getResultUI","resultView","display","addCapture","canvas","id","startCapture","Promise","resolve","setTimeout","then","_","stopCapture"],"mappings":"AACA,SAAQA,GAAR,EAAaC,UAAb,QAA8B,cAA9B;AAYA,MAAMC,qBAAmC,GAAG;AAC1CC,EAAAA,OAAO,EAAEH,GAAG,CAACI,GAAJ,CAAQ,SAAR,KAAsBJ,GAAG,CAACI,GAAJ,CAAQ,SAAR;AADW,CAA5C;AAKA,MAAMC,eAAe,GAAG,oDAAxB;AACA,MAAMC,SAAS,GAAG,CAAlB;AAEA,IAAIH,OAAY,GAAG,IAAnB;AACA,IAAII,WAAoB,GAAG,KAA3B;AAOA,OAAO,eAAeC,aAAf,CAA6BC,KAA7B,EAAmD;AACxD,MAAI,CAACC,UAAU,CAACC,OAAhB,EAAyB;AACvB,QAAI;AACF,YAAMV,UAAU,CAACI,eAAD,CAAhB;AACD,KAFD,CAEE,OAAMO,KAAN,EAAa;AACbZ,MAAAA,GAAG,CAACa,IAAJ,CAASD,KAAT;AACD;AACF;AACF;AAED,OAAO,SAASE,mBAAT,CAA6BL,KAA7B,EAAmD;AAAA;;AACxDA,EAAAA,KAAK,GAAG,EAAC,GAAGP,qBAAJ;AAA2B,OAAGO;AAA9B,GAAR;;AACA,MAAI,YAACA,KAAD,mCAAC,OAAON,OAAR,CAAJ,EAAqB;AACnB,WAAO,IAAP;AACD;;AAED,MAAI,CAACA,OAAD,IAAYO,UAAU,CAACC,OAA3B,EAAoC;AAClCX,IAAAA,GAAG,CAACe,KAAJ,CAAUT,SAAV,EAAqB,+BAArB;AACAH,IAAAA,OAAO,GAAG,IAAIO,UAAU,CAACC,OAAX,CAAmBK,OAAvB,EAAV;;AACA,QAAIN,UAAU,CAACO,IAAf,EAAqB;AACnBP,MAAAA,UAAU,CAACO,IAAX,CAAgBd,OAAhB,GAA0BA,OAA1B;AACD;AACF;;AAED,MAAI,CAACA,OAAL,EAAc;AACZ,WAAO,IAAP;AACD;;AAED,MAAI,CAACI,WAAL,EAAkB;AAAA;;AAChBA,IAAAA,WAAW,GAAG,IAAd;AAGAJ,IAAAA,OAAO,CAACe,WAAR;AAEA,gBAAAf,OAAO,UAAP,4CAASgB,gBAAT,CAA0BC,GAA1B,CAA+BC,OAAD,IAAsBrB,GAAG,CAACsB,IAAJ,6BAAqCD,OAArC,GAApD;AACA,iBAAAlB,OAAO,UAAP,8CAASoB,SAAT,CAAmBH,GAAnB,CAAwBC,OAAD,IAAsB;AAAA;;AAC3CrB,MAAAA,GAAG,CAACsB,IAAJ,8BAAsCD,OAAtC;AAGA,mBAAAlB,OAAO,UAAP,8CAASqB,WAAT;AACA,mBAAArB,OAAO,UAAP,8CAASsB,UAAT,CAAoBC,OAApB;AACA,mBAAAvB,OAAO,UAAP,8CAASsB,UAAT,CAAoBE,UAApB,CAA+BN,OAA/B;AACD,KAPD;AAQD;;AAED,iBAAIZ,KAAJ,oCAAI,QAAOmB,MAAX,EAAmB;AAAA;;AAEjB,QAAI,OAAOnB,KAAK,CAACN,OAAb,KAAyB,QAAzB,IAAqCM,KAAK,CAACN,OAAN,KAAkBM,KAAK,CAACmB,MAAN,CAAaC,EAAxE,EAA4E;AAC1E,aAAO1B,OAAP;AACD;;AAID,iBAAAA,OAAO,UAAP,8CAAS2B,YAAT,YAAsBrB,KAAtB,4CAAsB,QAAOmB,MAA7B,EAAqC,GAArC;AACA,QAAIG,OAAJ,CAAYC,OAAO,IAAIC,UAAU,CAACD,OAAD,EAAU,IAAV,CAAjC,EAAkDE,IAAlD,CAAuDC,CAAC,IAAI;AAAA;;AAC1DnC,MAAAA,GAAG,CAACsB,IAAJ;AACA,mBAAAnB,OAAO,UAAP,8CAASiC,WAAT;AAED,KAJD;AAKD;;AAED,SAAOjC,OAAP;AACD","sourcesContent":["// luma.gl, MIT license\nimport {log, loadScript} from '@luma.gl/api';\n\n/** Spector debug initialization options */\ntype SpectorProps = {\n /** Canvas to monitor */\n canvas?: HTMLCanvasElement | OffscreenCanvas;\n /** Whether debug is enabled. Auto-detected if ommitted */\n debug?: boolean;\n /** Whether spector is disabled */\n spector?: boolean | string | object;\n};\n\nconst DEFAULT_SPECTOR_PROPS: SpectorProps = {\n spector: log.get('spector') || log.get('inspect')\n};\n\n// https://github.com/BabylonJS/Spector.js#basic-usage\nconst SPECTOR_CDN_URL = 'https://spectorcdn.babylonjs.com/spector.bundle.js';\nconst LOG_LEVEL = 1;\n\nlet spector: any = null;\nlet initialized: boolean = false;\n\ndeclare global {\n var SPECTOR: any;\n}\n\n/** Loads spector from CDN if not already installed */\nexport async function loadSpectorJS(props?: SpectorProps) {\n if (!globalThis.SPECTOR) {\n try {\n await loadScript(SPECTOR_CDN_URL);\n } catch(error) {\n log.warn(error)\n }\n }\n}\n\nexport function initializeSpectorJS(props?: SpectorProps) {\n props = {...DEFAULT_SPECTOR_PROPS, ...props};\n if (!props?.spector) {\n return null;\n }\n\n if (!spector && globalThis.SPECTOR) {\n log.probe(LOG_LEVEL, \"SPECTOR found and initialized\")();\n spector = new globalThis.SPECTOR.Spector();\n if (globalThis.luma) {\n globalThis.luma.spector = spector;\n }\n }\n\n if (!spector) {\n return null;\n }\n\n if (!initialized) {\n initialized = true;\n\n // enables recording some extra information merged in the capture like texture memory sizes and formats\n spector.spyCanvases();\n // A callback when results are ready\n spector?.onCaptureStarted.add((capture: unknown) => log.info(`Spector capture started:`, capture)());\n spector?.onCapture.add((capture: unknown) => {\n log.info(`Spector capture complete:`, capture)();\n // Use undocumented Spector API to open the UI with our capture\n // See https://github.com/BabylonJS/Spector.js/blob/767ad1195a25b85a85c381f400eb50a979239eca/src/spector.ts#L124\n spector?.getResultUI()\n spector?.resultView.display();\n spector?.resultView.addCapture(capture)\n });\n }\n\n if (props?.canvas) {\n // @ts-expect-error If spector is specified as a canvas id, only monitor that canvas\n if (typeof props.spector === 'string' && props.spector !== props.canvas.id) {\n return spector;\n }\n\n // capture startup\n // spector?.captureCanvas(props?.canvas);\n spector?.startCapture(props?.canvas, 500); // 500 commands\n new Promise(resolve => setTimeout(resolve, 2000)).then(_ => {\n log.info(`Spector capture stopped after 2 seconds`)();\n spector?.stopCapture();\n // spector?.displayUI();\n });\n }\n\n return spector;\n}\n"],"file":"spector.js"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare type DebugContextProps = {
|
|
2
|
+
debug?: boolean;
|
|
3
|
+
throwOnError?: boolean;
|
|
4
|
+
break?: string[];
|
|
5
|
+
webgl2?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare global {
|
|
8
|
+
var WebGLDebugUtils: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Loads Khronos WebGLDeveloperTools from CDN if not already installed
|
|
12
|
+
* const WebGLDebugUtils = require('webgl-debug');
|
|
13
|
+
* @see https://github.com/KhronosGroup/WebGLDeveloperTools
|
|
14
|
+
* @see https://github.com/vorg/webgl-debug
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadWebGLDeveloperTools(): Promise<void>;
|
|
17
|
+
export declare function makeDebugContext(gl: WebGLRenderingContext, props?: DebugContextProps): WebGLRenderingContext;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=webgl-developer-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgl-developer-tools.d.ts","sourceRoot":"","sources":["../../../src/context/debug/webgl-developer-tools.ts"],"names":[],"mappings":"AAMA,aAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAeF,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,eAAe,EAAE,GAAG,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ7D;AAID,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,EAAE,KAAK,GAAE,iBAAsB,GAAG,qBAAqB,CAOhH"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { log, loadScript } from '@luma.gl/api/';
|
|
2
|
+
import GL from '@luma.gl/constants';
|
|
3
|
+
const WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';
|
|
4
|
+
const DEFAULT_DEBUG_CONTEXT_PROPS = {
|
|
5
|
+
debug: true,
|
|
6
|
+
throwOnError: false,
|
|
7
|
+
break: undefined,
|
|
8
|
+
webgl2: false
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function getContextData(gl) {
|
|
12
|
+
gl.luma = gl.luma || {};
|
|
13
|
+
return gl.luma;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function loadWebGLDeveloperTools() {
|
|
17
|
+
if (!globalThis.WebGLDebugUtils) {
|
|
18
|
+
globalThis.global = globalThis.global || globalThis;
|
|
19
|
+
globalThis.global.module = {};
|
|
20
|
+
await loadScript(WEBGL_DEBUG_CDN_URL);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function makeDebugContext(gl, props = {}) {
|
|
24
|
+
if (!gl) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return props.debug ? getDebugContext(gl, props) : getRealContext(gl);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getRealContext(gl) {
|
|
32
|
+
const data = getContextData(gl);
|
|
33
|
+
return data.realContext ? data.realContext : gl;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getDebugContext(gl, props) {
|
|
37
|
+
if (!globalThis.WebGLDebugUtils) {
|
|
38
|
+
log.warn('webgl-debug not loaded')();
|
|
39
|
+
return gl;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const data = getContextData(gl);
|
|
43
|
+
|
|
44
|
+
if (data.debugContext) {
|
|
45
|
+
return data.debugContext;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
globalThis.WebGLDebugUtils.init({ ...GL,
|
|
49
|
+
...gl
|
|
50
|
+
});
|
|
51
|
+
const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(gl, onGLError.bind(null, props), onValidateGLFunc.bind(null, props));
|
|
52
|
+
|
|
53
|
+
for (const key in GL) {
|
|
54
|
+
if (!(key in glDebug) && typeof GL[key] === 'number') {
|
|
55
|
+
glDebug[key] = GL[key];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
class WebGLDebugContext {}
|
|
60
|
+
|
|
61
|
+
Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));
|
|
62
|
+
Object.setPrototypeOf(WebGLDebugContext, glDebug);
|
|
63
|
+
const debugContext = Object.create(WebGLDebugContext);
|
|
64
|
+
data.realContext = gl;
|
|
65
|
+
data.debugContext = debugContext;
|
|
66
|
+
debugContext.debug = true;
|
|
67
|
+
return debugContext;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getFunctionString(functionName, functionArgs) {
|
|
71
|
+
functionArgs = Array.from(functionArgs).map(arg => arg === undefined ? 'undefined' : arg);
|
|
72
|
+
let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);
|
|
73
|
+
args = "".concat(args.slice(0, 100)).concat(args.length > 100 ? '...' : '');
|
|
74
|
+
return "gl.".concat(functionName, "(").concat(args, ")");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function onGLError(props, err, functionName, args) {
|
|
78
|
+
args = Array.from(args).map(arg => arg === undefined ? 'undefined' : arg);
|
|
79
|
+
const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);
|
|
80
|
+
const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);
|
|
81
|
+
const glName = props.webgl2 ? 'gl2' : 'gl1';
|
|
82
|
+
const message = "".concat(errorMessage, " in ").concat(glName, ".").concat(functionName, "(").concat(functionArgs, ")");
|
|
83
|
+
log.error(message)();
|
|
84
|
+
debugger;
|
|
85
|
+
|
|
86
|
+
if (props.throwOnError) {
|
|
87
|
+
throw new Error(message);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function onValidateGLFunc(props, functionName, functionArgs) {
|
|
92
|
+
let functionString;
|
|
93
|
+
|
|
94
|
+
if (log.level >= 1) {
|
|
95
|
+
functionString = getFunctionString(functionName, functionArgs);
|
|
96
|
+
log.log(1, functionString)();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (props.break) {
|
|
100
|
+
functionString = functionString || getFunctionString(functionName, functionArgs);
|
|
101
|
+
const isBreakpoint = props.break && props.break.every(breakOn => functionString.indexOf(breakOn) !== -1);
|
|
102
|
+
|
|
103
|
+
if (isBreakpoint) {
|
|
104
|
+
debugger;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
for (const arg of functionArgs) {
|
|
109
|
+
if (arg === undefined) {
|
|
110
|
+
functionString = functionString || getFunctionString(functionName, functionArgs);
|
|
111
|
+
|
|
112
|
+
if (props.throwOnError) {
|
|
113
|
+
throw new Error("Undefined argument: ".concat(functionString));
|
|
114
|
+
} else {
|
|
115
|
+
log.error("Undefined argument: ".concat(functionString))();
|
|
116
|
+
debugger;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=webgl-developer-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/debug/webgl-developer-tools.ts"],"names":["log","loadScript","GL","WEBGL_DEBUG_CDN_URL","DEFAULT_DEBUG_CONTEXT_PROPS","debug","throwOnError","break","undefined","webgl2","getContextData","gl","luma","loadWebGLDeveloperTools","globalThis","WebGLDebugUtils","global","module","makeDebugContext","props","getDebugContext","getRealContext","data","realContext","warn","debugContext","init","glDebug","onGLError","bind","onValidateGLFunc","key","WebGLDebugContext","Object","setPrototypeOf","getPrototypeOf","create","getFunctionString","functionName","functionArgs","Array","from","map","arg","args","glFunctionArgsToString","slice","length","err","errorMessage","glEnumToString","glName","message","error","Error","functionString","level","isBreakpoint","every","breakOn","indexOf"],"mappings":"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","sourcesContent":["// luma.gl, MIT license\nimport {log, loadScript} from '@luma.gl/api/';\nimport GL from '@luma.gl/constants';\n\nconst WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';\n\ntype DebugContextProps = {\n debug?: boolean;\n throwOnError?: boolean;\n break?: string[];\n webgl2?: boolean;\n};\n\nconst DEFAULT_DEBUG_CONTEXT_PROPS: Required<DebugContextProps> = {\n debug: true,\n throwOnError: false,\n break: undefined,\n webgl2: false,\n}\n\n// Helper to get shared context data\nfunction getContextData(gl: any) {\n gl.luma = gl.luma || {};\n return gl.luma;\n}\n\ndeclare global {\n var WebGLDebugUtils: any;\n}\n\n/**\n * Loads Khronos WebGLDeveloperTools from CDN if not already installed \n * const WebGLDebugUtils = require('webgl-debug');\n * @see https://github.com/KhronosGroup/WebGLDeveloperTools\n * @see https://github.com/vorg/webgl-debug\n */\nexport async function loadWebGLDeveloperTools(): Promise<void> {\n if (!globalThis.WebGLDebugUtils) {\n // @ts-expect-error Developer tools expects global to be set\n globalThis.global = globalThis.global || globalThis;\n // @ts-expect-error Developer tools expects global to be set\n globalThis.global.module = {};\n await loadScript(WEBGL_DEBUG_CDN_URL);\n }\n}\n\n// Returns (a potentially new) context with debug instrumentation turned off or on.\n// Note that this actually returns a new context\nexport function makeDebugContext(gl: WebGLRenderingContext, props: DebugContextProps = {}): WebGLRenderingContext {\n // Return null to ensure we don't try to create a context in this case (TODO what case is that?)\n if (!gl) {\n return null;\n }\n\n return props.debug ? getDebugContext(gl, props) : getRealContext(gl);\n}\n\n// Returns the real context from either of the real/debug contexts\nfunction getRealContext(gl: WebGLRenderingContext): WebGLRenderingContext {\n const data = getContextData(gl);\n // If the context has a realContext member, it is a debug context so return the realContext\n return data.realContext ? data.realContext : gl;\n}\n\n// Returns the debug context from either of the real/debug contexts\nfunction getDebugContext(gl: WebGLRenderingContext, props: DebugContextProps): WebGLRenderingContext {\n if (!globalThis.WebGLDebugUtils) {\n log.warn('webgl-debug not loaded')();\n return gl;\n }\n\n const data = getContextData(gl);\n\n // If this already has a debug context, return it.\n if (data.debugContext) {\n return data.debugContext;\n }\n\n // Create a new debug context\n globalThis.WebGLDebugUtils.init({...GL, ...gl});\n const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(\n gl,\n onGLError.bind(null, props),\n onValidateGLFunc.bind(null, props)\n );\n\n // Make sure we have all WebGL2 and extension constants (todo dynamic import to circumvent minification?)\n for (const key in GL) {\n if (!(key in glDebug) && typeof GL[key] === 'number') {\n glDebug[key] = GL[key];\n }\n }\n \n // Ensure we have a clean prototype on the instrumented object\n // Note: setPrototypeOf does come with perf warnings, but we already take a bigger perf reduction\n // by synchronizing the WebGL errors after each WebGL call.\n class WebGLDebugContext {}\n Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));\n Object.setPrototypeOf(WebGLDebugContext, glDebug);\n const debugContext = Object.create(WebGLDebugContext);\n // Store the debug context\n data.realContext = gl;\n data.debugContext = debugContext;\n debugContext.debug = true;\n\n // Return it\n return debugContext;\n}\n\n// DEBUG TRACING\n\nfunction getFunctionString(functionName: string, functionArgs): string {\n // Cover bug in webgl-debug-tools\n functionArgs = Array.from(functionArgs).map(arg => arg === undefined ? 'undefined' : arg);\n let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);\n args = `${args.slice(0, 100)}${args.length > 100 ? '...' : ''}`;\n return `gl.${functionName}(${args})`;\n}\n\nfunction onGLError(props: DebugContextProps, err, functionName: string, args: any[]): void {\n // Cover bug in webgl-debug-tools\n args = Array.from(args).map(arg => arg === undefined ? 'undefined' : arg);\n const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);\n const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);\n const glName = props.webgl2 ? 'gl2' : 'gl1';\n const message = `${errorMessage} in ${glName}.${functionName}(${functionArgs})`;\n log.error(message)();\n debugger; // eslint-disable-line\n if (props.throwOnError) {\n throw new Error(message);\n }\n}\n\n// Don't generate function string until it is needed\nfunction onValidateGLFunc(props: DebugContextProps, functionName: string, functionArgs: any[]): void {\n let functionString: string;\n if (log.level >= 1) {\n functionString = getFunctionString(functionName, functionArgs);\n log.log(1, functionString)();\n }\n\n if (props.break) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n const isBreakpoint =\n props.break && props.break.every((breakOn: string) => functionString.indexOf(breakOn) !== -1);\n if (isBreakpoint) {\n debugger; // eslint-disable-line\n }\n }\n\n for (const arg of functionArgs) {\n if (arg === undefined) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n if (props.throwOnError) {\n throw new Error(`Undefined argument: ${functionString}`);\n } else {\n log.error(`Undefined argument: ${functionString}`)();\n debugger; // eslint-disable-line\n }\n }\n }\n}\n"],"file":"webgl-developer-tools.js"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Device } from '@luma.gl/api';
|
|
2
|
+
import type { GLParameters } from '../../types/webgl';
|
|
2
3
|
export type { GLParameters };
|
|
3
4
|
/**
|
|
4
5
|
* Sets any GL parameter regardless of function (gl.blendMode, ...)
|
|
@@ -6,7 +7,7 @@ export type { GLParameters };
|
|
|
6
7
|
* @note requires a `cache` object to be set on the context (gl.state.cache)
|
|
7
8
|
* This object is used to fill in any missing values for composite setter functions
|
|
8
9
|
*/
|
|
9
|
-
export declare function setParameters(
|
|
10
|
+
export declare function setParameters(device: Device | WebGLRenderingContext, parameters: GLParameters): void;
|
|
10
11
|
/**
|
|
11
12
|
* Reads the entire WebGL state from a context
|
|
12
13
|
* @returns - a newly created map, with values keyed by GL parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-parameter-api.d.ts","sourceRoot":"","sources":["../../../src/context/parameters/unified-parameter-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unified-parameter-api.d.ts","sourceRoot":"","sources":["../../../src/context/parameters/unified-parameter-api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAWpD,YAAY,EAAC,YAAY,EAAC,CAAC;AAE3B;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,EAAE,UAAU,EAAE,YAAY,GAAG,IAAI,CAiDpG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC;AACrH,wBAAgB,aAAa,CAAC,EAAE,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAE,CAAC,MAAM,YAAY,CAAC,EAAE,GAAG,YAAY,CAAC;AAC5G,wBAAgB,aAAa,CAAC,EAAE,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,YAAY,GAAG,YAAY,CAAC;AAwBvG;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,qBAAqB,GAAG,IAAI,CAE/D"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { assert } from '@luma.gl/api';
|
|
2
1
|
import { GL_PARAMETER_DEFAULTS, GL_PARAMETER_SETTERS, GL_COMPOSITE_PARAMETER_SETTERS, GL_PARAMETER_GETTERS } from './webgl-parameter-tables';
|
|
3
|
-
import
|
|
4
|
-
export function setParameters(
|
|
5
|
-
|
|
2
|
+
import WebGLDevice from '../../adapter/webgl-device';
|
|
3
|
+
export function setParameters(device, parameters) {
|
|
4
|
+
const webglDevice = WebGLDevice.attach(device);
|
|
5
|
+
const gl = webglDevice.gl;
|
|
6
6
|
|
|
7
7
|
if (isObjectEmpty(parameters)) {
|
|
8
8
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/context/parameters/unified-parameter-api.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/context/parameters/unified-parameter-api.ts"],"names":["GL_PARAMETER_DEFAULTS","GL_PARAMETER_SETTERS","GL_COMPOSITE_PARAMETER_SETTERS","GL_PARAMETER_GETTERS","WebGLDevice","setParameters","device","parameters","webglDevice","attach","gl","isObjectEmpty","compositeSetters","key","glConstant","Number","setter","cache","state","compositeSetter","getParameters","getter","getParameter","parameterKeys","Array","isArray","Object","keys","resetParameters","object"],"mappings":"AAKA,SACEA,qBADF,EAEEC,oBAFF,EAGEC,8BAHF,EAIEC,oBAJF,QAKO,0BALP;AAQA,OAAOC,WAAP,MAAwB,4BAAxB;AAUA,OAAO,SAASC,aAAT,CAAuBC,MAAvB,EAA+DC,UAA/D,EAA+F;AACpG,QAAMC,WAAW,GAAGJ,WAAW,CAACK,MAAZ,CAAmBH,MAAnB,CAApB;AACA,QAAMI,EAAE,GAAGF,WAAW,CAACE,EAAvB;;AAEA,MAAIC,aAAa,CAACJ,UAAD,CAAjB,EAA+B;AAC7B;AACD;;AAED,QAAMK,gBAAgB,GAAG,EAAzB;;AAIA,OAAK,MAAMC,GAAX,IAAkBN,UAAlB,EAA8B;AAC5B,UAAMO,UAAU,GAAGC,MAAM,CAACF,GAAD,CAAzB;AACA,UAAMG,MAAM,GAAGf,oBAAoB,CAACY,GAAD,CAAnC;;AACA,QAAIG,MAAJ,EAAY;AAEV,UAAI,OAAOA,MAAP,KAAkB,QAAtB,EAAgC;AAC9BJ,QAAAA,gBAAgB,CAACI,MAAD,CAAhB,GAA2B,IAA3B;AACD,OAFD,MAEO;AAKLA,QAAAA,MAAM,CAACN,EAAD,EAAKH,UAAU,CAACM,GAAD,CAAf,EAAsBC,UAAtB,CAAN;AACD;AACF;AACF;;AAUD,QAAMG,KAAK,GAAGP,EAAE,CAACQ,KAAH,IAAYR,EAAE,CAACQ,KAAH,CAASD,KAAnC;;AACA,MAAIA,KAAJ,EAAW;AACT,SAAK,MAAMJ,GAAX,IAAkBD,gBAAlB,EAAoC;AAElC,YAAMO,eAAe,GAAGjB,8BAA8B,CAACW,GAAD,CAAtD;AAGAM,MAAAA,eAAe,CAACT,EAAD,EAAKH,UAAL,EAAiBU,KAAjB,CAAf;AACD;AACF;AAGF;AAiBD,OAAO,SAASG,aAAT,CAAuBV,EAAvB,EAA2BH,UAA3B,EAAuC;AAE5CA,EAAAA,UAAU,GAAGA,UAAU,IAAIP,qBAA3B;;AAGA,MAAI,OAAOO,UAAP,KAAsB,QAA1B,EAAoC;AAElC,UAAMM,GAAG,GAAGN,UAAZ;AACA,UAAMc,MAAM,GAAGlB,oBAAoB,CAACU,GAAD,CAAnC;AACA,WAAOQ,MAAM,GAAGA,MAAM,CAACX,EAAD,EAAKG,GAAL,CAAT,GAAqBH,EAAE,CAACY,YAAH,CAAgBT,GAAhB,CAAlC;AACD;;AAED,QAAMU,aAAa,GAAGC,KAAK,CAACC,OAAN,CAAclB,UAAd,IAA4BA,UAA5B,GAAyCmB,MAAM,CAACC,IAAP,CAAYpB,UAAZ,CAA/D;AAEA,QAAMW,KAAK,GAAG,EAAd;;AACA,OAAK,MAAML,GAAX,IAAkBU,aAAlB,EAAiC;AAC/B,UAAMF,MAAM,GAAGlB,oBAAoB,CAACU,GAAD,CAAnC;AACAK,IAAAA,KAAK,CAACL,GAAD,CAAL,GAAaQ,MAAM,GAAGA,MAAM,CAACX,EAAD,EAAKK,MAAM,CAACF,GAAD,CAAX,CAAT,GAA6BH,EAAE,CAACY,YAAH,CAAgBP,MAAM,CAACF,GAAD,CAAtB,CAAhD;AACD;;AACD,SAAOK,KAAP;AACD;AAQD,OAAO,SAASU,eAAT,CAAyBlB,EAAzB,EAA0D;AAC/DL,EAAAA,aAAa,CAACK,EAAD,EAAKV,qBAAL,CAAb;AACD;;AAKD,SAASW,aAAT,CAAuBkB,MAAvB,EAA+B;AAC7B,OAAK,MAAMhB,GAAX,IAAkBgB,MAAlB,EAA0B;AACxB,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["// Provides a unified API for getting and setting any WebGL parameter\n// Also knows default values of all parameters, enabling fast cache initialization\n// Provides base functionality for the state caching.\nimport {Device} from '@luma.gl/api';\nimport type {GLParameters} from '../../types/webgl';\nimport {\n GL_PARAMETER_DEFAULTS,\n GL_PARAMETER_SETTERS,\n GL_COMPOSITE_PARAMETER_SETTERS,\n GL_PARAMETER_GETTERS\n} from './webgl-parameter-tables';\n\nimport {isWebGL} from '../context/webgl-checks';\nimport WebGLDevice from '../../adapter/webgl-device';\n\nexport type {GLParameters};\n\n/**\n * Sets any GL parameter regardless of function (gl.blendMode, ...)\n *\n * @note requires a `cache` object to be set on the context (gl.state.cache)\n * This object is used to fill in any missing values for composite setter functions\n */\nexport function setParameters(device: Device | WebGLRenderingContext, parameters: GLParameters): void {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n return;\n }\n\n const compositeSetters = {};\n\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n\n for (const key in parameters) {\n const glConstant = Number(key);\n const setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n } else {\n // if (gl[glConstant] !== undefined) {\n // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...\n // TODO - deep equal on values? only call setter if value has changed?\n // NOTE - the setter will automatically update this.state\n setter(gl, parameters[key], glConstant);\n }\n }\n }\n\n // HANDLE COMPOSITE SETTERS\n\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n // @ts-expect-error\n const cache = gl.state && gl.state.cache;\n if (cache) {\n for (const key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, parameters, cache);\n }\n }\n\n // Add a log for the else case?\n}\n\n/**\n * Reads the entire WebGL state from a context\n * @returns - a newly created map, with values keyed by GL parameters\n *\n * @note Copies the state from a context (gl.getParameter should not be overriden)\n * Reads the entire WebGL state from a context\n *\n * @note This can generates a huge amount of synchronous driver roundtrips and should be\n * considered a very slow operation, to be used only if/when a context already manipulated\n * by external code needs to be synchronized for the first time\n */\nexport function getParameters(gl: WebGLRenderingContext, parameters?: Record<keyof GLParameters, any>): GLParameters;\nexport function getParameters(gl: WebGLRenderingContext, parameters?: (keyof GLParameters)[]): GLParameters;\nexport function getParameters(gl: WebGLRenderingContext, parameters: keyof GLParameters): GLParameters;\n\nexport function getParameters(gl, parameters) {\n // default to querying all parameters\n parameters = parameters || GL_PARAMETER_DEFAULTS;\n // support both arrays of parameters and objects (keys represent parameters)\n\n if (typeof parameters === 'number') {\n // single GL enum\n const key = parameters;\n const getter = GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n\n const state = {};\n for (const key of parameterKeys) {\n const getter = GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n return state;\n}\n\n/**\n * Reset all parameters to a (almost) pure context state\n * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,\n * NOT the canvas size dimensions, so they will have to be properly set after\n * calling this function.\n */\nexport function resetParameters(gl: WebGLRenderingContext): void {\n setParameters(gl, GL_PARAMETER_DEFAULTS);\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"file":"unified-parameter-api.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import GL from '@luma.gl/constants';
|
|
2
|
-
import { GLParameters } from '
|
|
2
|
+
import type { GLParameters } from '../../types/webgl';
|
|
3
3
|
export declare const GL_PARAMETER_DEFAULTS: GLParameters;
|
|
4
4
|
export declare const GL_PARAMETER_SETTERS: {
|
|
5
5
|
3042: (gl: any, value: any, key: any) => any;
|
|
@@ -116,42 +116,45 @@ export declare const GL_COMPOSITE_PARAMETER_SETTERS: {
|
|
|
116
116
|
stencilOpFront: (gl: any, values: any, cache: any) => any;
|
|
117
117
|
stencilOpBack: (gl: any, values: any, cache: any) => any;
|
|
118
118
|
};
|
|
119
|
+
declare type UpdateFunc = (params: Record<string, any>) => void;
|
|
119
120
|
export declare const GL_HOOKED_SETTERS: {
|
|
120
|
-
enable: (update:
|
|
121
|
-
disable: (update:
|
|
122
|
-
pixelStorei: (update:
|
|
123
|
-
hint: (update:
|
|
124
|
-
useProgram: (update:
|
|
125
|
-
bindRenderbuffer: (update:
|
|
126
|
-
bindTransformFeedback: (update:
|
|
127
|
-
bindVertexArray: (update:
|
|
128
|
-
bindFramebuffer: (update:
|
|
129
|
-
bindBuffer: (update:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
121
|
+
enable: (update: UpdateFunc, capability: any) => void;
|
|
122
|
+
disable: (update: UpdateFunc, capability: any) => void;
|
|
123
|
+
pixelStorei: (update: UpdateFunc, pname: any, value: any) => void;
|
|
124
|
+
hint: (update: UpdateFunc, pname: any, hint: any) => void;
|
|
125
|
+
useProgram: (update: UpdateFunc, value: any) => void;
|
|
126
|
+
bindRenderbuffer: (update: UpdateFunc, target: any, value: any) => void;
|
|
127
|
+
bindTransformFeedback: (update: UpdateFunc, target: any, value: any) => void;
|
|
128
|
+
bindVertexArray: (update: UpdateFunc, value: any) => void;
|
|
129
|
+
bindFramebuffer: (update: UpdateFunc, target: any, framebuffer: any) => void;
|
|
130
|
+
bindBuffer: (update: UpdateFunc, target: any, buffer: any) => void | {
|
|
131
|
+
valueChanged: boolean;
|
|
132
|
+
};
|
|
133
|
+
blendColor: (update: UpdateFunc, r: number, g: number, b: number, a: number) => void;
|
|
134
|
+
blendEquation: (update: UpdateFunc, mode: any) => void;
|
|
135
|
+
blendEquationSeparate: (update: UpdateFunc, modeRGB: any, modeAlpha: any) => void;
|
|
136
|
+
blendFunc: (update: UpdateFunc, src: any, dst: any) => void;
|
|
137
|
+
blendFuncSeparate: (update: UpdateFunc, srcRGB: any, dstRGB: any, srcAlpha: any, dstAlpha: any) => void;
|
|
138
|
+
clearColor: (update: UpdateFunc, r: number, g: number, b: number, a: number) => void;
|
|
139
|
+
clearDepth: (update: UpdateFunc, depth: number) => void;
|
|
140
|
+
clearStencil: (update: UpdateFunc, s: number) => void;
|
|
141
|
+
colorMask: (update: UpdateFunc, r: number, g: number, b: number, a: number) => void;
|
|
142
|
+
cullFace: (update: UpdateFunc, mode: any) => void;
|
|
143
|
+
depthFunc: (update: UpdateFunc, func: any) => void;
|
|
144
|
+
depthRange: (update: UpdateFunc, zNear: number, zFar: number) => void;
|
|
145
|
+
depthMask: (update: UpdateFunc, mask: number) => void;
|
|
146
|
+
frontFace: (update: UpdateFunc, face: any) => void;
|
|
147
|
+
lineWidth: (update: UpdateFunc, width: any) => void;
|
|
148
|
+
polygonOffset: (update: UpdateFunc, factor: any, units: any) => void;
|
|
149
|
+
sampleCoverage: (update: UpdateFunc, value: any, invert: any) => void;
|
|
150
|
+
scissor: (update: UpdateFunc, x: any, y: any, width: any, height: any) => void;
|
|
151
|
+
stencilMask: (update: UpdateFunc, mask: any) => void;
|
|
152
|
+
stencilMaskSeparate: (update: UpdateFunc, face: any, mask: any) => void;
|
|
153
|
+
stencilFunc: (update: UpdateFunc, func: any, ref: any, mask: any) => void;
|
|
154
|
+
stencilFuncSeparate: (update: UpdateFunc, face: any, func: any, ref: any, mask: any) => void;
|
|
155
|
+
stencilOp: (update: UpdateFunc, fail: any, zfail: any, zpass: any) => void;
|
|
156
|
+
stencilOpSeparate: (update: UpdateFunc, face: any, fail: any, zfail: any, zpass: any) => void;
|
|
157
|
+
viewport: (update: UpdateFunc, x: any, y: any, width: any, height: any) => void;
|
|
155
158
|
};
|
|
156
159
|
export declare const GL_PARAMETER_GETTERS: {
|
|
157
160
|
3042: (gl: any, key: any) => any;
|
|
@@ -166,4 +169,5 @@ export declare const GL_PARAMETER_GETTERS: {
|
|
|
166
169
|
35977: (gl: any, key: any) => any;
|
|
167
170
|
};
|
|
168
171
|
export declare const NON_CACHE_PARAMETERS: Set<GL>;
|
|
172
|
+
export {};
|
|
169
173
|
//# sourceMappingURL=webgl-parameter-tables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-parameter-tables.d.ts","sourceRoot":"","sources":["../../../src/context/parameters/webgl-parameter-tables.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"webgl-parameter-tables.d.ts","sourceRoot":"","sources":["../../../src/context/parameters/webgl-parameter-tables.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEpC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAKpD,eAAO,MAAM,qBAAqB,EAAE,YAiFnC,CAAC;AAuCF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKhC,CAAC;AAOF,eAAO,MAAM,8BAA8B;;;;;;;;;CAmD1C,CAAC;AAEF,aAAK,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;AAGxD,eAAO,MAAM,iBAAiB;qBAGX,UAAU;sBAIT,UAAU;0BAIN,UAAU;mBAIjB,UAAU;yBAMJ,UAAU;+BAGJ,UAAU;oCAGL,UAAU;8BAGhB,UAAU;8BAIV,UAAU;yBAef,UAAU;;;yBAgBV,UAAU,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;4BAKnD,UAAU;oCAMF,UAAU;wBAMtB,UAAU;gCAQF,UAAU;yBAQjB,UAAU,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;yBAKtD,UAAU,SAAS,MAAM;2BAKvB,UAAU,KAAK,MAAM;wBAKxB,UAAU,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;uBAKvD,UAAU;wBAKT,UAAU;yBAKT,UAAU,SAAS,MAAM,QAAQ,MAAM;wBAKxC,UAAU,QAAQ,MAAM;wBAKxB,UAAU;wBAKV,UAAU;4BAKN,UAAU;6BAMT,UAAU;sBAMjB,UAAU;0BAKN,UAAU;kCAMF,UAAU;0BAKlB,UAAU;kCAUF,UAAU;wBAOpB,UAAU;gCAUF,UAAU;uBAOnB,UAAU;CAI9B,CAAC;AAOF,eAAO,MAAM,oBAAoB;;;;;;;;;;;CAahC,CAAC;AAEF,eAAO,MAAM,oBAAoB,SAuC/B,CAAC"}
|