@luma.gl/webgl 9.0.0-alpha.3 → 9.0.0-alpha.30
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/LICENSE +2 -1
- package/dist/adapter/converters/device-parameters.d.ts +14 -4
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +28 -46
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.d.ts +5 -5
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +20 -56
- package/dist/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/adapter/converters/texture-formats.d.ts +31 -42
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +163 -178
- package/dist/adapter/converters/texture-formats.js.map +1 -1
- package/dist/adapter/converters/vertex-formats.d.ts +2 -2
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +3 -9
- package/dist/adapter/converters/vertex-formats.js.map +1 -1
- package/dist/adapter/device-helpers/device-features.d.ts +1 -1
- package/dist/adapter/device-helpers/device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +13 -20
- package/dist/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/adapter/device-helpers/device-limits.d.ts +3 -3
- package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +2 -5
- package/dist/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.d.ts +1 -1
- package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.js +9 -11
- package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/adapter/device-helpers/is-old-ie.js +2 -1
- package/dist/adapter/device-helpers/is-old-ie.js.map +1 -1
- package/dist/adapter/helpers/attribute-utils.d.ts +4 -4
- package/dist/adapter/helpers/attribute-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/attribute-utils.js +1 -18
- package/dist/adapter/helpers/attribute-utils.js.map +1 -1
- package/dist/adapter/helpers/get-shader-info.d.ts +9 -0
- package/dist/adapter/helpers/get-shader-info.d.ts.map +1 -0
- package/dist/adapter/helpers/get-shader-info.js +25 -0
- package/dist/adapter/helpers/get-shader-info.js.map +1 -0
- package/dist/adapter/helpers/get-shader-layout.d.ts +10 -7
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +101 -84
- package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js +0 -7
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts +2 -2
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +3 -33
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/uniforms.d.ts +9 -10
- package/dist/adapter/helpers/uniforms.d.ts.map +1 -1
- package/dist/adapter/helpers/uniforms.js +8 -18
- package/dist/adapter/helpers/uniforms.js.map +1 -1
- package/dist/adapter/objects/constants-to-keys.d.ts +1 -3
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
- package/dist/adapter/objects/constants-to-keys.js +1 -28
- package/dist/adapter/objects/constants-to-keys.js.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +15 -12
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +35 -41
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/adapter/objects/webgl-resource.d.ts +6 -9
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +19 -75
- package/dist/adapter/objects/webgl-resource.js.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts +38 -11
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.js +122 -32
- package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts +18 -10
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +43 -71
- package/dist/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.d.ts +15 -9
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +169 -41
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.d.ts +7 -6
- package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.js +8 -17
- package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
- package/dist/adapter/resources/webgl-external-texture.js.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts +21 -24
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +41 -149
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts +19 -4
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +88 -9
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +44 -11
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +90 -152
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-sampler.d.ts +6 -5
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +7 -15
- package/dist/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/adapter/resources/webgl-shader.d.ts +3 -4
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +9 -22
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +64 -44
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +98 -213
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/webgl-canvas-context.d.ts +6 -7
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +8 -20
- package/dist/adapter/webgl-canvas-context.js.map +1 -1
- package/dist/adapter/webgl-device.d.ts +64 -41
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +133 -113
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/classic/accessor.d.ts +3 -3
- package/dist/classic/accessor.d.ts.map +1 -1
- package/dist/classic/accessor.js +14 -38
- package/dist/classic/accessor.js.map +1 -1
- package/dist/classic/{buffer.d.ts → buffer-with-accessor.d.ts} +16 -28
- package/dist/classic/buffer-with-accessor.d.ts.map +1 -0
- package/dist/classic/{buffer.js → buffer-with-accessor.js} +54 -122
- package/dist/classic/buffer-with-accessor.js.map +1 -0
- package/dist/classic/clear.d.ts +22 -0
- package/dist/classic/clear.d.ts.map +1 -0
- package/dist/classic/clear.js +88 -0
- package/dist/classic/clear.js.map +1 -0
- package/dist/classic/copy-and-blit.d.ts +62 -0
- package/dist/classic/copy-and-blit.d.ts.map +1 -0
- package/dist/classic/copy-and-blit.js +202 -0
- package/dist/classic/copy-and-blit.js.map +1 -0
- package/dist/classic/format-utils.d.ts +3 -0
- package/dist/classic/format-utils.d.ts.map +1 -0
- package/dist/classic/format-utils.js +38 -0
- package/dist/classic/format-utils.js.map +1 -0
- package/dist/classic/typed-array-utils.d.ts +15 -17
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +1 -21
- package/dist/classic/typed-array-utils.js.map +1 -1
- package/dist/context/context/create-browser-context.d.ts +40 -0
- package/dist/context/context/create-browser-context.d.ts.map +1 -0
- package/dist/{esm/context/context/create-context.js → context/context/create-browser-context.js} +23 -19
- package/dist/context/context/create-browser-context.js.map +1 -0
- package/dist/context/context/create-headless-context.d.ts +9 -0
- package/dist/context/context/create-headless-context.d.ts.map +1 -0
- package/dist/context/context/create-headless-context.js +42 -0
- package/dist/context/context/create-headless-context.js.map +1 -0
- package/dist/context/context/webgl-checks.js +1 -4
- package/dist/context/context/webgl-checks.js.map +1 -1
- package/dist/context/debug/spector.d.ts +1 -2
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +8 -20
- package/dist/context/debug/spector.js.map +1 -1
- package/dist/context/debug/webgl-developer-tools.d.ts +2 -2
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +11 -34
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/parameters/unified-parameter-api.d.ts +8 -7
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +8 -18
- package/dist/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.d.ts +105 -106
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +18 -36
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/context/polyfill/context-data.d.ts +13 -0
- package/dist/context/polyfill/context-data.d.ts.map +1 -0
- package/dist/context/polyfill/context-data.js +12 -0
- package/dist/context/polyfill/context-data.js.map +1 -0
- package/dist/context/polyfill/get-parameter-polyfill.d.ts +1 -1
- package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +1 -1
- package/dist/context/polyfill/get-parameter-polyfill.js +4 -9
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/context/polyfill/polyfill-context.js +21 -29
- package/dist/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/context/polyfill/polyfill-table.d.ts +8 -8
- package/dist/context/polyfill/polyfill-table.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-table.js +10 -32
- package/dist/context/polyfill/polyfill-table.js.map +1 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +0 -70
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
- package/dist/context/state-tracker/deep-array-equal.js +0 -4
- 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 +16 -51
- package/dist/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/context/state-tracker/with-parameters.d.ts +2 -1
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +7 -9
- package/dist/context/state-tracker/with-parameters.js.map +1 -1
- package/dist/dist.dev.js +10158 -0
- package/dist/index.cjs +6604 -0
- package/dist/index.d.ts +25 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -26
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist.min.js +37 -0
- package/package.json +21 -9
- package/src/adapter/converters/device-parameters.ts +88 -35
- package/src/adapter/converters/sampler-parameters.ts +19 -9
- package/src/adapter/converters/texture-formats.ts +261 -178
- package/src/adapter/converters/vertex-formats.ts +3 -2
- package/src/adapter/device-helpers/device-features.ts +10 -3
- package/src/adapter/device-helpers/device-limits.ts +3 -3
- package/src/adapter/device-helpers/get-device-info.ts +14 -10
- package/src/adapter/helpers/attribute-utils.ts +4 -5
- package/src/adapter/helpers/get-shader-info.ts +40 -0
- package/src/adapter/helpers/get-shader-layout.ts +150 -68
- package/src/adapter/helpers/parse-shader-compiler-log.ts +2 -2
- package/src/adapter/helpers/set-uniform.ts +7 -6
- package/src/adapter/helpers/uniforms.ts +23 -13
- package/src/adapter/objects/constants-to-keys.ts +3 -25
- package/src/adapter/objects/webgl-renderbuffer.ts +40 -37
- package/src/adapter/objects/webgl-resource.ts +14 -23
- package/src/adapter/objects/webgl-vertex-array-object.ts +201 -37
- package/src/adapter/resources/webgl-buffer.ts +56 -58
- package/src/adapter/resources/webgl-command-buffer.ts +332 -25
- package/src/adapter/resources/webgl-command-encoder.ts +16 -11
- package/src/adapter/resources/webgl-external-texture.ts +2 -2
- package/src/adapter/resources/webgl-framebuffer.ts +88 -133
- package/src/adapter/resources/webgl-render-pass.ts +155 -4
- package/src/adapter/resources/webgl-render-pipeline.ts +161 -104
- package/src/adapter/resources/webgl-sampler.ts +13 -8
- package/src/adapter/resources/webgl-shader.ts +11 -10
- package/src/adapter/resources/webgl-texture.ts +113 -85
- package/src/adapter/webgl-canvas-context.ts +14 -14
- package/src/adapter/webgl-device.ts +192 -77
- package/src/classic/accessor.ts +4 -17
- package/src/classic/{buffer.ts → buffer-with-accessor.ts} +67 -75
- package/src/classic/clear.ts +110 -0
- package/src/classic/copy-and-blit.ts +308 -0
- package/src/classic/format-utils.ts +43 -0
- package/src/classic/typed-array-utils.ts +18 -27
- package/src/context/context/{create-context.ts → create-browser-context.ts} +48 -31
- package/src/context/context/create-headless-context.ts +48 -0
- package/src/context/context/webgl-checks.ts +1 -1
- package/src/context/debug/spector.ts +7 -6
- package/src/context/debug/webgl-developer-tools.ts +21 -15
- package/src/context/parameters/unified-parameter-api.ts +20 -14
- package/src/context/parameters/webgl-parameter-tables.ts +117 -98
- package/src/context/polyfill/context-data.ts +27 -0
- package/src/context/polyfill/get-parameter-polyfill.ts +8 -7
- package/src/context/polyfill/polyfill-context.ts +7 -9
- package/src/context/polyfill/polyfill-table.ts +18 -16
- package/src/context/polyfill/polyfill-vertex-array-object.ts +2 -0
- package/src/context/state-tracker/track-context-state.ts +14 -13
- package/src/context/state-tracker/with-parameters.ts +8 -2
- package/src/index.ts +42 -33
- package/dist/adapter/converters/renderbuffer-formats.d.ts +0 -16
- package/dist/adapter/converters/renderbuffer-formats.d.ts.map +0 -1
- package/dist/adapter/converters/renderbuffer-formats.js +0 -185
- package/dist/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/bundle.js.map +0 -1
- package/dist/classic/buffer.d.ts.map +0 -1
- package/dist/classic/buffer.js.map +0 -1
- package/dist/context/context/context-state.d.ts +0 -18
- package/dist/context/context/context-state.d.ts.map +0 -1
- package/dist/context/context/context-state.js +0 -26
- package/dist/context/context/context-state.js.map +0 -1
- package/dist/context/context/create-context.d.ts +0 -41
- package/dist/context/context/create-context.d.ts.map +0 -1
- package/dist/context/context/create-context.js +0 -49
- package/dist/context/context/create-context.js.map +0 -1
- package/dist/context/context/device-pixels.d.ts +0 -25
- package/dist/context/context/device-pixels.d.ts.map +0 -1
- package/dist/context/context/device-pixels.js +0 -98
- package/dist/context/context/device-pixels.js.map +0 -1
- package/dist/es5/adapter/converters/device-parameters.js +0 -170
- package/dist/es5/adapter/converters/device-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/renderbuffer-formats.js +0 -163
- package/dist/es5/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/es5/adapter/converters/sampler-parameters.js +0 -226
- package/dist/es5/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/texture-formats.js +0 -1031
- package/dist/es5/adapter/converters/texture-formats.js.map +0 -1
- package/dist/es5/adapter/converters/vertex-formats.js +0 -45
- package/dist/es5/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/es5/adapter/device-helpers/device-features.js +0 -144
- package/dist/es5/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/es5/adapter/device-helpers/device-limits.js +0 -64
- package/dist/es5/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/es5/adapter/device-helpers/get-device-info.js +0 -55
- package/dist/es5/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/es5/adapter/device-helpers/is-old-ie.js +0 -16
- package/dist/es5/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/es5/adapter/helpers/attribute-utils.js +0 -91
- package/dist/es5/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/es5/adapter/helpers/get-shader-layout.js +0 -371
- package/dist/es5/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js +0 -72
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/es5/adapter/helpers/set-uniform.js +0 -125
- package/dist/es5/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/es5/adapter/helpers/uniforms.js +0 -112
- package/dist/es5/adapter/helpers/uniforms.js.map +0 -1
- package/dist/es5/adapter/objects/constants-to-keys.js +0 -54
- package/dist/es5/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-renderbuffer.js +0 -150
- package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-resource.js +0 -292
- package/dist/es5/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js +0 -137
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-buffer.js +0 -243
- package/dist/es5/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-command-buffer.js +0 -96
- package/dist/es5/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-command-encoder.js +0 -98
- package/dist/es5/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-external-texture.js +0 -2
- package/dist/es5/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-framebuffer.js +0 -345
- package/dist/es5/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pass.js +0 -61
- package/dist/es5/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pipeline.js +0 -505
- package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-sampler.js +0 -96
- package/dist/es5/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-shader.js +0 -149
- package/dist/es5/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-texture.js +0 -986
- package/dist/es5/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/es5/adapter/webgl-canvas-context.js +0 -97
- package/dist/es5/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/es5/adapter/webgl-device.js +0 -399
- package/dist/es5/adapter/webgl-device.js.map +0 -1
- package/dist/es5/bundle.js +0 -7
- package/dist/es5/bundle.js.map +0 -1
- package/dist/es5/classic/accessor.js +0 -181
- package/dist/es5/classic/accessor.js.map +0 -1
- package/dist/es5/classic/buffer.js +0 -470
- package/dist/es5/classic/buffer.js.map +0 -1
- package/dist/es5/classic/typed-array-utils.js +0 -126
- package/dist/es5/classic/typed-array-utils.js.map +0 -1
- package/dist/es5/context/context/context-state.js +0 -31
- package/dist/es5/context/context/context-state.js.map +0 -1
- package/dist/es5/context/context/create-context.js +0 -69
- package/dist/es5/context/context/create-context.js.map +0 -1
- package/dist/es5/context/context/device-pixels.js +0 -115
- package/dist/es5/context/context/device-pixels.js.map +0 -1
- package/dist/es5/context/context/webgl-checks.js +0 -54
- package/dist/es5/context/context/webgl-checks.js.map +0 -1
- package/dist/es5/context/debug/spector.js +0 -133
- package/dist/es5/context/debug/spector.js.map +0 -1
- package/dist/es5/context/debug/webgl-developer-tools.js +0 -198
- package/dist/es5/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/es5/context/parameters/unified-parameter-api.js +0 -97
- package/dist/es5/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/es5/context/parameters/webgl-parameter-tables.js +0 -392
- package/dist/es5/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/es5/context/polyfill/get-parameter-polyfill.js +0 -81
- package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-context.js +0 -135
- package/dist/es5/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-table.js +0 -166
- package/dist/es5/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js +0 -341
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/es5/context/state-tracker/deep-array-equal.js +0 -28
- package/dist/es5/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/es5/context/state-tracker/track-context-state.js +0 -211
- package/dist/es5/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/es5/context/state-tracker/with-parameters.js +0 -44
- package/dist/es5/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/es5/index.js +0 -276
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/init.js +0 -10
- package/dist/es5/init.js.map +0 -1
- package/dist/es5/types/webgl.js +0 -6
- package/dist/es5/types/webgl.js.map +0 -1
- package/dist/es5/types.js +0 -2
- package/dist/es5/types.js.map +0 -1
- package/dist/esm/adapter/converters/device-parameters.js +0 -155
- package/dist/esm/adapter/converters/device-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/renderbuffer-formats.js +0 -185
- package/dist/esm/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/esm/adapter/converters/sampler-parameters.js +0 -208
- package/dist/esm/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/texture-formats.js +0 -954
- package/dist/esm/adapter/converters/texture-formats.js.map +0 -1
- package/dist/esm/adapter/converters/vertex-formats.js +0 -35
- package/dist/esm/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/esm/adapter/device-helpers/device-features.js +0 -102
- package/dist/esm/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/esm/adapter/device-helpers/device-limits.js +0 -91
- package/dist/esm/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/esm/adapter/device-helpers/get-device-info.js +0 -44
- package/dist/esm/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/esm/adapter/device-helpers/is-old-ie.js +0 -8
- package/dist/esm/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/esm/adapter/helpers/attribute-utils.js +0 -81
- package/dist/esm/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/esm/adapter/helpers/get-shader-layout.js +0 -306
- package/dist/esm/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js +0 -37
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/esm/adapter/helpers/set-uniform.js +0 -115
- package/dist/esm/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/esm/adapter/helpers/uniforms.js +0 -99
- package/dist/esm/adapter/helpers/uniforms.js.map +0 -1
- package/dist/esm/adapter/objects/constants-to-keys.js +0 -42
- package/dist/esm/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-renderbuffer.js +0 -94
- package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-resource.js +0 -216
- package/dist/esm/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js +0 -84
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-buffer.js +0 -164
- package/dist/esm/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-command-buffer.js +0 -65
- package/dist/esm/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-command-encoder.js +0 -53
- package/dist/esm/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-external-texture.js +0 -2
- package/dist/esm/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-framebuffer.js +0 -265
- package/dist/esm/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-render-pass.js +0 -19
- package/dist/esm/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-render-pipeline.js +0 -400
- package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-sampler.js +0 -50
- package/dist/esm/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-shader.js +0 -75
- package/dist/esm/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-texture.js +0 -831
- package/dist/esm/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/esm/adapter/webgl-canvas-context.js +0 -54
- package/dist/esm/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/esm/adapter/webgl-device.js +0 -280
- package/dist/esm/adapter/webgl-device.js.map +0 -1
- package/dist/esm/bundle.js +0 -5
- package/dist/esm/bundle.js.map +0 -1
- package/dist/esm/classic/accessor.js +0 -144
- package/dist/esm/classic/accessor.js.map +0 -1
- package/dist/esm/classic/buffer.js +0 -384
- package/dist/esm/classic/buffer.js.map +0 -1
- package/dist/esm/classic/typed-array-utils.js +0 -112
- package/dist/esm/classic/typed-array-utils.js.map +0 -1
- package/dist/esm/context/context/context-state.js +0 -26
- package/dist/esm/context/context/context-state.js.map +0 -1
- package/dist/esm/context/context/create-context.js.map +0 -1
- package/dist/esm/context/context/device-pixels.js +0 -98
- package/dist/esm/context/context/device-pixels.js.map +0 -1
- package/dist/esm/context/context/webgl-checks.js +0 -34
- package/dist/esm/context/context/webgl-checks.js.map +0 -1
- package/dist/esm/context/debug/spector.js +0 -76
- package/dist/esm/context/debug/spector.js.map +0 -1
- package/dist/esm/context/debug/webgl-developer-tools.js +0 -121
- package/dist/esm/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/esm/context/parameters/unified-parameter-api.js +0 -65
- package/dist/esm/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/esm/context/parameters/webgl-parameter-tables.js +0 -445
- package/dist/esm/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/esm/context/polyfill/get-parameter-polyfill.js +0 -91
- package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-context.js +0 -92
- package/dist/esm/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-table.js +0 -160
- package/dist/esm/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js +0 -335
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/esm/context/state-tracker/deep-array-equal.js +0 -21
- package/dist/esm/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/esm/context/state-tracker/track-context-state.js +0 -183
- package/dist/esm/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/esm/context/state-tracker/with-parameters.js +0 -36
- package/dist/esm/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/esm/index.js +0 -27
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/init.js +0 -4
- package/dist/esm/init.js.map +0 -1
- package/dist/esm/types/webgl.js +0 -2
- package/dist/esm/types/webgl.js.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
- package/dist/init.d.ts +0 -2
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -4
- package/dist/init.js.map +0 -1
- package/dist/types/webgl.d.ts +0 -144
- package/dist/types/webgl.d.ts.map +0 -1
- package/dist/types/webgl.js +0 -2
- package/dist/types/webgl.js.map +0 -1
- package/src/adapter/converters/renderbuffer-formats.ts +0 -92
- package/src/bundle.ts +0 -4
- package/src/context/context/context-state.ts +0 -41
- package/src/context/context/device-pixels.ts +0 -152
- package/src/init.ts +0 -4
- package/src/types/webgl.ts +0 -283
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
// This is intended to be a stand-alone file with minimal dependencies,
|
|
8
8
|
// easy to reuse or repurpose in other projects.
|
|
9
9
|
|
|
10
|
-
import {assert} from '@luma.gl/
|
|
10
|
+
import {assert} from '@luma.gl/core';
|
|
11
11
|
import {polyfillVertexArrayObject} from './polyfill-vertex-array-object';
|
|
12
12
|
|
|
13
13
|
import {WEBGL2_CONTEXT_POLYFILLS, WEBGL2_CONTEXT_OVERRIDES} from './polyfill-table';
|
|
14
|
-
import {
|
|
14
|
+
import {getContextData} from './context-data';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Registers extensions, polyfills or mock functions for extensions in the polyfills list
|
|
18
18
|
*/
|
|
19
19
|
export function polyfillContext(gl: WebGLRenderingContext): WebGL2RenderingContext {
|
|
20
|
-
const contextState =
|
|
20
|
+
const contextState = getContextData(gl);
|
|
21
21
|
|
|
22
22
|
if (!contextState._polyfilled) {
|
|
23
23
|
polyfillVertexArrayObject(gl);
|
|
@@ -32,19 +32,17 @@ export function polyfillContext(gl: WebGLRenderingContext): WebGL2RenderingConte
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function initializeExtensions(gl: WebGLRenderingContext): void {
|
|
35
|
-
const contextState =
|
|
35
|
+
const contextState = getContextData(gl);
|
|
36
36
|
// `getSupportedExtensions` can return null when context is lost.
|
|
37
37
|
const EXTENSIONS = gl.getSupportedExtensions() || [];
|
|
38
38
|
for (const extensionName of EXTENSIONS) {
|
|
39
39
|
const extension = gl.getExtension(extensionName);
|
|
40
40
|
contextState._extensions[extensionName] = extension;
|
|
41
|
-
// TODO - this looks like a mistake?
|
|
42
|
-
contextState[extensionName] = extension;
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
function installPolyfills(gl: WebGLRenderingContext, polyfills): void {
|
|
47
|
-
const contextState =
|
|
45
|
+
const contextState = getContextData(gl);
|
|
48
46
|
for (const extension of Object.getOwnPropertyNames(polyfills)) {
|
|
49
47
|
if (extension !== 'overrides') {
|
|
50
48
|
polyfillExtension(gl, {extension, target: contextState, target2: gl});
|
|
@@ -65,7 +63,7 @@ function polyfillExtension(gl: WebGLRenderingContext, {extension, target, target
|
|
|
65
63
|
for (const key of Object.keys(defaults)) {
|
|
66
64
|
const extKey = `${key}${suffix}`;
|
|
67
65
|
|
|
68
|
-
let polyfill = null;
|
|
66
|
+
let polyfill: Function | null = null;
|
|
69
67
|
if (key === 'meta') {
|
|
70
68
|
// ignore
|
|
71
69
|
} else if (typeof gl[key] === 'function') {
|
|
@@ -86,7 +84,7 @@ function polyfillExtension(gl: WebGLRenderingContext, {extension, target, target
|
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
/** Install simple overrides (mostly get* functions) */
|
|
89
|
-
function installOverrides(gl, {target, target2}) {
|
|
87
|
+
function installOverrides(gl: WebGLRenderingContext, {target, target2}) {
|
|
90
88
|
Object.keys(WEBGL2_CONTEXT_OVERRIDES).forEach((key) => {
|
|
91
89
|
if (typeof WEBGL2_CONTEXT_OVERRIDES[key] === 'function') {
|
|
92
90
|
// install an override, if no implementation was detected
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {assert} from '@luma.gl/
|
|
2
|
-
import GL from '@luma.gl/constants';
|
|
1
|
+
import {assert} from '@luma.gl/core';
|
|
2
|
+
import {GL} from '@luma.gl/constants';
|
|
3
3
|
import {isWebGL2} from '../context/webgl-checks';
|
|
4
4
|
|
|
5
5
|
import {getParameterPolyfill} from './get-parameter-polyfill';
|
|
6
|
-
import {
|
|
6
|
+
import {getContextData} from './context-data';
|
|
7
7
|
|
|
8
|
+
/* eslint-disable camelcase */
|
|
8
9
|
const OES_vertex_array_object = 'OES_vertex_array_object';
|
|
9
10
|
const ANGLE_instanced_arrays = 'ANGLE_instanced_arrays';
|
|
10
11
|
const WEBGL_draw_buffers = 'WEBGL_draw_buffers';
|
|
@@ -14,14 +15,14 @@ const EXT_texture_filter_anisotropic = 'EXT_texture_filter_anisotropic';
|
|
|
14
15
|
const ERR_VAO_NOT_SUPPORTED = 'VertexArray requires WebGL2 or OES_vertex_array_object extension';
|
|
15
16
|
|
|
16
17
|
// Return object with webgl2 flag and an extension
|
|
17
|
-
function getExtensionData(gl, extension) {
|
|
18
|
+
function getExtensionData(gl: WebGLRenderingContext, extension: string) {
|
|
18
19
|
return {
|
|
19
20
|
webgl2: isWebGL2(gl),
|
|
20
21
|
ext: gl.getExtension(extension)
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
// function mapExtensionConstant(gl, constant) {
|
|
25
|
+
// function mapExtensionConstant(gl: WebGLRenderingContext, constant) {
|
|
25
26
|
// switch (constant) {
|
|
26
27
|
// case ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES: return GL.FRAGMENT_SHADER_DERIVATIVE_HINT;
|
|
27
28
|
// }
|
|
@@ -46,7 +47,7 @@ export const WEBGL2_CONTEXT_POLYFILLS = {
|
|
|
46
47
|
// VERTEX_ATTRIB_ARRAY_DIVISOR: 'VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE'
|
|
47
48
|
// }
|
|
48
49
|
},
|
|
49
|
-
vertexAttribDivisor(location, divisor) {
|
|
50
|
+
vertexAttribDivisor(location: number, divisor: number) {
|
|
50
51
|
// Accept divisor 0 even if instancing is not supported (0 = no instancing)
|
|
51
52
|
assert(divisor === 0, 'WebGL instanced rendering not supported');
|
|
52
53
|
},
|
|
@@ -74,20 +75,20 @@ export const WEBGL2_CONTEXT_POLYFILLS = {
|
|
|
74
75
|
assert(false);
|
|
75
76
|
},
|
|
76
77
|
endQuery: () => {},
|
|
77
|
-
getQuery(handle, pname) {
|
|
78
|
+
getQuery(handle, pname: string) {
|
|
78
79
|
return this.getQueryObject(handle, pname);
|
|
79
80
|
},
|
|
80
81
|
// The WebGL1 extension uses getQueryObject rather then getQueryParameter
|
|
81
|
-
getQueryParameter(handle, pname) {
|
|
82
|
+
getQueryParameter(handle, pname: string) {
|
|
82
83
|
return this.getQueryObject(handle, pname);
|
|
83
84
|
},
|
|
84
|
-
getQueryObject: () => {}
|
|
85
|
+
getQueryObject: (handle: unknown, pname: unknown) => {}
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
89
90
|
// Ensure readBuffer is a no-op
|
|
90
|
-
readBuffer: (gl, originalFunc, attachment) => {
|
|
91
|
+
readBuffer: (gl: WebGLRenderingContext, originalFunc, attachment) => {
|
|
91
92
|
if (isWebGL2(gl)) {
|
|
92
93
|
originalFunc(attachment);
|
|
93
94
|
} else {
|
|
@@ -95,7 +96,7 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
95
96
|
}
|
|
96
97
|
},
|
|
97
98
|
// Override for getVertexAttrib that returns sane values for non-WebGL1 constants
|
|
98
|
-
getVertexAttrib: (gl, originalFunc, location, pname) => {
|
|
99
|
+
getVertexAttrib: (gl: WebGLRenderingContext, originalFunc, location, pname) => {
|
|
99
100
|
// const gl = this; // eslint-disable-line
|
|
100
101
|
const {webgl2, ext} = getExtensionData(gl, ANGLE_instanced_arrays);
|
|
101
102
|
|
|
@@ -115,7 +116,7 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
115
116
|
return result !== undefined ? result : originalFunc(location, pname);
|
|
116
117
|
},
|
|
117
118
|
// Handle transform feedback and uniform block queries in WebGL1
|
|
118
|
-
getProgramParameter: (gl, originalFunc, program, pname) => {
|
|
119
|
+
getProgramParameter: (gl: WebGLRenderingContext, originalFunc, program, pname) => {
|
|
119
120
|
if (!isWebGL2(gl)) {
|
|
120
121
|
switch (pname) {
|
|
121
122
|
case GL.TRANSFORM_FEEDBACK_BUFFER_MODE:
|
|
@@ -129,7 +130,7 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
129
130
|
}
|
|
130
131
|
return originalFunc(program, pname);
|
|
131
132
|
},
|
|
132
|
-
getInternalformatParameter: (gl, originalFunc, target, format, pname) => {
|
|
133
|
+
getInternalformatParameter: (gl: WebGLRenderingContext, originalFunc, target, format, pname) => {
|
|
133
134
|
if (!isWebGL2(gl)) {
|
|
134
135
|
switch (pname) {
|
|
135
136
|
case GL.SAMPLES:
|
|
@@ -137,13 +138,14 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
137
138
|
default:
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
+
const gl2 = gl as WebGL2RenderingContext;
|
|
142
|
+
return gl2.getInternalformatParameter(target, format, pname);
|
|
141
143
|
},
|
|
142
144
|
getTexParameter(gl, originalFunc, target, pname) {
|
|
143
145
|
switch (pname) {
|
|
144
146
|
case GL.TEXTURE_MAX_ANISOTROPY_EXT:
|
|
145
|
-
const
|
|
146
|
-
const {_extensions} =
|
|
147
|
+
const contextData = getContextData(gl);
|
|
148
|
+
const {_extensions} = contextData;
|
|
147
149
|
const ext = _extensions[EXT_texture_filter_anisotropic];
|
|
148
150
|
pname = (ext && ext.TEXTURE_MAX_ANISOTROPY_EXT) || GL.TEXTURE_MAX_ANISOTROPY_EXT;
|
|
149
151
|
break;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
// the global class.
|
|
26
26
|
|
|
27
27
|
// @ts-nocheck external code
|
|
28
|
+
/* eslint-disable */
|
|
28
29
|
|
|
29
30
|
const glErrorShadow = {};
|
|
30
31
|
|
|
@@ -103,6 +104,7 @@ WebGLVertexArrayObjectOES.VertexAttrib.prototype.recache = function recache() {
|
|
|
103
104
|
};
|
|
104
105
|
|
|
105
106
|
const OESVertexArrayObject = function OESVertexArrayObject(gl) {
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
106
108
|
const self = this;
|
|
107
109
|
this.gl = gl;
|
|
108
110
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Support for listening to context state changes and intercepting state queries
|
|
2
2
|
// NOTE: this system does not handle buffer bindings
|
|
3
|
-
import {assert} from '@luma.gl/
|
|
3
|
+
import {assert} from '@luma.gl/core';
|
|
4
4
|
import {GL_PARAMETER_DEFAULTS, GL_HOOKED_SETTERS, NON_CACHE_PARAMETERS} from '../parameters/webgl-parameter-tables';
|
|
5
5
|
import {setParameters, getParameters} from '../parameters/unified-parameter-api';
|
|
6
6
|
import {deepArrayEqual} from './deep-array-equal';
|
|
@@ -10,14 +10,14 @@ import {deepArrayEqual} from './deep-array-equal';
|
|
|
10
10
|
/* eslint-disable no-shadow */
|
|
11
11
|
class GLState {
|
|
12
12
|
gl: WebGLRenderingContext;
|
|
13
|
-
program = null;
|
|
14
|
-
stateStack = [];
|
|
13
|
+
program: unknown = null;
|
|
14
|
+
stateStack: object[] = [];
|
|
15
15
|
enable = true;
|
|
16
|
-
cache
|
|
16
|
+
cache: Record<string, any>;
|
|
17
17
|
log;
|
|
18
18
|
|
|
19
19
|
constructor(
|
|
20
|
-
gl,
|
|
20
|
+
gl: WebGLRenderingContext,
|
|
21
21
|
{
|
|
22
22
|
copyState = false, // Copy cache from params (slow) or initialize from WebGL defaults (fast)
|
|
23
23
|
log = () => {} // Logging function, called when gl parameter change calls are actually issued
|
|
@@ -50,11 +50,11 @@ class GLState {
|
|
|
50
50
|
* @param values
|
|
51
51
|
* @returns
|
|
52
52
|
*/
|
|
53
|
-
_updateCache(values) {
|
|
53
|
+
_updateCache(values: {[key: number | string]: any}) {
|
|
54
54
|
let valueChanged = false;
|
|
55
55
|
let oldValue; // = undefined
|
|
56
56
|
|
|
57
|
-
const oldValues = this.stateStack.length > 0
|
|
57
|
+
const oldValues: {[key: number | string]: any} | null = this.stateStack.length > 0 ? this.stateStack[this.stateStack.length - 1] : null;
|
|
58
58
|
|
|
59
59
|
for (const key in values) {
|
|
60
60
|
assert(key !== undefined);
|
|
@@ -96,7 +96,7 @@ function getContextState(gl: WebGLRenderingContext): GLState {
|
|
|
96
96
|
* gl.state.push() and gl.state.pop() will be available for saving,
|
|
97
97
|
* temporarily modifying, and then restoring state.
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
export function trackContextState(
|
|
100
100
|
gl: WebGLRenderingContext,
|
|
101
101
|
options?: {
|
|
102
102
|
enable?: boolean;
|
|
@@ -108,7 +108,6 @@ function getContextState(gl: WebGLRenderingContext): GLState {
|
|
|
108
108
|
assert(copyState !== undefined);
|
|
109
109
|
// @ts-expect-error
|
|
110
110
|
if (!gl.state) {
|
|
111
|
-
const global_ = typeof global !== 'undefined' ? global : window;
|
|
112
111
|
// @ts-ignore
|
|
113
112
|
// const {polyfillContext} = global_;
|
|
114
113
|
// if (polyfillContext) {
|
|
@@ -141,7 +140,7 @@ function getContextState(gl: WebGLRenderingContext): GLState {
|
|
|
141
140
|
/**
|
|
142
141
|
* Saves current WebGL context state onto an internal per-context stack
|
|
143
142
|
*/
|
|
144
|
-
|
|
143
|
+
export function pushContextState(gl: WebGLRenderingContext): void {
|
|
145
144
|
let glState = getContextState(gl);
|
|
146
145
|
if (!glState) {
|
|
147
146
|
trackContextState(gl, {copyState: false});
|
|
@@ -188,9 +187,9 @@ function installGetterOverride(gl: WebGLRenderingContext, functionName: string)
|
|
|
188
187
|
// Optionally call the original function to do a "hard" query from the WebGLRenderingContext
|
|
189
188
|
return glState.enable
|
|
190
189
|
? // Call the getter the params so that it can e.g. serve from a cache
|
|
191
|
-
|
|
190
|
+
glState.cache[pname]
|
|
192
191
|
: // Optionally call the original function to do a "hard" query from the WebGLRenderingContext
|
|
193
|
-
|
|
192
|
+
originalGetterFunc(pname);
|
|
194
193
|
};
|
|
195
194
|
|
|
196
195
|
// Set the name of this anonymous function to help in debugging and profiling
|
|
@@ -209,12 +208,13 @@ function installGetterOverride(gl: WebGLRenderingContext, functionName: string)
|
|
|
209
208
|
* @param setter
|
|
210
209
|
* @returns
|
|
211
210
|
*/
|
|
212
|
-
function installSetterSpy(gl: WebGLRenderingContext, functionName, setter) {
|
|
211
|
+
function installSetterSpy(gl: WebGLRenderingContext, functionName: string, setter: Function) {
|
|
213
212
|
// Get the original function from the WebGLRenderingContext
|
|
214
213
|
if (!gl[functionName]) {
|
|
215
214
|
// This could happen if we try to intercept WebGL2 method on a WebGL1 context
|
|
216
215
|
return;
|
|
217
216
|
}
|
|
217
|
+
|
|
218
218
|
const originalSetterFunc = gl[functionName].bind(gl);
|
|
219
219
|
|
|
220
220
|
// Wrap it with a spy so that we can update our state cache when it gets called
|
|
@@ -222,6 +222,7 @@ function installSetterSpy(gl: WebGLRenderingContext, functionName, setter) {
|
|
|
222
222
|
// Update the value
|
|
223
223
|
// Call the setter with the state cache and the params so that it can store the parameters
|
|
224
224
|
const glState = getContextState(gl);
|
|
225
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
225
226
|
const {valueChanged, oldValue} = setter(glState._updateCache, ...params);
|
|
226
227
|
|
|
227
228
|
// Call the original WebGLRenderingContext func to make sure the context actually gets updated
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type {Device} from '@luma.gl/core';
|
|
2
|
+
import {WebGLDevice} from '../../adapter/webgl-device';
|
|
1
3
|
import {GLParameters, setParameters} from '../parameters/unified-parameter-api';
|
|
2
4
|
import {pushContextState, popContextState} from './track-context-state';
|
|
3
5
|
|
|
@@ -9,10 +11,13 @@ import {pushContextState, popContextState} from './track-context-state';
|
|
|
9
11
|
* - Restores parameters
|
|
10
12
|
* - Returns the return value of the supplied function
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
export function withParameters(device: Device | WebGLRenderingContext, parameters: GLParameters & {nocatch?: boolean}, func: any): any {
|
|
15
|
+
const webglDevice = WebGLDevice.attach(device);
|
|
16
|
+
const gl = webglDevice.gl;
|
|
17
|
+
|
|
13
18
|
if (isObjectEmpty(parameters)) {
|
|
14
19
|
// Avoid setting state if no parameters provided. Just call and return
|
|
15
|
-
return func(
|
|
20
|
+
return func(device);
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
const {nocatch = true} = parameters;
|
|
@@ -43,6 +48,7 @@ import {pushContextState, popContextState} from './track-context-state';
|
|
|
43
48
|
|
|
44
49
|
// Returns true if given object is empty, false otherwise.
|
|
45
50
|
function isObjectEmpty(object) {
|
|
51
|
+
// @ts-ignore - dummy key variable
|
|
46
52
|
for (const key in object) {
|
|
47
53
|
return false;
|
|
48
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,35 +4,40 @@
|
|
|
4
4
|
// but make it easier to use.
|
|
5
5
|
// Higher level abstractions can be built on these classes
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
import './init'
|
|
10
|
-
|
|
11
|
-
export {default as WebGLDevice} from './adapter/webgl-device';
|
|
12
|
-
export {default as WebGLCanvasContext} from './adapter/webgl-canvas-context';
|
|
13
|
-
|
|
14
|
-
// Legacy WebGL Classes - will be moved to gltools
|
|
15
|
-
export {default as Accessor} from './classic/accessor';
|
|
16
|
-
export type {ClassicBufferProps as BufferProps} from './classic/buffer';
|
|
17
|
-
export {default as Buffer} from './classic/buffer';
|
|
18
|
-
export {default as WEBGLResource, default as WebGLResource} from './adapter/objects/webgl-resource';
|
|
19
|
-
export {default as WEBGLBuffer} from './adapter/resources/webgl-buffer';
|
|
20
|
-
export {default as WEBGLTexture} from './adapter/resources/webgl-texture';
|
|
21
|
-
// export {default as WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';
|
|
22
|
-
export {default as WEBGLShader} from './adapter/resources/webgl-shader';
|
|
23
|
-
export {default as WEBGLSampler} from './adapter/resources/webgl-sampler';
|
|
24
|
-
export {default as WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';
|
|
25
|
-
|
|
26
|
-
export {default as WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';
|
|
27
|
-
|
|
28
|
-
// export {default as WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';
|
|
29
|
-
export {default as WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';
|
|
30
|
-
export {default as WEBGLRenderPass} from './adapter/resources/webgl-render-pass';
|
|
31
|
-
//export {default as WEBGLComputePass} from './adapter/resources/webgl-compute-pass';
|
|
7
|
+
// Types
|
|
8
|
+
export type {WebGLLimits} from './adapter/device-helpers/device-limits';
|
|
32
9
|
|
|
10
|
+
export {registerHeadlessGL} from './context/context/create-headless-context';
|
|
11
|
+
|
|
12
|
+
// WebGL adapter classes
|
|
13
|
+
export {WebGLDevice} from './adapter/webgl-device';
|
|
14
|
+
export {WebGLCanvasContext} from './adapter/webgl-canvas-context';
|
|
15
|
+
|
|
16
|
+
// WebGL Resource classes
|
|
17
|
+
export {WebGLResource, WebGLResource as WEBGLResource} from './adapter/objects/webgl-resource';
|
|
18
|
+
export {WEBGLBuffer} from './adapter/resources/webgl-buffer';
|
|
19
|
+
export {WEBGLTexture} from './adapter/resources/webgl-texture';
|
|
20
|
+
// export {WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';
|
|
21
|
+
export {WEBGLShader} from './adapter/resources/webgl-shader';
|
|
22
|
+
export {WEBGLSampler} from './adapter/resources/webgl-sampler';
|
|
23
|
+
export {WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';
|
|
24
|
+
|
|
25
|
+
export {WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';
|
|
26
|
+
// export {WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';
|
|
27
|
+
export {WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';
|
|
28
|
+
export {WEBGLRenderPass} from './adapter/resources/webgl-render-pass';
|
|
29
|
+
// export {WEBGLComputePass} from './adapter/resources/webgl-compute-pass';
|
|
30
|
+
|
|
31
|
+
// non-api resources
|
|
33
32
|
export type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
33
|
+
export {WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';
|
|
34
|
+
export {WEBGLVertexArrayObject} from './adapter/objects/webgl-vertex-array-object';
|
|
35
|
+
|
|
36
|
+
// WebGL adapter classes (Legacy will likely be removed)
|
|
37
|
+
export {Accessor} from './classic/accessor';
|
|
38
|
+
export type {AccessorObject} from './types';
|
|
39
|
+
export type {BufferWithAccessorProps} from './classic/buffer-with-accessor';
|
|
40
|
+
export {BufferWithAccessor} from './classic/buffer-with-accessor';
|
|
36
41
|
|
|
37
42
|
export {
|
|
38
43
|
isWebGL,
|
|
@@ -42,14 +47,11 @@ export {
|
|
|
42
47
|
assertWebGL2Context
|
|
43
48
|
} from './context/context/webgl-checks';
|
|
44
49
|
|
|
45
|
-
// Device ratio
|
|
46
|
-
export {cssToDeviceRatio, cssToDevicePixels} from './context/context/device-pixels';
|
|
47
|
-
|
|
48
50
|
// Unified parameter API
|
|
49
51
|
|
|
50
52
|
export {setDeviceParameters, withDeviceParameters} from './adapter/converters/device-parameters';
|
|
51
53
|
|
|
52
|
-
export type {GLParameters} from '
|
|
54
|
+
export type {GLParameters} from '@luma.gl/constants';
|
|
53
55
|
export {
|
|
54
56
|
getParameters,
|
|
55
57
|
setParameters,
|
|
@@ -71,5 +73,12 @@ export {
|
|
|
71
73
|
export {polyfillContext} from './context/polyfill/polyfill-context';
|
|
72
74
|
|
|
73
75
|
// HELPERS - EXPERIMENTAL
|
|
74
|
-
export {getShaderLayout,
|
|
75
|
-
export {_checkFloat32ColorAttachment} from './adapter/converters/texture-formats';
|
|
76
|
+
export {getShaderLayout, mergeShaderLayout} from './adapter/helpers/get-shader-layout';
|
|
77
|
+
export {convertGLToTextureFormat, _checkFloat32ColorAttachment} from './adapter/converters/texture-formats';
|
|
78
|
+
|
|
79
|
+
// TEST EXPORTS
|
|
80
|
+
export {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';
|
|
81
|
+
|
|
82
|
+
// DEPRECATED EXPORTS
|
|
83
|
+
export {clear} from './classic/clear';
|
|
84
|
+
export {readPixelsToBuffer, readPixelsToArray, copyToTexture} from './classic/copy-and-blit';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import GL from '@luma.gl/constants';
|
|
2
|
-
export declare function isRenderbufferFormatSupported(gl: WebGLRenderingContext, format: GL): boolean;
|
|
3
|
-
export declare function getRenderbufferFormatBytesPerPixel(format: GL): number;
|
|
4
|
-
/**
|
|
5
|
-
* @param bpp "bytes per pixel", used for memory usage calculations.
|
|
6
|
-
* @param gl2 requires WebGL2
|
|
7
|
-
* @param ext requires extension
|
|
8
|
-
*/
|
|
9
|
-
declare type RenderbufferFormat = {
|
|
10
|
-
bpp: number;
|
|
11
|
-
gl2?: boolean;
|
|
12
|
-
ext?: string;
|
|
13
|
-
};
|
|
14
|
-
declare const RENDERBUFFER_FORMATS: Record<string, RenderbufferFormat>;
|
|
15
|
-
export default RENDERBUFFER_FORMATS;
|
|
16
|
-
//# sourceMappingURL=renderbuffer-formats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderbuffer-formats.d.ts","sourceRoot":"","sources":["../../../src/adapter/converters/renderbuffer-formats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGpC,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAa5F;AAED,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,CAErE;AAKD;;;;GAIG;AACH,aAAK,kBAAkB,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,QAAA,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAqD5D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import GL from '@luma.gl/constants';
|
|
2
|
-
import { isWebGL2 } from '../../context/context/webgl-checks';
|
|
3
|
-
export function isRenderbufferFormatSupported(gl, format) {
|
|
4
|
-
const info = RENDERBUFFER_FORMATS[format];
|
|
5
|
-
|
|
6
|
-
if (!info) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (info.ext) {
|
|
11
|
-
return Boolean(gl.getExtension(info.ext));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (info.gl2) {
|
|
15
|
-
return isWebGL2(gl);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
export function getRenderbufferFormatBytesPerPixel(format) {
|
|
21
|
-
return RENDERBUFFER_FORMATS[format].bpp;
|
|
22
|
-
}
|
|
23
|
-
const EXT_FLOAT_WEBGL2 = 'EXT_color_buffer_float';
|
|
24
|
-
const RENDERBUFFER_FORMATS = {
|
|
25
|
-
[GL.DEPTH_COMPONENT16]: {
|
|
26
|
-
bpp: 2
|
|
27
|
-
},
|
|
28
|
-
[GL.DEPTH_COMPONENT24]: {
|
|
29
|
-
gl2: true,
|
|
30
|
-
bpp: 3
|
|
31
|
-
},
|
|
32
|
-
[GL.DEPTH_COMPONENT32F]: {
|
|
33
|
-
gl2: true,
|
|
34
|
-
bpp: 4
|
|
35
|
-
},
|
|
36
|
-
[GL.STENCIL_INDEX8]: {
|
|
37
|
-
bpp: 1
|
|
38
|
-
},
|
|
39
|
-
[GL.DEPTH_STENCIL]: {
|
|
40
|
-
bpp: 4
|
|
41
|
-
},
|
|
42
|
-
[GL.DEPTH24_STENCIL8]: {
|
|
43
|
-
gl2: true,
|
|
44
|
-
bpp: 4
|
|
45
|
-
},
|
|
46
|
-
[GL.DEPTH32F_STENCIL8]: {
|
|
47
|
-
gl2: true,
|
|
48
|
-
bpp: 5
|
|
49
|
-
},
|
|
50
|
-
[GL.RGBA4]: {
|
|
51
|
-
bpp: 2
|
|
52
|
-
},
|
|
53
|
-
[GL.RGB565]: {
|
|
54
|
-
bpp: 2
|
|
55
|
-
},
|
|
56
|
-
[GL.RGB5_A1]: {
|
|
57
|
-
bpp: 2
|
|
58
|
-
},
|
|
59
|
-
[GL.R8]: {
|
|
60
|
-
gl2: true,
|
|
61
|
-
bpp: 1
|
|
62
|
-
},
|
|
63
|
-
[GL.R8UI]: {
|
|
64
|
-
gl2: true,
|
|
65
|
-
bpp: 1
|
|
66
|
-
},
|
|
67
|
-
[GL.R8I]: {
|
|
68
|
-
gl2: true,
|
|
69
|
-
bpp: 1
|
|
70
|
-
},
|
|
71
|
-
[GL.R16UI]: {
|
|
72
|
-
gl2: true,
|
|
73
|
-
bpp: 2
|
|
74
|
-
},
|
|
75
|
-
[GL.R16I]: {
|
|
76
|
-
gl2: true,
|
|
77
|
-
bpp: 2
|
|
78
|
-
},
|
|
79
|
-
[GL.R32UI]: {
|
|
80
|
-
gl2: true,
|
|
81
|
-
bpp: 4
|
|
82
|
-
},
|
|
83
|
-
[GL.R32I]: {
|
|
84
|
-
gl2: true,
|
|
85
|
-
bpp: 4
|
|
86
|
-
},
|
|
87
|
-
[GL.RG8]: {
|
|
88
|
-
gl2: true,
|
|
89
|
-
bpp: 2
|
|
90
|
-
},
|
|
91
|
-
[GL.RG8UI]: {
|
|
92
|
-
gl2: true,
|
|
93
|
-
bpp: 2
|
|
94
|
-
},
|
|
95
|
-
[GL.RG8I]: {
|
|
96
|
-
gl2: true,
|
|
97
|
-
bpp: 2
|
|
98
|
-
},
|
|
99
|
-
[GL.RG16UI]: {
|
|
100
|
-
gl2: true,
|
|
101
|
-
bpp: 4
|
|
102
|
-
},
|
|
103
|
-
[GL.RG16I]: {
|
|
104
|
-
gl2: true,
|
|
105
|
-
bpp: 4
|
|
106
|
-
},
|
|
107
|
-
[GL.RG32UI]: {
|
|
108
|
-
gl2: true,
|
|
109
|
-
bpp: 8
|
|
110
|
-
},
|
|
111
|
-
[GL.RG32I]: {
|
|
112
|
-
gl2: true,
|
|
113
|
-
bpp: 8
|
|
114
|
-
},
|
|
115
|
-
[GL.RGB8]: {
|
|
116
|
-
gl2: true,
|
|
117
|
-
bpp: 3
|
|
118
|
-
},
|
|
119
|
-
[GL.RGBA8]: {
|
|
120
|
-
gl2: true,
|
|
121
|
-
bpp: 4
|
|
122
|
-
},
|
|
123
|
-
[GL.RGB10_A2]: {
|
|
124
|
-
gl2: true,
|
|
125
|
-
bpp: 4
|
|
126
|
-
},
|
|
127
|
-
[GL.RGBA8UI]: {
|
|
128
|
-
gl2: true,
|
|
129
|
-
bpp: 4
|
|
130
|
-
},
|
|
131
|
-
[GL.RGBA8I]: {
|
|
132
|
-
gl2: true,
|
|
133
|
-
bpp: 4
|
|
134
|
-
},
|
|
135
|
-
[GL.RGB10_A2UI]: {
|
|
136
|
-
gl2: true,
|
|
137
|
-
bpp: 4
|
|
138
|
-
},
|
|
139
|
-
[GL.RGBA16UI]: {
|
|
140
|
-
gl2: true,
|
|
141
|
-
bpp: 8
|
|
142
|
-
},
|
|
143
|
-
[GL.RGBA16I]: {
|
|
144
|
-
gl2: true,
|
|
145
|
-
bpp: 8
|
|
146
|
-
},
|
|
147
|
-
[GL.RGBA32I]: {
|
|
148
|
-
gl2: true,
|
|
149
|
-
bpp: 16
|
|
150
|
-
},
|
|
151
|
-
[GL.RGBA32UI]: {
|
|
152
|
-
gl2: true,
|
|
153
|
-
bpp: 16
|
|
154
|
-
},
|
|
155
|
-
[GL.R16F]: {
|
|
156
|
-
ext: EXT_FLOAT_WEBGL2,
|
|
157
|
-
bpp: 2
|
|
158
|
-
},
|
|
159
|
-
[GL.RG16F]: {
|
|
160
|
-
ext: EXT_FLOAT_WEBGL2,
|
|
161
|
-
bpp: 4
|
|
162
|
-
},
|
|
163
|
-
[GL.RGBA16F]: {
|
|
164
|
-
ext: EXT_FLOAT_WEBGL2,
|
|
165
|
-
bpp: 8
|
|
166
|
-
},
|
|
167
|
-
[GL.R32F]: {
|
|
168
|
-
ext: EXT_FLOAT_WEBGL2,
|
|
169
|
-
bpp: 4
|
|
170
|
-
},
|
|
171
|
-
[GL.RG32F]: {
|
|
172
|
-
ext: EXT_FLOAT_WEBGL2,
|
|
173
|
-
bpp: 8
|
|
174
|
-
},
|
|
175
|
-
[GL.RGBA32F]: {
|
|
176
|
-
ext: EXT_FLOAT_WEBGL2,
|
|
177
|
-
bpp: 16
|
|
178
|
-
},
|
|
179
|
-
[GL.R11F_G11F_B10F]: {
|
|
180
|
-
ext: EXT_FLOAT_WEBGL2,
|
|
181
|
-
bpp: 4
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
export default RENDERBUFFER_FORMATS;
|
|
185
|
-
//# sourceMappingURL=renderbuffer-formats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/converters/renderbuffer-formats.ts"],"names":["GL","isWebGL2","isRenderbufferFormatSupported","gl","format","info","RENDERBUFFER_FORMATS","ext","Boolean","getExtension","gl2","getRenderbufferFormatBytesPerPixel","bpp","EXT_FLOAT_WEBGL2","DEPTH_COMPONENT16","DEPTH_COMPONENT24","DEPTH_COMPONENT32F","STENCIL_INDEX8","DEPTH_STENCIL","DEPTH24_STENCIL8","DEPTH32F_STENCIL8","RGBA4","RGB565","RGB5_A1","R8","R8UI","R8I","R16UI","R16I","R32UI","R32I","RG8","RG8UI","RG8I","RG16UI","RG16I","RG32UI","RG32I","RGB8","RGBA8","RGB10_A2","RGBA8UI","RGBA8I","RGB10_A2UI","RGBA16UI","RGBA16I","RGBA32I","RGBA32UI","R16F","RG16F","RGBA16F","R32F","RG32F","RGBA32F","R11F_G11F_B10F"],"mappings":"AAAA,OAAOA,EAAP,MAAe,oBAAf;AACA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IAAAA,GAAG,EAAE;AAA7B,GAhDmD;AAkD/D,GAACZ,EAAE,CAACqD,OAAJ,GAAc;AAAC9C,IAAAA,GAAG,EAAEM,gBAAN;AAAwBD,IAAAA,GAAG,EAAE;AAA7B,GAlDiD;AAoD/D,GAACZ,EAAE,CAACsD,cAAJ,GAAqB;AAAC/C,IAAAA,GAAG,EAAEM,gBAAN;AAAwBD,IAAAA,GAAG,EAAE;AAA7B;AApD0C,CAAjE;AAuDA,eAAeN,oBAAf","sourcesContent":["import GL from '@luma.gl/constants';\nimport {isWebGL2} from '../../context/context/webgl-checks';\n\nexport function isRenderbufferFormatSupported(gl: WebGLRenderingContext, format: GL): boolean {\n const info = RENDERBUFFER_FORMATS[format];\n // Unknown format\n if (!info) {\n return false;\n }\n if (info.ext) {\n return Boolean(gl.getExtension(info.ext));\n }\n if (info.gl2) {\n return isWebGL2(gl);\n }\n return true;\n}\n\nexport function getRenderbufferFormatBytesPerPixel(format: GL): number {\n return RENDERBUFFER_FORMATS[format].bpp;\n}\n\n// Define local extension strings to optimize minification\nconst EXT_FLOAT_WEBGL2 = 'EXT_color_buffer_float';\n\n/**\n * @param bpp \"bytes per pixel\", used for memory usage calculations.\n * @param gl2 requires WebGL2\n * @param ext requires extension\n */\ntype RenderbufferFormat = {\n bpp: number;\n gl2?: boolean;\n ext?: string;\n};\n\nconst RENDERBUFFER_FORMATS: Record<string, RenderbufferFormat> = {\n [GL.DEPTH_COMPONENT16]: {bpp: 2}, // 16 depth bits.\n [GL.DEPTH_COMPONENT24]: {gl2: true, bpp: 3},\n [GL.DEPTH_COMPONENT32F]: {gl2: true, bpp: 4},\n\n [GL.STENCIL_INDEX8]: {bpp: 1}, // 8 stencil bits.\n\n [GL.DEPTH_STENCIL]: {bpp: 4},\n [GL.DEPTH24_STENCIL8]: {gl2: true, bpp: 4},\n [GL.DEPTH32F_STENCIL8]: {gl2: true, bpp: 5},\n\n // When using a WebGL 1 context, color renderbuffer formats are limited\n [GL.RGBA4]: {bpp: 2},\n [GL.RGB565]: {bpp: 2},\n [GL.RGB5_A1]: {bpp: 2},\n\n // When using a WebGL 2 context, the following values are available additionally:\n [GL.R8]: {gl2: true, bpp: 1},\n [GL.R8UI]: {gl2: true, bpp: 1},\n [GL.R8I]: {gl2: true, bpp: 1},\n [GL.R16UI]: {gl2: true, bpp: 2},\n [GL.R16I]: {gl2: true, bpp: 2},\n [GL.R32UI]: {gl2: true, bpp: 4},\n [GL.R32I]: {gl2: true, bpp: 4},\n [GL.RG8]: {gl2: true, bpp: 2},\n [GL.RG8UI]: {gl2: true, bpp: 2},\n [GL.RG8I]: {gl2: true, bpp: 2},\n [GL.RG16UI]: {gl2: true, bpp: 4},\n [GL.RG16I]: {gl2: true, bpp: 4},\n [GL.RG32UI]: {gl2: true, bpp: 8},\n [GL.RG32I]: {gl2: true, bpp: 8},\n [GL.RGB8]: {gl2: true, bpp: 3},\n [GL.RGBA8]: {gl2: true, bpp: 4},\n // [GL.SRGB8_ALPHA8]: {gl2: true, gl1: SRGB}, // When using the EXT_sRGB WebGL1 extension\n [GL.RGB10_A2]: {gl2: true, bpp: 4},\n [GL.RGBA8UI]: {gl2: true, bpp: 4},\n [GL.RGBA8I]: {gl2: true, bpp: 4},\n [GL.RGB10_A2UI]: {gl2: true, bpp: 4},\n [GL.RGBA16UI]: {gl2: true, bpp: 8},\n [GL.RGBA16I]: {gl2: true, bpp: 8},\n [GL.RGBA32I]: {gl2: true, bpp: 16},\n [GL.RGBA32UI]: {gl2: true, bpp: 16},\n\n // When using a WebGL 2 context and the EXT_color_buffer_float WebGL2 extension\n [GL.R16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 2},\n [GL.RG16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4},\n [GL.RGBA16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 8},\n [GL.R32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4},\n [GL.RG32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 8},\n // TODO - can't get WEBGL_color_buffer_float to work on renderbuffers\n [GL.RGBA32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 16},\n // [GL.RGBA32F]: {ext: EXT_FLOAT_WEBGL2, gl1: EXT_FLOAT_WEBGL1},\n [GL.R11F_G11F_B10F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4}\n};\n\nexport default RENDERBUFFER_FORMATS;\n"],"file":"renderbuffer-formats.js"}
|
package/dist/bundle.d.ts
DELETED
package/dist/bundle.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,aAAa,KAAqB,CAAC"}
|
package/dist/bundle.js
DELETED
package/dist/bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bundle.ts"],"names":["moduleExports","require","globalThis","luma","module","exports","Object","assign"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACAC,UAAU,CAACC,IAAX,GAAkBD,UAAU,CAACC,IAAX,IAAmB,EAArC;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcL,UAAU,CAACC,IAAzB,EAA+BH,aAA/B,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.luma = globalThis.luma || {};\nmodule.exports = Object.assign(globalThis.luma, moduleExports);\n"],"file":"bundle.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/classic/buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,QAAQ,MAAM,YAAY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