@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
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import GL from '@luma.gl/constants';
|
|
1
|
+
import { GL } from '@luma.gl/constants';
|
|
2
2
|
export function setUniform(gl, location, type, value) {
|
|
3
3
|
const gl2 = gl;
|
|
4
|
-
|
|
5
4
|
if (typeof value === 'number') {
|
|
6
5
|
switch (type) {
|
|
7
6
|
case GL.SAMPLER_2D:
|
|
@@ -22,94 +21,65 @@ export function setUniform(gl, location, type, value) {
|
|
|
22
21
|
return gl.uniform1i(location, value);
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
if (value === true) {
|
|
27
25
|
value = 1;
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
if (value === false) {
|
|
31
|
-
value =
|
|
28
|
+
value = 0;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
const arrayValue = typeof value === 'number' ? [value] : value;
|
|
35
|
-
|
|
36
31
|
switch (type) {
|
|
37
32
|
case GL.FLOAT:
|
|
38
33
|
return gl.uniform1fv(location, arrayValue);
|
|
39
|
-
|
|
40
34
|
case GL.FLOAT_VEC2:
|
|
41
35
|
return gl.uniform2fv(location, arrayValue);
|
|
42
|
-
|
|
43
36
|
case GL.FLOAT_VEC3:
|
|
44
37
|
return gl.uniform3fv(location, arrayValue);
|
|
45
|
-
|
|
46
38
|
case GL.FLOAT_VEC4:
|
|
47
39
|
return gl.uniform4fv(location, arrayValue);
|
|
48
|
-
|
|
49
40
|
case GL.INT:
|
|
50
41
|
return gl.uniform1iv(location, arrayValue);
|
|
51
|
-
|
|
52
42
|
case GL.INT_VEC2:
|
|
53
43
|
return gl.uniform2iv(location, arrayValue);
|
|
54
|
-
|
|
55
44
|
case GL.INT_VEC3:
|
|
56
45
|
return gl.uniform3iv(location, arrayValue);
|
|
57
|
-
|
|
58
46
|
case GL.INT_VEC4:
|
|
59
47
|
return gl.uniform4iv(location, arrayValue);
|
|
60
|
-
|
|
61
48
|
case GL.BOOL:
|
|
62
49
|
return gl.uniform1iv(location, arrayValue);
|
|
63
|
-
|
|
64
50
|
case GL.BOOL_VEC2:
|
|
65
51
|
return gl.uniform2iv(location, arrayValue);
|
|
66
|
-
|
|
67
52
|
case GL.BOOL_VEC3:
|
|
68
53
|
return gl.uniform3iv(location, arrayValue);
|
|
69
|
-
|
|
70
54
|
case GL.BOOL_VEC4:
|
|
71
|
-
gl.uniform4iv(location, arrayValue);
|
|
72
|
-
|
|
55
|
+
return gl.uniform4iv(location, arrayValue);
|
|
73
56
|
case GL.UNSIGNED_INT:
|
|
74
57
|
return gl2.uniform1uiv(location, arrayValue, 1);
|
|
75
|
-
|
|
76
58
|
case GL.UNSIGNED_INT_VEC2:
|
|
77
59
|
return gl2.uniform2uiv(location, arrayValue, 2);
|
|
78
|
-
|
|
79
60
|
case GL.UNSIGNED_INT_VEC3:
|
|
80
61
|
return gl2.uniform3uiv(location, arrayValue, 3);
|
|
81
|
-
|
|
82
62
|
case GL.UNSIGNED_INT_VEC4:
|
|
83
63
|
return gl2.uniform4uiv(location, arrayValue, 4);
|
|
84
|
-
|
|
85
64
|
case GL.FLOAT_MAT2:
|
|
86
65
|
return gl.uniformMatrix2fv(location, false, arrayValue);
|
|
87
|
-
|
|
88
66
|
case GL.FLOAT_MAT3:
|
|
89
67
|
return gl.uniformMatrix3fv(location, false, arrayValue);
|
|
90
|
-
|
|
91
68
|
case GL.FLOAT_MAT4:
|
|
92
69
|
return gl.uniformMatrix4fv(location, false, arrayValue);
|
|
93
|
-
|
|
94
70
|
case GL.FLOAT_MAT2x3:
|
|
95
71
|
return gl2.uniformMatrix2x3fv(location, false, arrayValue);
|
|
96
|
-
|
|
97
72
|
case GL.FLOAT_MAT2x4:
|
|
98
73
|
return gl2.uniformMatrix2x4fv(location, false, arrayValue);
|
|
99
|
-
|
|
100
74
|
case GL.FLOAT_MAT3x2:
|
|
101
75
|
return gl2.uniformMatrix3x2fv(location, false, arrayValue);
|
|
102
|
-
|
|
103
76
|
case GL.FLOAT_MAT3x4:
|
|
104
77
|
return gl2.uniformMatrix3x4fv(location, false, arrayValue);
|
|
105
|
-
|
|
106
78
|
case GL.FLOAT_MAT4x2:
|
|
107
79
|
return gl2.uniformMatrix4x2fv(location, false, arrayValue);
|
|
108
|
-
|
|
109
80
|
case GL.FLOAT_MAT4x3:
|
|
110
81
|
return gl2.uniformMatrix4x3fv(location, false, arrayValue);
|
|
111
82
|
}
|
|
112
|
-
|
|
113
83
|
throw new Error('Illegal uniform');
|
|
114
84
|
}
|
|
115
85
|
//# sourceMappingURL=set-uniform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"set-uniform.js","names":["GL","setUniform","gl","location","type","value","gl2","SAMPLER_2D","SAMPLER_CUBE","SAMPLER_3D","SAMPLER_2D_SHADOW","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_CUBE_SHADOW","INT_SAMPLER_2D","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_SAMPLER_2D_ARRAY","uniform1i","arrayValue","FLOAT","uniform1fv","FLOAT_VEC2","uniform2fv","FLOAT_VEC3","uniform3fv","FLOAT_VEC4","uniform4fv","INT","uniform1iv","INT_VEC2","uniform2iv","INT_VEC3","uniform3iv","INT_VEC4","uniform4iv","BOOL","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","UNSIGNED_INT","uniform1uiv","UNSIGNED_INT_VEC2","uniform2uiv","UNSIGNED_INT_VEC3","uniform3uiv","UNSIGNED_INT_VEC4","uniform4uiv","FLOAT_MAT2","uniformMatrix2fv","FLOAT_MAT3","uniformMatrix3fv","FLOAT_MAT4","uniformMatrix4fv","FLOAT_MAT2x3","uniformMatrix2x3fv","FLOAT_MAT2x4","uniformMatrix2x4fv","FLOAT_MAT3x2","uniformMatrix3x2fv","FLOAT_MAT3x4","uniformMatrix3x4fv","FLOAT_MAT4x2","uniformMatrix4x2fv","FLOAT_MAT4x3","uniformMatrix4x3fv","Error"],"sources":["../../../src/adapter/helpers/set-uniform.ts"],"sourcesContent":["/* eslint-disable */\n\n// Uniforms\nimport {GL} from '@luma.gl/constants';\n\n/** Set a raw uniform (without type conversion and caching) */\n/* eslint-disable max-len */\nexport function setUniform(\n gl: WebGLRenderingContext,\n location: WebGLUniformLocation,\n type: GL,\n value: number | Float32Array | Int32Array | Uint32Array | boolean\n): void {\n const gl2 = gl as WebGL2RenderingContext;\n\n if (typeof value === 'number') {\n // prettier-ignore\n switch (type) {\n // WebGL1 samplers\n case GL.SAMPLER_2D:\n case GL.SAMPLER_CUBE:\n // WebGL2 samplers\n case GL.SAMPLER_3D:\n case GL.SAMPLER_2D_SHADOW:\n case GL.SAMPLER_2D_ARRAY:\n case GL.SAMPLER_2D_ARRAY_SHADOW:\n case GL.SAMPLER_CUBE_SHADOW:\n case GL.INT_SAMPLER_2D:\n case GL.INT_SAMPLER_3D:\n case GL.INT_SAMPLER_CUBE:\n case GL.INT_SAMPLER_2D_ARRAY:\n case GL.UNSIGNED_INT_SAMPLER_2D:\n case GL.UNSIGNED_INT_SAMPLER_3D:\n case GL.UNSIGNED_INT_SAMPLER_CUBE:\n case GL.UNSIGNED_INT_SAMPLER_2D_ARRAY:\n return gl.uniform1i(location, value);\n }\n }\n\n if (value === true) {\n value = 1;\n }\n\n if (value === false) {\n value = 0;\n }\n const arrayValue = (typeof value === 'number') ? [value] : value;\n\n // prettier-ignore\n switch (type) {\n case GL.FLOAT: return gl.uniform1fv(location, arrayValue);\n case GL.FLOAT_VEC2: return gl.uniform2fv(location, arrayValue);\n case GL.FLOAT_VEC3: return gl.uniform3fv(location, arrayValue);\n case GL.FLOAT_VEC4: return gl.uniform4fv(location, arrayValue);\n\n case GL.INT: return gl.uniform1iv(location, arrayValue);\n case GL.INT_VEC2: return gl.uniform2iv(location, arrayValue);\n case GL.INT_VEC3: return gl.uniform3iv(location, arrayValue);\n case GL.INT_VEC4: return gl.uniform4iv(location, arrayValue);\n\n case GL.BOOL: return gl.uniform1iv(location, arrayValue);\n case GL.BOOL_VEC2: return gl.uniform2iv(location, arrayValue);\n case GL.BOOL_VEC3: return gl.uniform3iv(location, arrayValue);\n case GL.BOOL_VEC4: return gl.uniform4iv(location, arrayValue);\n\n // WEBGL2 - unsigned integers\n case GL.UNSIGNED_INT: return gl2.uniform1uiv(location, arrayValue, 1);\n case GL.UNSIGNED_INT_VEC2: return gl2.uniform2uiv(location, arrayValue, 2);\n case GL.UNSIGNED_INT_VEC3: return gl2.uniform3uiv(location, arrayValue, 3);\n case GL.UNSIGNED_INT_VEC4: return gl2.uniform4uiv(location, arrayValue, 4);\n\n // WebGL2 - quadratic matrices\n // false: don't transpose the matrix\n case GL.FLOAT_MAT2: return gl.uniformMatrix2fv(location, false, arrayValue);\n case GL.FLOAT_MAT3: return gl.uniformMatrix3fv(location, false, arrayValue);\n case GL.FLOAT_MAT4: return gl.uniformMatrix4fv(location, false, arrayValue);\n\n // WebGL2 - rectangular matrices\n case GL.FLOAT_MAT2x3: return gl2.uniformMatrix2x3fv(location, false, arrayValue);\n case GL.FLOAT_MAT2x4: return gl2.uniformMatrix2x4fv(location, false, arrayValue);\n case GL.FLOAT_MAT3x2: return gl2.uniformMatrix3x2fv(location, false, arrayValue);\n case GL.FLOAT_MAT3x4: return gl2.uniformMatrix3x4fv(location, false, arrayValue);\n case GL.FLOAT_MAT4x2: return gl2.uniformMatrix4x2fv(location, false, arrayValue);\n case GL.FLOAT_MAT4x3: return gl2.uniformMatrix4x3fv(location, false, arrayValue);\n }\n\n throw new Error('Illegal uniform');\n}\n"],"mappings":"AAGA,SAAQA,EAAE,QAAO,oBAAoB;AAIrC,OAAO,SAASC,UAAUA,CACxBC,EAAyB,EACzBC,QAA8B,EAC9BC,IAAQ,EACRC,KAAiE,EAC3D;EACN,MAAMC,GAAG,GAAGJ,EAA4B;EAExC,IAAI,OAAOG,KAAK,KAAK,QAAQ,EAAE;IAE7B,QAAQD,IAAI;MAEV,KAAKJ,EAAE,CAACO,UAAU;MAClB,KAAKP,EAAE,CAACQ,YAAY;MAEpB,KAAKR,EAAE,CAACS,UAAU;MAClB,KAAKT,EAAE,CAACU,iBAAiB;MACzB,KAAKV,EAAE,CAACW,gBAAgB;MACxB,KAAKX,EAAE,CAACY,uBAAuB;MAC/B,KAAKZ,EAAE,CAACa,mBAAmB;MAC3B,KAAKb,EAAE,CAACc,cAAc;MACtB,KAAKd,EAAE,CAACe,cAAc;MACtB,KAAKf,EAAE,CAACgB,gBAAgB;MACxB,KAAKhB,EAAE,CAACiB,oBAAoB;MAC5B,KAAKjB,EAAE,CAACkB,uBAAuB;MAC/B,KAAKlB,EAAE,CAACmB,uBAAuB;MAC/B,KAAKnB,EAAE,CAACoB,yBAAyB;MACjC,KAAKpB,EAAE,CAACqB,6BAA6B;QACnC,OAAOnB,EAAE,CAACoB,SAAS,CAACnB,QAAQ,EAAEE,KAAK,CAAC;IACxC;EACF;EAEA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAClBA,KAAK,GAAG,CAAC;EACX;EAEA,IAAIA,KAAK,KAAK,KAAK,EAAE;IACnBA,KAAK,GAAG,CAAC;EACX;EACA,MAAMkB,UAAU,GAAI,OAAOlB,KAAK,KAAK,QAAQ,GAAI,CAACA,KAAK,CAAC,GAAGA,KAAK;EAGhE,QAAQD,IAAI;IACV,KAAKJ,EAAE,CAACwB,KAAK;MAAE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2D,kBAAkB,CAAC9D,QAAQ,EAAE,KAAK,EAAEoB,UAAU,CAAC;IAChF,KAAKvB,EAAE,CAACkE,YAAY;MAAE,OAAO5D,GAAG,CAAC6D,kBAAkB,CAAChE,QAAQ,EAAE,KAAK,EAAEoB,UAAU,CAAC;IAChF,KAAKvB,EAAE,CAACoE,YAAY;MAAE,OAAO9D,GAAG,CAAC+D,kBAAkB,CAAClE,QAAQ,EAAE,KAAK,EAAEoB,UAAU,CAAC;EAClF;EAEA,MAAM,IAAI+C,KAAK,CAAC,iBAAiB,CAAC;AACpC"}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { UniformFormat, VertexFormat } from '@luma.gl/
|
|
2
|
-
import GL from '@luma.gl/constants';
|
|
3
|
-
import { GLUniformType, GLCompositeType, GLType } from '../../types/webgl';
|
|
1
|
+
import { UniformFormat, VertexFormat } from '@luma.gl/core';
|
|
2
|
+
import { GL, GLUniformType, GLCompositeType, GLDataType } from '@luma.gl/constants';
|
|
4
3
|
/** Check is uniform is of sampler type */
|
|
5
4
|
export declare function isSamplerUniform(type: GLUniformType): boolean;
|
|
6
5
|
/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */
|
|
7
6
|
export declare function decodeUniformType(uniformType: GL): {
|
|
8
7
|
format: UniformFormat;
|
|
9
8
|
components: number;
|
|
10
|
-
glType:
|
|
9
|
+
glType: GLDataType;
|
|
11
10
|
};
|
|
12
|
-
export declare function decodeAttributeType(
|
|
11
|
+
export declare function decodeAttributeType(attributeType: GL): {
|
|
13
12
|
format: VertexFormat;
|
|
14
13
|
components: number;
|
|
15
|
-
glType:
|
|
14
|
+
glType: GLDataType;
|
|
16
15
|
};
|
|
17
16
|
/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */
|
|
18
|
-
export declare function
|
|
19
|
-
type:
|
|
17
|
+
export declare function decomposeCompositeGLDataType(compositeGLDataType: GLCompositeType): {
|
|
18
|
+
type: GLDataType;
|
|
20
19
|
components: number;
|
|
21
20
|
} | null;
|
|
22
|
-
export declare function
|
|
23
|
-
glType:
|
|
21
|
+
export declare function getCompositeGLDataType(type: GL, components: any): {
|
|
22
|
+
glType: GLDataType;
|
|
24
23
|
name: string;
|
|
25
24
|
} | null;
|
|
26
25
|
//# sourceMappingURL=uniforms.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniforms.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/uniforms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"uniforms.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/uniforms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,EAAE,EAAE,aAAa,EAAiB,eAAe,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEjG,0CAA0C;AAC1C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAE7D;AA0DD,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,EAAE,GACd;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAC,CAOjE;AAED,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,EAAE,GAAG;IACtD,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;CACpB,CAOA;AAED,0FAA0F;AAC1F,wBAAgB,4BAA4B,CAC1C,mBAAmB,EAAE,eAAe,GACnC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAO/C;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,KAAA,GAAG;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAkBtG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import GL from '@luma.gl/constants';
|
|
1
|
+
import { GL } from '@luma.gl/constants';
|
|
2
2
|
export function isSamplerUniform(type) {
|
|
3
3
|
return SAMPLER_TYPES.includes(type);
|
|
4
4
|
}
|
|
@@ -32,11 +32,9 @@ const COMPOSITE_GL_TYPES = {
|
|
|
32
32
|
};
|
|
33
33
|
export function decodeUniformType(uniformType) {
|
|
34
34
|
const typeAndSize = COMPOSITE_GL_TYPES[uniformType];
|
|
35
|
-
|
|
36
35
|
if (!typeAndSize) {
|
|
37
|
-
|
|
36
|
+
throw new Error('uniform');
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
const [glType, components,, format] = typeAndSize;
|
|
41
39
|
return {
|
|
42
40
|
format,
|
|
@@ -44,13 +42,11 @@ export function decodeUniformType(uniformType) {
|
|
|
44
42
|
glType
|
|
45
43
|
};
|
|
46
44
|
}
|
|
47
|
-
export function decodeAttributeType(
|
|
48
|
-
const typeAndSize = COMPOSITE_GL_TYPES[
|
|
49
|
-
|
|
45
|
+
export function decodeAttributeType(attributeType) {
|
|
46
|
+
const typeAndSize = COMPOSITE_GL_TYPES[attributeType];
|
|
50
47
|
if (!typeAndSize) {
|
|
51
|
-
|
|
48
|
+
throw new Error('attribute');
|
|
52
49
|
}
|
|
53
|
-
|
|
54
50
|
const [glType, components,,, format] = typeAndSize;
|
|
55
51
|
return {
|
|
56
52
|
format,
|
|
@@ -58,20 +54,18 @@ export function decodeAttributeType(uniformType) {
|
|
|
58
54
|
glType
|
|
59
55
|
};
|
|
60
56
|
}
|
|
61
|
-
export function
|
|
62
|
-
const typeAndSize = COMPOSITE_GL_TYPES[
|
|
63
|
-
|
|
57
|
+
export function decomposeCompositeGLDataType(compositeGLDataType) {
|
|
58
|
+
const typeAndSize = COMPOSITE_GL_TYPES[compositeGLDataType];
|
|
64
59
|
if (!typeAndSize) {
|
|
65
60
|
return null;
|
|
66
61
|
}
|
|
67
|
-
|
|
68
62
|
const [type, components] = typeAndSize;
|
|
69
63
|
return {
|
|
70
64
|
type,
|
|
71
65
|
components
|
|
72
66
|
};
|
|
73
67
|
}
|
|
74
|
-
export function
|
|
68
|
+
export function getCompositeGLDataType(type, components) {
|
|
75
69
|
switch (type) {
|
|
76
70
|
case GL.BYTE:
|
|
77
71
|
case GL.UNSIGNED_BYTE:
|
|
@@ -79,13 +73,10 @@ export function getCompositeGLType(type, components) {
|
|
|
79
73
|
case GL.UNSIGNED_SHORT:
|
|
80
74
|
type = GL.FLOAT;
|
|
81
75
|
break;
|
|
82
|
-
|
|
83
76
|
default:
|
|
84
77
|
}
|
|
85
|
-
|
|
86
78
|
for (const glType in COMPOSITE_GL_TYPES) {
|
|
87
79
|
const [compType, compComponents, name] = COMPOSITE_GL_TYPES[glType];
|
|
88
|
-
|
|
89
80
|
if (compType === type && compComponents === components) {
|
|
90
81
|
return {
|
|
91
82
|
glType: Number(glType),
|
|
@@ -93,7 +84,6 @@ export function getCompositeGLType(type, components) {
|
|
|
93
84
|
};
|
|
94
85
|
}
|
|
95
86
|
}
|
|
96
|
-
|
|
97
87
|
return null;
|
|
98
88
|
}
|
|
99
89
|
//# sourceMappingURL=uniforms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"uniforms.js","names":["GL","isSamplerUniform","type","SAMPLER_TYPES","includes","SAMPLER_2D","SAMPLER_CUBE","SAMPLER_3D","SAMPLER_2D_SHADOW","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_CUBE_SHADOW","INT_SAMPLER_2D","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_SAMPLER_2D_ARRAY","COMPOSITE_GL_TYPES","FLOAT","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","INT","INT_VEC2","INT_VEC3","INT_VEC4","UNSIGNED_INT","UNSIGNED_INT_VEC2","UNSIGNED_INT_VEC3","UNSIGNED_INT_VEC4","BOOL","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","FLOAT_MAT2","FLOAT_MAT2x3","FLOAT_MAT2x4","FLOAT_MAT3x2","FLOAT_MAT3","FLOAT_MAT3x4","FLOAT_MAT4x2","FLOAT_MAT4x3","FLOAT_MAT4","decodeUniformType","uniformType","typeAndSize","Error","glType","components","format","decodeAttributeType","attributeType","decomposeCompositeGLDataType","compositeGLDataType","getCompositeGLDataType","BYTE","UNSIGNED_BYTE","SHORT","UNSIGNED_SHORT","compType","compComponents","name","Number"],"sources":["../../../src/adapter/helpers/uniforms.ts"],"sourcesContent":["import {UniformFormat, VertexFormat} from '@luma.gl/core';\nimport {GL, GLUniformType, GLSamplerType, GLCompositeType, GLDataType} from '@luma.gl/constants';\n\n/** Check is uniform is of sampler type */\nexport function isSamplerUniform(type: GLUniformType): boolean {\n return SAMPLER_TYPES.includes(type as GLSamplerType);\n}\n\nconst SAMPLER_TYPES: GLSamplerType[] = [\n GL.SAMPLER_2D,\n GL.SAMPLER_CUBE,\n GL.SAMPLER_3D,\n GL.SAMPLER_2D_SHADOW,\n GL.SAMPLER_2D_ARRAY,\n GL.SAMPLER_2D_ARRAY_SHADOW,\n GL.SAMPLER_CUBE_SHADOW,\n GL.INT_SAMPLER_2D,\n GL.INT_SAMPLER_3D,\n GL.INT_SAMPLER_CUBE,\n GL.INT_SAMPLER_2D_ARRAY,\n GL.UNSIGNED_INT_SAMPLER_2D,\n GL.UNSIGNED_INT_SAMPLER_3D,\n GL.UNSIGNED_INT_SAMPLER_CUBE,\n GL.UNSIGNED_INT_SAMPLER_2D_ARRAY\n];\n\n// Composite types table\nconst COMPOSITE_GL_TYPES: Record<\n GLCompositeType,\n [GLDataType, number, string, UniformFormat, VertexFormat?]\n> = {\n [GL.FLOAT]: [GL.FLOAT, 1, 'float', 'f32', 'float32'],\n [GL.FLOAT_VEC2]: [GL.FLOAT, 2, 'vec2', 'vec2<f32>', 'float32x2'],\n [GL.FLOAT_VEC3]: [GL.FLOAT, 3, 'vec3', 'vec3<f32>', 'float32x3'],\n [GL.FLOAT_VEC4]: [GL.FLOAT, 4, 'vec4', 'vec4<f32>', 'float32x4'],\n\n [GL.INT]: [GL.INT, 1, 'int', 'i32', 'sint32'],\n [GL.INT_VEC2]: [GL.INT, 2, 'ivec2', 'vec2<i32>', 'sint32x2'],\n [GL.INT_VEC3]: [GL.INT, 3, 'ivec3', 'vec3<i32>', 'sint32x3'],\n [GL.INT_VEC4]: [GL.INT, 4, 'ivec4', 'vec4<i32>', 'sint32x4'],\n\n [GL.UNSIGNED_INT]: [GL.UNSIGNED_INT, 1, 'uint', 'u32', 'uint32'],\n [GL.UNSIGNED_INT_VEC2]: [GL.UNSIGNED_INT, 2, 'uvec2', 'vec2<u32>', 'uint32x2'],\n [GL.UNSIGNED_INT_VEC3]: [GL.UNSIGNED_INT, 3, 'uvec3', 'vec3<u32>', 'uint32x3'],\n [GL.UNSIGNED_INT_VEC4]: [GL.UNSIGNED_INT, 4, 'uvec4', 'vec4<u32>', 'uint32x4'],\n\n [GL.BOOL]: [GL.FLOAT, 1, 'bool', 'f32', 'float32x2'],\n [GL.BOOL_VEC2]: [GL.FLOAT, 2, 'bvec2', 'vec2<f32>'],\n [GL.BOOL_VEC3]: [GL.FLOAT, 3, 'bvec3', 'vec3<f32>'],\n [GL.BOOL_VEC4]: [GL.FLOAT, 4, 'bvec4', 'vec4<f32>'],\n\n [GL.FLOAT_MAT2]: [GL.FLOAT, 8, 'mat2', 'mat2x2<f32>'], // 4\n [GL.FLOAT_MAT2x3]: [GL.FLOAT, 8, 'mat2x3', 'mat2x3<f32>'], // 6\n [GL.FLOAT_MAT2x4]: [GL.FLOAT, 8, 'mat2x4', 'mat2x4<f32>'], // 8\n\n [GL.FLOAT_MAT3x2]: [GL.FLOAT, 12, 'mat3x2', 'mat3x2<f32>'], // 6\n [GL.FLOAT_MAT3]: [GL.FLOAT, 12, 'mat3', 'mat3x3<f32>'], // 9\n [GL.FLOAT_MAT3x4]: [GL.FLOAT, 12, 'mat3x4', 'mat3x4<f32>'], // 12\n\n [GL.FLOAT_MAT4x2]: [GL.FLOAT, 16, 'mat4x2', 'mat4x2<f32>'], // 8\n [GL.FLOAT_MAT4x3]: [GL.FLOAT, 16, 'mat4x3', 'mat4x3<f32>'], // 12\n [GL.FLOAT_MAT4]: [GL.FLOAT, 16, 'mat4', 'mat4x4<f32>'] // 16\n};\n\n/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */\nexport function decodeUniformType(\n uniformType: GL\n): {format: UniformFormat; components: number; glType: GLDataType} {\n const typeAndSize = COMPOSITE_GL_TYPES[uniformType];\n if (!typeAndSize) {\n throw new Error('uniform');\n }\n const [glType, components, , format] = typeAndSize;\n return {format, components, glType};\n}\n\nexport function decodeAttributeType(attributeType: GL): {\n format: VertexFormat;\n components: number;\n glType: GLDataType;\n} {\n const typeAndSize = COMPOSITE_GL_TYPES[attributeType];\n if (!typeAndSize) {\n throw new Error('attribute')\n }\n const [glType, components, , , format] = typeAndSize;\n return {format, components, glType};\n}\n\n/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */\nexport function decomposeCompositeGLDataType(\n compositeGLDataType: GLCompositeType\n): {type: GLDataType; components: number} | null {\n const typeAndSize = COMPOSITE_GL_TYPES[compositeGLDataType];\n if (!typeAndSize) {\n return null;\n }\n const [type, components] = typeAndSize;\n return {type, components};\n}\n\nexport function getCompositeGLDataType(type: GL, components): {glType: GLDataType; name: string} | null {\n switch (type) {\n case GL.BYTE:\n case GL.UNSIGNED_BYTE:\n case GL.SHORT:\n case GL.UNSIGNED_SHORT:\n type = GL.FLOAT;\n break;\n default:\n }\n\n for (const glType in COMPOSITE_GL_TYPES) {\n const [compType, compComponents, name] = COMPOSITE_GL_TYPES[glType];\n if (compType === type && compComponents === components) {\n return {glType: Number(glType), name};\n }\n }\n return null;\n}\n"],"mappings":"AACA,SAAQA,EAAE,QAAkE,oBAAoB;AAGhG,OAAO,SAASC,gBAAgBA,CAACC,IAAmB,EAAW;EAC7D,OAAOC,aAAa,CAACC,QAAQ,CAACF,IAAqB,CAAC;AACtD;AAEA,MAAMC,aAA8B,GAAG,CACrCH,EAAE,CAACK,UAAU,EACbL,EAAE,CAACM,YAAY,EACfN,EAAE,CAACO,UAAU,EACbP,EAAE,CAACQ,iBAAiB,EACpBR,EAAE,CAACS,gBAAgB,EACnBT,EAAE,CAACU,uBAAuB,EAC1BV,EAAE,CAACW,mBAAmB,EACtBX,EAAE,CAACY,cAAc,EACjBZ,EAAE,CAACa,cAAc,EACjBb,EAAE,CAACc,gBAAgB,EACnBd,EAAE,CAACe,oBAAoB,EACvBf,EAAE,CAACgB,uBAAuB,EAC1BhB,EAAE,CAACiB,uBAAuB,EAC1BjB,EAAE,CAACkB,yBAAyB,EAC5BlB,EAAE,CAACmB,6BAA6B,CACjC;AAGD,MAAMC,kBAGL,GAAG;EACF,CAACpB,EAAE,CAACqB,KAAK,GAAG,CAACrB,EAAE,CAACqB,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC;EACpD,CAACrB,EAAE,CAACsB,UAAU,GAAG,CAACtB,EAAE,CAACqB,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC;EAChE,CAACrB,EAAE,CAACuB,UAAU,GAAG,CAACvB,EAAE,CAACqB,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC;EAChE,CAACrB,EAAE,CAACwB,UAAU,GAAG,CAACxB,EAAE,CAACqB,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAA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,QAAQ,EAAEC,cAAc,EAAEC,IAAI,CAAC,GAAG5C,kBAAkB,CAAC8B,MAAM,CAAC;IACnE,IAAIY,QAAQ,KAAK5D,IAAI,IAAI6D,cAAc,KAAKZ,UAAU,EAAE;MACtD,OAAO;QAACD,MAAM,EAAEe,MAAM,CAACf,MAAM,CAAC;QAAEc;MAAI,CAAC;IACvC;EACF;EACA,OAAO,IAAI;AACb"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import GL from '@luma.gl/constants';
|
|
1
|
+
import { GL } from '@luma.gl/constants';
|
|
2
2
|
export declare function getKeyValue(gl: WebGLRenderingContext, name: string | GL): GL;
|
|
3
|
-
export declare function getKey(gl: WebGLRenderingContext, value: any): string;
|
|
4
|
-
export declare function getKeyType(gl: WebGLRenderingContext, value: any): string;
|
|
5
3
|
//# sourceMappingURL=constants-to-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-to-keys.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/constants-to-keys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"constants-to-keys.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/constants-to-keys.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AAGtC,wBAAgB,WAAW,CAAC,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,GAAG,EAAE,CAkB5E"}
|
|
@@ -1,42 +1,15 @@
|
|
|
1
|
-
import { assert } from '@luma.gl/
|
|
1
|
+
import { assert } from '@luma.gl/core';
|
|
2
2
|
export function getKeyValue(gl, name) {
|
|
3
3
|
if (typeof name !== 'string') {
|
|
4
4
|
return name;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
6
|
const number = Number(name);
|
|
8
|
-
|
|
9
7
|
if (!isNaN(number)) {
|
|
10
8
|
return number;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
name = name.replace(/^.*\./, '');
|
|
14
11
|
const value = gl[name];
|
|
15
12
|
assert(value !== undefined, "Accessing undefined constant GL.".concat(name));
|
|
16
13
|
return value;
|
|
17
14
|
}
|
|
18
|
-
export function getKey(gl, value) {
|
|
19
|
-
gl = gl.gl || gl;
|
|
20
|
-
value = Number(value);
|
|
21
|
-
|
|
22
|
-
for (const key in gl) {
|
|
23
|
-
if (gl[key] === value) {
|
|
24
|
-
return "GL.".concat(key);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return String(value);
|
|
29
|
-
}
|
|
30
|
-
export function getKeyType(gl, value) {
|
|
31
|
-
assert(value !== undefined, 'undefined key');
|
|
32
|
-
value = Number(value);
|
|
33
|
-
|
|
34
|
-
for (const key in gl) {
|
|
35
|
-
if (gl[key] === value) {
|
|
36
|
-
return "GL.".concat(key);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return String(value);
|
|
41
|
-
}
|
|
42
15
|
//# sourceMappingURL=constants-to-keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"constants-to-keys.js","names":["assert","getKeyValue","gl","name","number","Number","isNaN","replace","value","undefined","concat"],"sources":["../../../src/adapter/objects/constants-to-keys.ts"],"sourcesContent":["import {assert} from '@luma.gl/core';\nimport {GL} from '@luma.gl/constants';\n\n// Resolve a WebGL enumeration name (returns itself if already a number)\nexport function getKeyValue(gl: WebGLRenderingContext, name: string | GL): GL {\n // If not a string, return (assume number)\n if (typeof name !== 'string') {\n return name;\n }\n\n // If string converts to number, return number\n const number = Number(name);\n if (!isNaN(number)) {\n return number;\n }\n\n // Look up string, after removing any 'GL.' or 'gl.' prefix\n name = name.replace(/^.*\\./, '');\n // @ts-ignore expect-error depends on settings\n const value = gl[name];\n assert(value !== undefined, `Accessing undefined constant GL.${name}`);\n return value;\n}\n"],"mappings":"AAAA,SAAQA,MAAM,QAAO,eAAe;AAIpC,OAAO,SAASC,WAAWA,CAACC,EAAyB,EAAEC,IAAiB,EAAM;EAE5E,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAOA,IAAI;EACb;EAGA,MAAMC,MAAM,GAAGC,MAAM,CAACF,IAAI,CAAC;EAC3B,IAAI,CAACG,KAAK,CAACF,MAAM,CAAC,EAAE;IAClB,OAAOA,MAAM;EACf;EAGAD,IAAI,GAAGA,IAAI,CAACI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAEhC,MAAMC,KAAK,GAAGN,EAAE,CAACC,IAAI,CAAC;EACtBH,MAAM,CAACQ,KAAK,KAAKC,SAAS,qCAAAC,MAAA,CAAqCP,IAAI,CAAE,CAAC;EACtE,OAAOK,KAAK;AACd"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ResourceProps } from '@luma.gl/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ResourceProps, TextureFormat } from '@luma.gl/core';
|
|
2
|
+
import { GL } from '@luma.gl/constants';
|
|
3
|
+
import { WebGLDevice } from '../webgl-device';
|
|
4
|
+
import { WebGLResource } from './webgl-resource';
|
|
5
|
+
export type RenderbufferProps = ResourceProps & {
|
|
6
|
+
format: TextureFormat;
|
|
6
7
|
width?: number;
|
|
7
8
|
height?: number;
|
|
8
9
|
samples?: number;
|
|
@@ -17,22 +18,24 @@ export declare type RenderbufferProps = ResourceProps & {
|
|
|
17
18
|
* use Textures instead.
|
|
18
19
|
* Renderbuffer objects also natively accommodate Multisampling (MSAA).
|
|
19
20
|
*/
|
|
20
|
-
export
|
|
21
|
+
export declare class WEBGLRenderbuffer extends WebGLResource<RenderbufferProps> {
|
|
22
|
+
static readonly defaultProps: Required<RenderbufferProps>;
|
|
21
23
|
get [Symbol.toStringTag](): string;
|
|
22
24
|
get width(): number;
|
|
23
25
|
get height(): number;
|
|
24
|
-
get format():
|
|
26
|
+
get format(): TextureFormat;
|
|
25
27
|
get samples(): number;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
get attachment(): void;
|
|
29
|
+
/** WebGL format constant */
|
|
30
|
+
glFormat: GL;
|
|
31
|
+
static isTextureFormatSupported(device: WebGLDevice, format: TextureFormat): boolean;
|
|
29
32
|
constructor(device: WebGLDevice, props: RenderbufferProps);
|
|
30
33
|
resize(size: {
|
|
31
34
|
width: number;
|
|
32
35
|
height: number;
|
|
33
|
-
}):
|
|
36
|
+
}): void;
|
|
34
37
|
/** Creates and initializes a renderbuffer object's data store */
|
|
35
|
-
protected _initialize(props: Required<RenderbufferProps>):
|
|
38
|
+
protected _initialize(props: Required<RenderbufferProps>): void;
|
|
36
39
|
_createHandle(): WebGLRenderbuffer;
|
|
37
40
|
_deleteHandle(): void;
|
|
38
41
|
_bindHandle(handle: WEBGLRenderbuffer): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-renderbuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-renderbuffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl-renderbuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-renderbuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,aAAa,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAI/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,qBAAa,iBAAkB,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IACrE,gBAAyB,YAAY,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAQhE;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAA2B;IAEtE,IAAI,KAAK,IAAI,MAAM,CAA6B;IAChD,IAAI,MAAM,IAAI,MAAM,CAA8B;IAClD,IAAI,MAAM,IAAI,aAAa,CAA8B;IACzD,IAAI,OAAO,IAAI,MAAM,CAA+B;IACpD,IAAI,UAAU,SAAc;IAE5B,4BAA4B;IAC5B,QAAQ,EAAE,EAAE,CAAC;IAEb,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;gBAIxE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,iBAAiB;IAUzD,MAAM,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI;IAUnD,iEAAiE;IACjE,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAuBtD,aAAa;IAIb,aAAa,IAAI,IAAI;IAKrB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAGtD"}
|
|
@@ -1,60 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
height: 1,
|
|
12
|
-
samples: 0
|
|
13
|
-
};
|
|
14
|
-
export default class WEBGLRenderbuffer extends WebGLResource {
|
|
15
|
-
get [Symbol.toStringTag]() {
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
let _Symbol$toStringTag;
|
|
3
|
+
import { assert } from '@luma.gl/core';
|
|
4
|
+
import { GL } from '@luma.gl/constants';
|
|
5
|
+
import { WebGLResource } from "./webgl-resource.js";
|
|
6
|
+
import { isRenderbufferFormatSupported } from "../converters/texture-formats.js";
|
|
7
|
+
import { convertTextureFormatToGL, getTextureFormatBytesPerPixel } from "../converters/texture-formats.js";
|
|
8
|
+
_Symbol$toStringTag = Symbol.toStringTag;
|
|
9
|
+
export class WEBGLRenderbuffer extends WebGLResource {
|
|
10
|
+
get [_Symbol$toStringTag]() {
|
|
16
11
|
return 'Renderbuffer';
|
|
17
12
|
}
|
|
18
|
-
|
|
19
13
|
get width() {
|
|
20
14
|
return this.props.width;
|
|
21
15
|
}
|
|
22
|
-
|
|
23
16
|
get height() {
|
|
24
17
|
return this.props.height;
|
|
25
18
|
}
|
|
26
|
-
|
|
27
19
|
get format() {
|
|
28
20
|
return this.props.format;
|
|
29
21
|
}
|
|
30
|
-
|
|
31
22
|
get samples() {
|
|
32
23
|
return this.props.samples;
|
|
33
24
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
get attachment() {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
static isTextureFormatSupported(device, format) {
|
|
29
|
+
return isRenderbufferFormatSupported(device.gl, format);
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
constructor(device, props) {
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
if (typeof props.format === 'number') {
|
|
33
|
+
throw new Error('Renderbuffer');
|
|
34
|
+
}
|
|
35
|
+
super(device, props, WEBGLRenderbuffer.defaultProps);
|
|
36
|
+
_defineProperty(this, "glFormat", void 0);
|
|
37
|
+
this.glFormat = convertTextureFormatToGL(this.props.format, device.isWebGL2);
|
|
42
38
|
this._initialize(this.props);
|
|
43
39
|
}
|
|
44
|
-
|
|
45
40
|
resize(size) {
|
|
46
41
|
if (size.width !== this.width || size.height !== this.height) {
|
|
47
|
-
Object.assign(this.props, {
|
|
42
|
+
Object.assign(this.props, {
|
|
43
|
+
...size,
|
|
48
44
|
format: this.format,
|
|
49
45
|
samples: this.samples
|
|
50
46
|
});
|
|
51
|
-
|
|
52
47
|
this._initialize(this.props);
|
|
53
48
|
}
|
|
54
|
-
|
|
55
|
-
return this;
|
|
56
49
|
}
|
|
57
|
-
|
|
58
50
|
_initialize(props) {
|
|
59
51
|
const {
|
|
60
52
|
format,
|
|
@@ -65,30 +57,32 @@ export default class WEBGLRenderbuffer extends WebGLResource {
|
|
|
65
57
|
assert(format, 'Needs format');
|
|
66
58
|
this.trackDeallocatedMemory();
|
|
67
59
|
this.gl.bindRenderbuffer(GL.RENDERBUFFER, this.handle);
|
|
68
|
-
|
|
69
60
|
if (samples !== 0 && this.device.isWebGL2) {
|
|
70
|
-
this.
|
|
61
|
+
this.gl2.renderbufferStorageMultisample(GL.RENDERBUFFER, samples, this.glFormat, width, height);
|
|
71
62
|
} else {
|
|
72
|
-
this.gl.renderbufferStorage(GL.RENDERBUFFER,
|
|
63
|
+
this.gl.renderbufferStorage(GL.RENDERBUFFER, this.glFormat, width, height);
|
|
73
64
|
}
|
|
74
|
-
|
|
75
65
|
this.gl.bindRenderbuffer(GL.RENDERBUFFER, null);
|
|
76
|
-
this.trackAllocatedMemory(width * height * (samples || 1) *
|
|
77
|
-
return this;
|
|
66
|
+
this.trackAllocatedMemory(width * height * (samples || 1) * getTextureFormatBytesPerPixel(this.glFormat, this.device.isWebGL2));
|
|
78
67
|
}
|
|
79
|
-
|
|
80
68
|
_createHandle() {
|
|
81
69
|
return this.gl.createRenderbuffer();
|
|
82
70
|
}
|
|
83
|
-
|
|
84
71
|
_deleteHandle() {
|
|
85
72
|
this.gl.deleteRenderbuffer(this.handle);
|
|
86
73
|
this.trackDeallocatedMemory();
|
|
87
74
|
}
|
|
88
|
-
|
|
89
75
|
_bindHandle(handle) {
|
|
90
76
|
this.gl.bindRenderbuffer(GL.RENDERBUFFER, handle);
|
|
91
77
|
}
|
|
92
|
-
|
|
93
78
|
}
|
|
79
|
+
_defineProperty(WEBGLRenderbuffer, "defaultProps", {
|
|
80
|
+
id: undefined,
|
|
81
|
+
handle: undefined,
|
|
82
|
+
userData: undefined,
|
|
83
|
+
format: undefined,
|
|
84
|
+
width: 1,
|
|
85
|
+
height: 1,
|
|
86
|
+
samples: 0
|
|
87
|
+
});
|
|
94
88
|
//# sourceMappingURL=webgl-renderbuffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"webgl-renderbuffer.js","names":["assert","GL","WebGLResource","isRenderbufferFormatSupported","convertTextureFormatToGL","getTextureFormatBytesPerPixel","_Symbol$toStringTag","Symbol","toStringTag","WEBGLRenderbuffer","width","props","height","format","samples","attachment","isTextureFormatSupported","device","gl","constructor","Error","defaultProps","_defineProperty","glFormat","isWebGL2","_initialize","resize","size","Object","assign","trackDeallocatedMemory","bindRenderbuffer","RENDERBUFFER","handle","gl2","renderbufferStorageMultisample","renderbufferStorage","trackAllocatedMemory","_createHandle","createRenderbuffer","_deleteHandle","deleteRenderbuffer","_bindHandle","id","undefined","userData"],"sources":["../../../src/adapter/objects/webgl-renderbuffer.ts"],"sourcesContent":["import {assert, ResourceProps, TextureFormat} from '@luma.gl/core';\nimport {GL} from '@luma.gl/constants';\nimport {WebGLDevice} from '../webgl-device';\nimport {WebGLResource} from './webgl-resource';\nimport {isRenderbufferFormatSupported} from '../converters/texture-formats';\nimport {convertTextureFormatToGL, getTextureFormatBytesPerPixel} from '../converters/texture-formats';\n\nexport type RenderbufferProps = ResourceProps & {\n format: TextureFormat;\n width?: number;\n height?: number;\n samples?: number;\n};\n\n/**\n * Renderbuffers are GPU objects that contain images.\n * In contrast to Textures they are optimized for use as render targets, with Framebuffers.\n * while Textures may not be, and are the logical choice when\n * you do not need to sample (i.e. in a post-pass shader)\n * from the produced image. If you need to resample\n * (such as when reading depth back in a second shader pass),\n * use Textures instead.\n * Renderbuffer objects also natively accommodate Multisampling (MSAA).\n */\nexport class WEBGLRenderbuffer extends WebGLResource<RenderbufferProps> {\n static override readonly defaultProps: Required<RenderbufferProps> = {\n id: undefined,\n handle: undefined,\n userData: undefined,\n format: undefined, // 'depth16unorm'\n width: 1,\n height: 1, \n samples: 0\n }; \n\n override get [Symbol.toStringTag](): string { return 'Renderbuffer'; }\n\n get width(): number { return this.props.width; }\n get height(): number { return this.props.height; }\n get format(): TextureFormat { return this.props.format; }\n get samples(): number { return this.props.samples; }\n get attachment() { return }\n\n /** WebGL format constant */\n glFormat: GL;\n\n static isTextureFormatSupported(device: WebGLDevice, format: TextureFormat): boolean {\n return isRenderbufferFormatSupported(device.gl, format);\n }\n\n constructor(device: WebGLDevice, props: RenderbufferProps) {\n // TODO - remove temporary sanity check\n if (typeof props.format === 'number') {\n throw new Error('Renderbuffer');\n }\n super(device, props, WEBGLRenderbuffer.defaultProps);\n this.glFormat = convertTextureFormatToGL(this.props.format, device.isWebGL2);\n this._initialize(this.props);\n }\n\n resize(size: {width: number, height: number}): void {\n // Don't resize if width/height haven't changed\n if (size.width !== this.width || size.height !== this.height) {\n Object.assign(this.props, {...size, format: this.format, samples: this.samples});\n this._initialize(this.props);\n }\n }\n\n // PRIVATE METHODS\n\n /** Creates and initializes a renderbuffer object's data store */\n protected _initialize(props: Required<RenderbufferProps>): void {\n const {format, width, height, samples} = props;\n assert(format, 'Needs format');\n\n this.trackDeallocatedMemory();\n\n this.gl.bindRenderbuffer(GL.RENDERBUFFER, this.handle);\n\n if (samples !== 0 && this.device.isWebGL2) {\n this.gl2.renderbufferStorageMultisample(GL.RENDERBUFFER, samples, this.glFormat, width, height);\n } else {\n this.gl.renderbufferStorage(GL.RENDERBUFFER, this.glFormat, width, height);\n }\n\n this.gl.bindRenderbuffer(GL.RENDERBUFFER, null);\n\n this.trackAllocatedMemory(\n width * height * (samples || 1) * getTextureFormatBytesPerPixel(this.glFormat, this.device.isWebGL2)\n );\n }\n\n // RESOURCE IMPLEMENTATION\n\n override _createHandle() {\n return this.gl.createRenderbuffer();\n }\n\n override _deleteHandle(): void {\n this.gl.deleteRenderbuffer(this.handle);\n this.trackDeallocatedMemory();\n }\n\n override _bindHandle(handle: WEBGLRenderbuffer): void {\n this.gl.bindRenderbuffer(GL.RENDERBUFFER, handle);\n }\n}\n"],"mappings":";;AAAA,SAAQA,MAAM,QAAqC,eAAe;AAClE,SAAQC,EAAE,QAAO,oBAAoB;AAAC,SAE9BC,aAAa;AAAA,SACbC,6BAA6B;AAAA,SAC7BC,wBAAwB,EAAEC,6BAA6B;AAAAC,mBAAA,GA8B/CC,MAAM,CAACC,WAAW;AAXlC,OAAO,MAAMC,iBAAiB,SAASP,aAAa,CAAoB;EAWtE,KAAAI,mBAAA,IAA4C;IAAE,OAAO,cAAc;EAAE;EAErE,IAAII,KAAKA,CAAA,EAAW;IAAE,OAAO,IAAI,CAACC,KAAK,CAACD,KAAK;EAAE;EAC/C,IAAIE,MAAMA,CAAA,EAAW;IAAE,OAAO,IAAI,CAACD,KAAK,CAACC,MAAM;EAAE;EACjD,IAAIC,MAAMA,CAAA,EAAkB;IAAE,OAAO,IAAI,CAACF,KAAK,CAACE,MAAM;EAAE;EACxD,IAAIC,OAAOA,CAAA,EAAW;IAAE,OAAO,IAAI,CAACH,KAAK,CAACG,OAAO;EAAE;EACnD,IAAIC,UAAUA,CAAA,EAAG;IAAE;EAAQ;EAK3B,OAAOC,wBAAwBA,CAACC,MAAmB,EAAEJ,MAAqB,EAAW;IACnF,OAAOV,6BAA6B,CAACc,MAAM,CAACC,EAAE,EAAEL,MAAM,CAAC;EACzD;EAEAM,WAAWA,CAACF,MAAmB,EAAEN,KAAwB,EAAE;IAEzD,IAAI,OAAOA,KAAK,CAACE,MAAM,KAAK,QAAQ,EAAE;MACpC,MAAM,IAAIO,KAAK,CAAC,cAAc,CAAC;IACjC;IACA,KAAK,CAACH,MAAM,EAAEN,KAAK,EAAEF,iBAAiB,CAACY,YAAY,CAAC;IAACC,eAAA;IACrD,IAAI,CAACC,QAAQ,GAAGnB,wBAAwB,C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