@luma.gl/webgl 9.0.0-alpha.5 → 9.0.0-alpha.51
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 +3 -1
- package/dist/adapter/converters/device-parameters.d.ts +23 -4
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +101 -73
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.d.ts +6 -6
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +74 -111
- package/dist/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/adapter/converters/shader-formats.d.ts +9 -0
- package/dist/adapter/converters/shader-formats.d.ts.map +1 -0
- package/dist/adapter/converters/shader-formats.js +52 -0
- package/dist/adapter/converters/shader-formats.js.map +1 -0
- package/dist/adapter/converters/texture-formats.d.ts +32 -44
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +309 -346
- package/dist/adapter/converters/texture-formats.js.map +1 -1
- package/dist/adapter/converters/vertex-formats.d.ts +9 -3
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +53 -22
- 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 +17 -23
- 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 +54 -58
- 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 +31 -22
- package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/adapter/device-helpers/is-old-ie.d.ts.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/decode-webgl-types.d.ts +26 -0
- package/dist/adapter/helpers/decode-webgl-types.d.ts.map +1 -0
- package/dist/adapter/helpers/decode-webgl-types.js +89 -0
- package/dist/adapter/helpers/decode-webgl-types.js.map +1 -0
- package/dist/adapter/helpers/get-shader-layout.d.ts +1 -48
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +87 -143
- 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 +16 -11
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts +3 -2
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +51 -82
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.d.ts +16 -0
- package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -0
- package/dist/adapter/helpers/webgl-topology-utils.js +103 -0
- package/dist/adapter/helpers/webgl-topology-utils.js.map +1 -0
- 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 +2 -29
- 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 +36 -44
- 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 +26 -83
- package/dist/adapter/objects/webgl-resource.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts +19 -11
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +60 -88
- 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 +175 -48
- 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 +10 -20
- 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 +63 -173
- 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 +99 -11
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +55 -21
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +108 -270
- 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 +11 -21
- package/dist/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/adapter/resources/webgl-shader.d.ts +5 -5
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +18 -43
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +62 -42
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +137 -256
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.d.ts +47 -0
- package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-transform-feedback.js +164 -0
- package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -0
- package/dist/adapter/resources/webgl-vertex-array.d.ts +67 -0
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -0
- package/dist/adapter/resources/webgl-vertex-array.js +167 -0
- package/dist/adapter/resources/webgl-vertex-array.js.map +1 -0
- 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 +10 -23
- package/dist/adapter/webgl-canvas-context.js.map +1 -1
- package/dist/adapter/webgl-device.d.ts +76 -41
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +219 -129
- 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 +26 -52
- package/dist/classic/accessor.js.map +1 -1
- 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 +191 -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 +37 -0
- package/dist/classic/format-utils.js.map +1 -0
- package/dist/classic/typed-array-utils.d.ts +17 -17
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +18 -39
- 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/context/context/create-browser-context.js +53 -0
- 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.d.ts.map +1 -1
- 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 +15 -39
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/parameters/unified-parameter-api.d.ts +9 -8
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +9 -19
- 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 +267 -286
- 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 +37 -43
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/context/polyfill/polyfill-context.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-context.js +22 -30
- 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 +18 -41
- 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 +17 -87
- package/dist/context/polyfill/polyfill-vertex-array-object.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 +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 +26 -62
- 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 +8 -10
- package/dist/context/state-tracker/with-parameters.js.map +1 -1
- package/dist/dist.dev.js +8624 -0
- package/dist/index.cjs +6570 -0
- package/dist/index.d.ts +26 -24
- 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 +3 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist.min.js +52 -0
- package/package.json +21 -9
- package/src/adapter/converters/device-parameters.ts +144 -41
- package/src/adapter/converters/sampler-parameters.ts +103 -41
- package/src/adapter/converters/shader-formats.ts +44 -0
- package/src/adapter/converters/texture-formats.ts +268 -195
- package/src/adapter/converters/vertex-formats.ts +71 -10
- package/src/adapter/device-helpers/device-features.ts +14 -3
- package/src/adapter/device-helpers/device-limits.ts +5 -3
- package/src/adapter/device-helpers/get-device-info.ts +53 -18
- package/src/adapter/device-helpers/is-old-ie.ts +3 -0
- package/src/adapter/helpers/{uniforms.ts → decode-webgl-types.ts} +39 -21
- package/src/adapter/helpers/get-shader-layout.ts +121 -146
- package/src/adapter/helpers/parse-shader-compiler-log.ts +24 -8
- package/src/adapter/helpers/set-uniform.ts +39 -35
- package/src/adapter/helpers/webgl-topology-utils.ts +103 -0
- package/src/adapter/objects/constants-to-keys.ts +6 -25
- package/src/adapter/objects/webgl-renderbuffer.ts +43 -37
- package/src/adapter/objects/webgl-resource.ts +16 -23
- package/src/adapter/resources/.webgl-render-pipeline.ts.swp +0 -0
- package/src/adapter/resources/webgl-buffer.ts +67 -62
- package/src/adapter/resources/webgl-command-buffer.ts +327 -25
- package/src/adapter/resources/webgl-command-encoder.ts +20 -12
- package/src/adapter/resources/webgl-external-texture.ts +5 -2
- package/src/adapter/resources/webgl-framebuffer.ts +90 -134
- package/src/adapter/resources/webgl-render-pass.ts +166 -4
- package/src/adapter/resources/webgl-render-pipeline.ts +256 -192
- package/src/adapter/resources/webgl-sampler.ts +16 -10
- package/src/adapter/resources/webgl-shader.ts +33 -27
- package/src/adapter/resources/webgl-texture.ts +138 -99
- package/src/adapter/resources/webgl-transform-feedback.ts +202 -0
- package/src/adapter/resources/webgl-vertex-array.ts +283 -0
- package/src/adapter/webgl-canvas-context.ts +16 -14
- package/src/adapter/webgl-device.ts +328 -79
- package/src/classic/accessor.ts +8 -18
- package/src/classic/clear.ts +113 -0
- package/src/classic/copy-and-blit.ts +311 -0
- package/src/classic/format-utils.ts +46 -0
- package/src/classic/typed-array-utils.ts +21 -27
- package/src/context/context/create-browser-context.ts +140 -0
- package/src/context/context/create-headless-context.ts +51 -0
- package/src/context/context/webgl-checks.ts +3 -1
- package/src/context/debug/spector.ts +9 -6
- package/src/context/debug/webgl-developer-tools.ts +23 -15
- package/src/context/parameters/unified-parameter-api.ts +23 -14
- package/src/context/parameters/webgl-parameter-tables.ts +120 -98
- package/src/context/polyfill/context-data.ts +30 -0
- package/src/context/polyfill/get-parameter-polyfill.ts +11 -7
- package/src/context/polyfill/polyfill-context.ts +10 -9
- package/src/context/polyfill/polyfill-table.ts +21 -16
- package/src/context/polyfill/polyfill-vertex-array-object.ts +5 -0
- package/src/context/state-tracker/deep-array-equal.ts +2 -0
- package/src/context/state-tracker/track-context-state.ts +14 -11
- package/src/context/state-tracker/with-parameters.ts +13 -4
- package/src/index.ts +70 -35
- package/src/types.ts +5 -0
- 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/adapter/helpers/attribute-utils.d.ts +0 -11
- package/dist/adapter/helpers/attribute-utils.d.ts.map +0 -1
- package/dist/adapter/helpers/attribute-utils.js +0 -81
- package/dist/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/adapter/helpers/uniforms.d.ts +0 -26
- package/dist/adapter/helpers/uniforms.d.ts.map +0 -1
- package/dist/adapter/helpers/uniforms.js +0 -99
- package/dist/adapter/helpers/uniforms.js.map +0 -1
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts +0 -27
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +0 -1
- package/dist/adapter/objects/webgl-vertex-array-object.js +0 -84
- package/dist/adapter/objects/webgl-vertex-array-object.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 +0 -95
- package/dist/classic/buffer.d.ts.map +0 -1
- package/dist/classic/buffer.js +0 -384
- 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 -833
- 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 +0 -49
- 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 -145
- 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/adapter/helpers/attribute-utils.ts +0 -61
- package/src/adapter/objects/webgl-vertex-array-object.ts +0 -111
- package/src/bundle.ts +0 -4
- package/src/classic/buffer.ts +0 -474
- package/src/context/context/context-state.ts +0 -41
- package/src/context/context/create-context.ts +0 -110
- package/src/context/context/device-pixels.ts +0 -152
- package/src/init.ts +0 -4
- package/src/types/webgl.ts +0 -284
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import {assert} from '@luma.gl/core';
|
|
5
|
+
import {GL} from '@luma.gl/constants';
|
|
3
6
|
import {isWebGL2} from '../context/webgl-checks';
|
|
4
7
|
|
|
5
8
|
import {getParameterPolyfill} from './get-parameter-polyfill';
|
|
6
|
-
import {
|
|
9
|
+
import {getContextData} from './context-data';
|
|
7
10
|
|
|
11
|
+
/* eslint-disable camelcase */
|
|
8
12
|
const OES_vertex_array_object = 'OES_vertex_array_object';
|
|
9
13
|
const ANGLE_instanced_arrays = 'ANGLE_instanced_arrays';
|
|
10
14
|
const WEBGL_draw_buffers = 'WEBGL_draw_buffers';
|
|
@@ -14,14 +18,14 @@ const EXT_texture_filter_anisotropic = 'EXT_texture_filter_anisotropic';
|
|
|
14
18
|
const ERR_VAO_NOT_SUPPORTED = 'VertexArray requires WebGL2 or OES_vertex_array_object extension';
|
|
15
19
|
|
|
16
20
|
// Return object with webgl2 flag and an extension
|
|
17
|
-
function getExtensionData(gl, extension) {
|
|
21
|
+
function getExtensionData(gl: WebGLRenderingContext, extension: string) {
|
|
18
22
|
return {
|
|
19
23
|
webgl2: isWebGL2(gl),
|
|
20
24
|
ext: gl.getExtension(extension)
|
|
21
25
|
};
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
// function mapExtensionConstant(gl, constant) {
|
|
28
|
+
// function mapExtensionConstant(gl: WebGLRenderingContext, constant) {
|
|
25
29
|
// switch (constant) {
|
|
26
30
|
// case ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES: return GL.FRAGMENT_SHADER_DERIVATIVE_HINT;
|
|
27
31
|
// }
|
|
@@ -46,7 +50,7 @@ export const WEBGL2_CONTEXT_POLYFILLS = {
|
|
|
46
50
|
// VERTEX_ATTRIB_ARRAY_DIVISOR: 'VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE'
|
|
47
51
|
// }
|
|
48
52
|
},
|
|
49
|
-
vertexAttribDivisor(location, divisor) {
|
|
53
|
+
vertexAttribDivisor(location: number, divisor: number) {
|
|
50
54
|
// Accept divisor 0 even if instancing is not supported (0 = no instancing)
|
|
51
55
|
assert(divisor === 0, 'WebGL instanced rendering not supported');
|
|
52
56
|
},
|
|
@@ -74,20 +78,20 @@ export const WEBGL2_CONTEXT_POLYFILLS = {
|
|
|
74
78
|
assert(false);
|
|
75
79
|
},
|
|
76
80
|
endQuery: () => {},
|
|
77
|
-
getQuery(handle, pname) {
|
|
81
|
+
getQuery(handle, pname: string) {
|
|
78
82
|
return this.getQueryObject(handle, pname);
|
|
79
83
|
},
|
|
80
84
|
// The WebGL1 extension uses getQueryObject rather then getQueryParameter
|
|
81
|
-
getQueryParameter(handle, pname) {
|
|
85
|
+
getQueryParameter(handle, pname: string) {
|
|
82
86
|
return this.getQueryObject(handle, pname);
|
|
83
87
|
},
|
|
84
|
-
getQueryObject: () => {}
|
|
88
|
+
getQueryObject: (handle: unknown, pname: unknown) => {}
|
|
85
89
|
}
|
|
86
90
|
};
|
|
87
91
|
|
|
88
92
|
export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
89
93
|
// Ensure readBuffer is a no-op
|
|
90
|
-
readBuffer: (gl, originalFunc, attachment) => {
|
|
94
|
+
readBuffer: (gl: WebGLRenderingContext, originalFunc, attachment) => {
|
|
91
95
|
if (isWebGL2(gl)) {
|
|
92
96
|
originalFunc(attachment);
|
|
93
97
|
} else {
|
|
@@ -95,7 +99,7 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
95
99
|
}
|
|
96
100
|
},
|
|
97
101
|
// Override for getVertexAttrib that returns sane values for non-WebGL1 constants
|
|
98
|
-
getVertexAttrib: (gl, originalFunc, location, pname) => {
|
|
102
|
+
getVertexAttrib: (gl: WebGLRenderingContext, originalFunc, location, pname) => {
|
|
99
103
|
// const gl = this; // eslint-disable-line
|
|
100
104
|
const {webgl2, ext} = getExtensionData(gl, ANGLE_instanced_arrays);
|
|
101
105
|
|
|
@@ -115,7 +119,7 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
115
119
|
return result !== undefined ? result : originalFunc(location, pname);
|
|
116
120
|
},
|
|
117
121
|
// Handle transform feedback and uniform block queries in WebGL1
|
|
118
|
-
getProgramParameter: (gl, originalFunc, program, pname) => {
|
|
122
|
+
getProgramParameter: (gl: WebGLRenderingContext, originalFunc, program, pname) => {
|
|
119
123
|
if (!isWebGL2(gl)) {
|
|
120
124
|
switch (pname) {
|
|
121
125
|
case GL.TRANSFORM_FEEDBACK_BUFFER_MODE:
|
|
@@ -129,7 +133,7 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
129
133
|
}
|
|
130
134
|
return originalFunc(program, pname);
|
|
131
135
|
},
|
|
132
|
-
getInternalformatParameter: (gl, originalFunc, target, format, pname) => {
|
|
136
|
+
getInternalformatParameter: (gl: WebGLRenderingContext, originalFunc, target, format, pname) => {
|
|
133
137
|
if (!isWebGL2(gl)) {
|
|
134
138
|
switch (pname) {
|
|
135
139
|
case GL.SAMPLES:
|
|
@@ -137,13 +141,14 @@ export const WEBGL2_CONTEXT_OVERRIDES = {
|
|
|
137
141
|
default:
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
|
-
|
|
144
|
+
const gl2 = gl as WebGL2RenderingContext;
|
|
145
|
+
return gl2.getInternalformatParameter(target, format, pname);
|
|
141
146
|
},
|
|
142
147
|
getTexParameter(gl, originalFunc, target, pname) {
|
|
143
148
|
switch (pname) {
|
|
144
149
|
case GL.TEXTURE_MAX_ANISOTROPY_EXT:
|
|
145
|
-
const
|
|
146
|
-
const {_extensions} =
|
|
150
|
+
const contextData = getContextData(gl);
|
|
151
|
+
const {_extensions} = contextData;
|
|
147
152
|
const ext = _extensions[EXT_texture_filter_anisotropic];
|
|
148
153
|
pname = (ext && ext.TEXTURE_MAX_ANISOTROPY_EXT) || GL.TEXTURE_MAX_ANISOTROPY_EXT;
|
|
149
154
|
break;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
1
4
|
/*
|
|
2
5
|
** Copyright (c) 2015 The Khronos Group Inc.
|
|
3
6
|
**
|
|
@@ -25,6 +28,7 @@
|
|
|
25
28
|
// the global class.
|
|
26
29
|
|
|
27
30
|
// @ts-nocheck external code
|
|
31
|
+
/* eslint-disable */
|
|
28
32
|
|
|
29
33
|
const glErrorShadow = {};
|
|
30
34
|
|
|
@@ -103,6 +107,7 @@ WebGLVertexArrayObjectOES.VertexAttrib.prototype.recache = function recache() {
|
|
|
103
107
|
};
|
|
104
108
|
|
|
105
109
|
const OESVertexArrayObject = function OESVertexArrayObject(gl) {
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
106
111
|
const self = this;
|
|
107
112
|
this.gl = gl;
|
|
108
113
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
1
4
|
// Support for listening to context state changes and intercepting state queries
|
|
2
5
|
// NOTE: this system does not handle buffer bindings
|
|
3
|
-
import {assert} from '@luma.gl/
|
|
6
|
+
import {assert} from '@luma.gl/core';
|
|
4
7
|
import {GL_PARAMETER_DEFAULTS, GL_HOOKED_SETTERS, NON_CACHE_PARAMETERS} from '../parameters/webgl-parameter-tables';
|
|
5
|
-
import {
|
|
8
|
+
import {setGLParameters, getGLParameters} from '../parameters/unified-parameter-api';
|
|
6
9
|
import {deepArrayEqual} from './deep-array-equal';
|
|
7
10
|
|
|
8
11
|
// HELPER CLASS - GLState
|
|
@@ -24,7 +27,7 @@ class GLState {
|
|
|
24
27
|
} = {}
|
|
25
28
|
) {
|
|
26
29
|
this.gl = gl;
|
|
27
|
-
this.cache = copyState ?
|
|
30
|
+
this.cache = copyState ? getGLParameters(gl) : Object.assign({}, GL_PARAMETER_DEFAULTS);
|
|
28
31
|
this.log = log;
|
|
29
32
|
|
|
30
33
|
this._updateCache = this._updateCache.bind(this);
|
|
@@ -39,7 +42,7 @@ class GLState {
|
|
|
39
42
|
assert(this.stateStack.length > 0);
|
|
40
43
|
// Use the saved values in the state stack to restore parameters
|
|
41
44
|
const oldValues = this.stateStack[this.stateStack.length - 1];
|
|
42
|
-
|
|
45
|
+
setGLParameters(this.gl, oldValues);
|
|
43
46
|
// Don't pop until we have reset parameters (to make sure other "stack frames" are not affected)
|
|
44
47
|
this.stateStack.pop();
|
|
45
48
|
}
|
|
@@ -54,7 +57,7 @@ class GLState {
|
|
|
54
57
|
let valueChanged = false;
|
|
55
58
|
let oldValue; // = undefined
|
|
56
59
|
|
|
57
|
-
const oldValues: {[key: number | string]: any} = this.stateStack.length > 0
|
|
60
|
+
const oldValues: {[key: number | string]: any} | null = this.stateStack.length > 0 ? this.stateStack[this.stateStack.length - 1] : null;
|
|
58
61
|
|
|
59
62
|
for (const key in values) {
|
|
60
63
|
assert(key !== undefined);
|
|
@@ -96,7 +99,7 @@ function getContextState(gl: WebGLRenderingContext): GLState {
|
|
|
96
99
|
* gl.state.push() and gl.state.pop() will be available for saving,
|
|
97
100
|
* temporarily modifying, and then restoring state.
|
|
98
101
|
*/
|
|
99
|
-
|
|
102
|
+
export function trackContextState(
|
|
100
103
|
gl: WebGLRenderingContext,
|
|
101
104
|
options?: {
|
|
102
105
|
enable?: boolean;
|
|
@@ -108,7 +111,6 @@ function getContextState(gl: WebGLRenderingContext): GLState {
|
|
|
108
111
|
assert(copyState !== undefined);
|
|
109
112
|
// @ts-expect-error
|
|
110
113
|
if (!gl.state) {
|
|
111
|
-
const global_ = typeof global !== 'undefined' ? global : window;
|
|
112
114
|
// @ts-ignore
|
|
113
115
|
// const {polyfillContext} = global_;
|
|
114
116
|
// if (polyfillContext) {
|
|
@@ -141,7 +143,7 @@ function getContextState(gl: WebGLRenderingContext): GLState {
|
|
|
141
143
|
/**
|
|
142
144
|
* Saves current WebGL context state onto an internal per-context stack
|
|
143
145
|
*/
|
|
144
|
-
|
|
146
|
+
export function pushContextState(gl: WebGLRenderingContext): void {
|
|
145
147
|
let glState = getContextState(gl);
|
|
146
148
|
if (!glState) {
|
|
147
149
|
trackContextState(gl, {copyState: false});
|
|
@@ -188,9 +190,9 @@ function installGetterOverride(gl: WebGLRenderingContext, functionName: string)
|
|
|
188
190
|
// Optionally call the original function to do a "hard" query from the WebGLRenderingContext
|
|
189
191
|
return glState.enable
|
|
190
192
|
? // Call the getter the params so that it can e.g. serve from a cache
|
|
191
|
-
|
|
193
|
+
glState.cache[pname]
|
|
192
194
|
: // Optionally call the original function to do a "hard" query from the WebGLRenderingContext
|
|
193
|
-
|
|
195
|
+
originalGetterFunc(pname);
|
|
194
196
|
};
|
|
195
197
|
|
|
196
198
|
// Set the name of this anonymous function to help in debugging and profiling
|
|
@@ -209,7 +211,7 @@ function installGetterOverride(gl: WebGLRenderingContext, functionName: string)
|
|
|
209
211
|
* @param setter
|
|
210
212
|
* @returns
|
|
211
213
|
*/
|
|
212
|
-
function installSetterSpy(gl: WebGLRenderingContext, functionName: string, setter) {
|
|
214
|
+
function installSetterSpy(gl: WebGLRenderingContext, functionName: string, setter: Function) {
|
|
213
215
|
// Get the original function from the WebGLRenderingContext
|
|
214
216
|
if (!gl[functionName]) {
|
|
215
217
|
// This could happen if we try to intercept WebGL2 method on a WebGL1 context
|
|
@@ -223,6 +225,7 @@ function installSetterSpy(gl: WebGLRenderingContext, functionName: string, sette
|
|
|
223
225
|
// Update the value
|
|
224
226
|
// Call the setter with the state cache and the params so that it can store the parameters
|
|
225
227
|
const glState = getContextState(gl);
|
|
228
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
226
229
|
const {valueChanged, oldValue} = setter(glState._updateCache, ...params);
|
|
227
230
|
|
|
228
231
|
// Call the original WebGLRenderingContext func to make sure the context actually gets updated
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {Device} from '@luma.gl/core';
|
|
5
|
+
import {WebGLDevice} from '../../adapter/webgl-device';
|
|
6
|
+
import {GLParameters, setGLParameters} from '../parameters/unified-parameter-api';
|
|
2
7
|
import {pushContextState, popContextState} from './track-context-state';
|
|
3
8
|
|
|
4
9
|
/**
|
|
@@ -9,16 +14,19 @@ import {pushContextState, popContextState} from './track-context-state';
|
|
|
9
14
|
* - Restores parameters
|
|
10
15
|
* - Returns the return value of the supplied function
|
|
11
16
|
*/
|
|
12
|
-
|
|
17
|
+
export function withGLParameters(device: Device | WebGLRenderingContext, parameters: GLParameters & {nocatch?: boolean}, func: any): any {
|
|
18
|
+
const webglDevice = WebGLDevice.attach(device);
|
|
19
|
+
const gl = webglDevice.gl;
|
|
20
|
+
|
|
13
21
|
if (isObjectEmpty(parameters)) {
|
|
14
22
|
// Avoid setting state if no parameters provided. Just call and return
|
|
15
|
-
return func(
|
|
23
|
+
return func(device);
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
const {nocatch = true} = parameters;
|
|
19
27
|
|
|
20
28
|
pushContextState(gl);
|
|
21
|
-
|
|
29
|
+
setGLParameters(gl, parameters);
|
|
22
30
|
|
|
23
31
|
// Setup is done, call the function
|
|
24
32
|
let value;
|
|
@@ -43,6 +51,7 @@ import {pushContextState, popContextState} from './track-context-state';
|
|
|
43
51
|
|
|
44
52
|
// Returns true if given object is empty, false otherwise.
|
|
45
53
|
function isObjectEmpty(object) {
|
|
54
|
+
// @ts-ignore - dummy key variable
|
|
46
55
|
for (const key in object) {
|
|
47
56
|
return false;
|
|
48
57
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,38 +1,47 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
1
4
|
// luma.gl Base WebGL wrapper library
|
|
2
5
|
// Provides simple class/function wrappers around the low level webgl objects
|
|
3
6
|
// These classes are intentionally close to the WebGL API
|
|
4
7
|
// but make it easier to use.
|
|
5
8
|
// Higher level abstractions can be built on these classes
|
|
6
9
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
import './init'
|
|
10
|
+
// Types
|
|
11
|
+
export type {WebGLLimits} from './adapter/device-helpers/device-limits';
|
|
10
12
|
|
|
11
|
-
export {
|
|
12
|
-
export {default as WebGLCanvasContext} from './adapter/webgl-canvas-context';
|
|
13
|
+
export {registerHeadlessGL} from './context/context/create-headless-context';
|
|
13
14
|
|
|
14
|
-
//
|
|
15
|
-
export {
|
|
16
|
-
export
|
|
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';
|
|
15
|
+
// WebGL adapter classes
|
|
16
|
+
export {WebGLDevice} from './adapter/webgl-device';
|
|
17
|
+
export {WebGLCanvasContext} from './adapter/webgl-canvas-context';
|
|
25
18
|
|
|
26
|
-
|
|
19
|
+
// WebGL Resource classes
|
|
20
|
+
export {WebGLResource, WebGLResource as WEBGLResource} from './adapter/objects/webgl-resource';
|
|
21
|
+
export {WEBGLBuffer} from './adapter/resources/webgl-buffer';
|
|
22
|
+
export {WEBGLTexture} from './adapter/resources/webgl-texture';
|
|
23
|
+
// export {WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';
|
|
24
|
+
export {WEBGLShader} from './adapter/resources/webgl-shader';
|
|
25
|
+
export {WEBGLSampler} from './adapter/resources/webgl-sampler';
|
|
26
|
+
export {WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
|
|
28
|
+
export {WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';
|
|
29
|
+
// export {WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';
|
|
30
|
+
export {WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';
|
|
31
|
+
export {WEBGLRenderPass} from './adapter/resources/webgl-render-pass';
|
|
32
|
+
// export {WEBGLComputePass} from './adapter/resources/webgl-compute-pass';
|
|
33
|
+
export {WEBGLVertexArray} from './adapter/resources/webgl-vertex-array';
|
|
32
34
|
|
|
35
|
+
// Internal WebGL classes
|
|
33
36
|
export type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';
|
|
34
|
-
export {
|
|
35
|
-
|
|
37
|
+
export {WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';
|
|
38
|
+
|
|
39
|
+
// WebGL adapter classes
|
|
40
|
+
export {WEBGLTransformFeedback} from './adapter/resources/webgl-transform-feedback';
|
|
41
|
+
|
|
42
|
+
// WebGL adapter classes
|
|
43
|
+
export {Accessor} from './classic/accessor';
|
|
44
|
+
export type {AccessorObject} from './types';
|
|
36
45
|
|
|
37
46
|
export {
|
|
38
47
|
isWebGL,
|
|
@@ -42,34 +51,60 @@ export {
|
|
|
42
51
|
assertWebGL2Context
|
|
43
52
|
} from './context/context/webgl-checks';
|
|
44
53
|
|
|
45
|
-
// Device ratio
|
|
46
|
-
export {cssToDeviceRatio, cssToDevicePixels} from './context/context/device-pixels';
|
|
47
|
-
|
|
48
54
|
// Unified parameter API
|
|
49
55
|
|
|
50
56
|
export {setDeviceParameters, withDeviceParameters} from './adapter/converters/device-parameters';
|
|
51
57
|
|
|
52
|
-
export type {GLParameters} from '
|
|
58
|
+
export type {GLParameters} from '@luma.gl/constants';
|
|
53
59
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
getGLParameters,
|
|
61
|
+
setGLParameters,
|
|
62
|
+
resetGLParameters
|
|
57
63
|
} from './context/parameters/unified-parameter-api';
|
|
58
64
|
|
|
65
|
+
export {withGLParameters} from './context/state-tracker/with-parameters';
|
|
66
|
+
|
|
67
|
+
// HELPERS - EXPERIMENTAL
|
|
68
|
+
export {getShaderLayout} from './adapter/helpers/get-shader-layout';
|
|
59
69
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
convertGLToTextureFormat,
|
|
71
|
+
_checkFloat32ColorAttachment
|
|
72
|
+
} from './adapter/converters/texture-formats';
|
|
73
|
+
|
|
74
|
+
// TEST EXPORTS
|
|
75
|
+
export {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';
|
|
62
76
|
|
|
77
|
+
// DEPRECATED EXPORTS
|
|
78
|
+
export {clear} from './classic/clear';
|
|
79
|
+
export {readPixelsToBuffer, readPixelsToArray, copyToTexture} from './classic/copy-and-blit';
|
|
63
80
|
// State tracking
|
|
64
81
|
export {
|
|
65
82
|
trackContextState,
|
|
66
83
|
pushContextState,
|
|
67
84
|
popContextState
|
|
68
85
|
} from './context/state-tracker/track-context-state';
|
|
69
|
-
|
|
70
86
|
// Polyfills (supports a subset of WebGL2 APIs on WebGL1 contexts)
|
|
71
87
|
export {polyfillContext} from './context/polyfill/polyfill-context';
|
|
72
88
|
|
|
73
89
|
// HELPERS - EXPERIMENTAL
|
|
74
|
-
export {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';
|
|
75
|
-
export {_checkFloat32ColorAttachment} from './adapter/converters/texture-formats';
|
|
90
|
+
// export {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';
|
|
91
|
+
// export {convertGLToTextureFormat, _checkFloat32ColorAttachment} from './adapter/converters/texture-formats';
|
|
92
|
+
// export {TEXTURE_FORMATS as _TEXTURE_FORMATS} from './adapter/converters/texture-formats';
|
|
93
|
+
|
|
94
|
+
// // WebGL Types - Experimental exports
|
|
95
|
+
// export type {
|
|
96
|
+
// GLDrawMode,
|
|
97
|
+
// GLPrimitive,
|
|
98
|
+
// GLDataType,
|
|
99
|
+
// GLPixelType,
|
|
100
|
+
// GLUniformType,
|
|
101
|
+
// GLSamplerType,
|
|
102
|
+
// GLCompositeType,
|
|
103
|
+
// GLFunction,
|
|
104
|
+
// GLBlendEquation,
|
|
105
|
+
// GLBlendFunction,
|
|
106
|
+
// GLStencilOp,
|
|
107
|
+
// GLSamplerParameters,
|
|
108
|
+
// GLValueParameters,
|
|
109
|
+
// GLFunctionParameters
|
|
110
|
+
// } from '@luma.gl/constants';
|
package/src/types.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
1
4
|
export type AccessorObject = {
|
|
2
5
|
size?: number;
|
|
3
6
|
index?: number;
|
|
@@ -5,4 +8,6 @@ export type AccessorObject = {
|
|
|
5
8
|
divisor?: number;
|
|
6
9
|
offset?: number;
|
|
7
10
|
stride?: number;
|
|
11
|
+
normalized?: boolean;
|
|
12
|
+
integer?: boolean;
|
|
8
13
|
};
|
|
@@ -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":"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","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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { GLDrawMode, GLPrimitive } from '../../types/webgl';
|
|
2
|
-
export declare function getPrimitiveDrawMode(drawMode: GLDrawMode): GLPrimitive;
|
|
3
|
-
export declare function getPrimitiveCount(options: {
|
|
4
|
-
drawMode: GLDrawMode;
|
|
5
|
-
vertexCount: number;
|
|
6
|
-
}): number;
|
|
7
|
-
export declare function getVertexCount(options: {
|
|
8
|
-
drawMode: GLDrawMode;
|
|
9
|
-
vertexCount: number;
|
|
10
|
-
}): number;
|
|
11
|
-
//# sourceMappingURL=attribute-utils.d.ts.map
|