@luma.gl/webgl 9.0.0-alpha.2 → 9.0.0-alpha.21
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/dist/adapter/converters/device-parameters.d.ts +11 -1
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +17 -35
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/renderbuffer-formats.d.ts +2 -2
- package/dist/adapter/converters/renderbuffer-formats.d.ts.map +1 -1
- package/dist/adapter/converters/renderbuffer-formats.js +2 -7
- package/dist/adapter/converters/renderbuffer-formats.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.d.ts +4 -4
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +19 -55
- package/dist/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +13 -66
- package/dist/adapter/converters/texture-formats.js.map +1 -1
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +2 -8
- package/dist/adapter/converters/vertex-formats.js.map +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.js +1 -4
- package/dist/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.js +8 -10
- 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.js +0 -17
- 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 +1 -1
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +41 -67
- 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.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +1 -31
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/uniforms.d.ts +1 -1
- package/dist/adapter/helpers/uniforms.d.ts.map +1 -1
- package/dist/adapter/helpers/uniforms.js +4 -14
- package/dist/adapter/helpers/uniforms.js.map +1 -1
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
- package/dist/adapter/objects/constants-to-keys.js +0 -7
- package/dist/adapter/objects/constants-to-keys.js.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +3 -3
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +6 -22
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/adapter/objects/webgl-resource.d.ts +3 -5
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +15 -68
- package/dist/adapter/objects/webgl-resource.js.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts +6 -6
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.js +7 -17
- package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts +3 -4
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +18 -49
- package/dist/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.d.ts +2 -2
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +3 -18
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.d.ts +3 -3
- package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.js +2 -15
- 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 +16 -16
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +17 -75
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts +3 -3
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +3 -8
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +5 -5
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +51 -140
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-sampler.d.ts +5 -4
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +5 -13
- 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 +8 -21
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +26 -26
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +66 -183
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/webgl-canvas-context.d.ts +3 -3
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +6 -19
- package/dist/adapter/webgl-canvas-context.js.map +1 -1
- package/dist/adapter/webgl-device.d.ts +53 -37
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +108 -109
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/classic/accessor.d.ts +1 -1
- package/dist/classic/accessor.d.ts.map +1 -1
- package/dist/classic/accessor.js +12 -36
- package/dist/classic/accessor.js.map +1 -1
- package/dist/classic/buffer.d.ts +3 -4
- package/dist/classic/buffer.d.ts.map +1 -1
- package/dist/classic/buffer.js +30 -87
- package/dist/classic/buffer.js.map +1 -1
- package/dist/classic/typed-array-utils.d.ts +1 -1
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +0 -20
- package/dist/classic/typed-array-utils.js.map +1 -1
- package/dist/context/context/{create-context.d.ts → create-browser-context.d.ts} +2 -1
- package/dist/context/context/create-browser-context.d.ts.map +1 -0
- package/dist/context/context/{create-context.js → create-browser-context.js} +19 -15
- 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 +0 -3
- package/dist/context/context/webgl-checks.js.map +1 -1
- package/dist/context/debug/spector.d.ts +1 -0
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +7 -19
- package/dist/context/debug/spector.js.map +1 -1
- package/dist/context/debug/webgl-developer-tools.d.ts +1 -1
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +8 -32
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/parameters/unified-parameter-api.d.ts +6 -5
- 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 +103 -103
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +16 -34
- 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 +1 -6
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/context/polyfill/polyfill-context.js +20 -28
- 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 +8 -30
- 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 +15 -50
- 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 +9204 -0
- package/dist/index.cjs +5948 -0
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -26
- package/dist/index.js.map +1 -1
- package/dist/types/webgl.d.ts +8 -7
- package/dist/types/webgl.d.ts.map +1 -1
- package/dist/types/webgl.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist.min.js +36 -0
- package/package.json +18 -9
- package/src/.DS_Store +0 -0
- package/src/adapter/.DS_Store +0 -0
- package/src/adapter/converters/device-parameters.ts +45 -16
- package/src/adapter/converters/renderbuffer-formats.ts +1 -3
- package/src/adapter/converters/sampler-parameters.ts +18 -7
- package/src/adapter/converters/texture-formats.ts +18 -16
- package/src/adapter/converters/vertex-formats.ts +1 -0
- package/src/adapter/device-helpers/device-features.ts +9 -2
- package/src/adapter/device-helpers/device-limits.ts +1 -1
- package/src/adapter/device-helpers/get-device-info.ts +12 -8
- package/src/adapter/helpers/get-shader-info.ts +37 -0
- package/src/adapter/helpers/get-shader-layout.ts +59 -37
- package/src/adapter/helpers/parse-shader-compiler-log.ts +2 -2
- package/src/adapter/helpers/set-uniform.ts +3 -1
- package/src/adapter/helpers/uniforms.ts +21 -10
- package/src/adapter/objects/constants-to-keys.ts +4 -1
- package/src/adapter/objects/webgl-renderbuffer.ts +8 -8
- package/src/adapter/objects/webgl-resource.ts +8 -13
- package/src/adapter/objects/webgl-vertex-array-object.ts +10 -10
- package/src/adapter/resources/webgl-buffer.ts +16 -16
- package/src/adapter/resources/webgl-command-buffer.ts +3 -3
- package/src/adapter/resources/webgl-command-encoder.ts +8 -8
- package/src/adapter/resources/webgl-external-texture.ts +1 -1
- package/src/adapter/resources/webgl-framebuffer.ts +36 -33
- package/src/adapter/resources/webgl-render-pass.ts +4 -3
- package/src/adapter/resources/webgl-render-pipeline.ts +89 -77
- package/src/adapter/resources/webgl-sampler.ts +12 -6
- package/src/adapter/resources/webgl-shader.ts +10 -9
- package/src/adapter/resources/webgl-texture.ts +55 -45
- package/src/adapter/webgl-canvas-context.ts +8 -9
- package/src/adapter/webgl-device.ts +153 -69
- package/src/classic/accessor.ts +2 -15
- package/src/classic/buffer.ts +18 -25
- package/src/classic/typed-array-utils.ts +4 -2
- package/src/context/.DS_Store +0 -0
- package/src/context/context/{create-context.ts → create-browser-context.ts} +17 -7
- package/src/context/context/create-headless-context.ts +48 -0
- package/src/context/debug/spector.ts +6 -5
- package/src/context/debug/webgl-developer-tools.ts +13 -13
- package/src/context/parameters/unified-parameter-api.ts +18 -12
- package/src/context/parameters/webgl-parameter-tables.ts +113 -94
- package/src/context/polyfill/context-data.ts +27 -0
- package/src/context/polyfill/get-parameter-polyfill.ts +7 -6
- package/src/context/polyfill/polyfill-context.ts +6 -8
- package/src/context/polyfill/polyfill-table.ts +16 -14
- package/src/context/polyfill/polyfill-vertex-array-object.ts +2 -0
- package/src/context/state-tracker/track-context-state.ts +13 -12
- package/src/context/state-tracker/with-parameters.ts +8 -2
- package/src/index.ts +28 -26
- package/src/types/webgl.ts +10 -7
- 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/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.map +0 -1
- 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 +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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"accessor.js","names":["assert","checkProps","GL","getTypedArrayFromGLType","DEFAULT_ACCESSOR_VALUES","offset","stride","type","FLOAT","size","divisor","normalized","integer","PROP_CHECKS","deprecatedProps","instanced","isInstanced","Accessor","getBytesPerElement","accessor","ArrayType","BYTES_PER_ELEMENT","getBytesPerVertex","resolve","_len","arguments","length","accessors","Array","_key","constructor","_defineProperty","_len2","_key2","forEach","_assign","Object","freeze","toString","JSON","stringify","BYTES_PER_VERTEX","props","undefined","INT","UNSIGNED_INT","normalize","buffer","index"],"sources":["../../src/classic/accessor.ts"],"sourcesContent":["import {assert, checkProps, Buffer, AccessorObject} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {getTypedArrayFromGLType} from './typed-array-utils';\n\nconst DEFAULT_ACCESSOR_VALUES = {\n offset: 0,\n stride: 0,\n type: GL.FLOAT,\n size: 1,\n divisor: 0,\n normalized: false,\n integer: false\n};\n\nconst PROP_CHECKS = {\n deprecatedProps: {\n instanced: 'divisor',\n isInstanced: 'divisor'\n }\n};\n\nexport class Accessor implements AccessorObject {\n offset?: number;\n stride?: number;\n type?: number;\n size?: number;\n divisor?: number;\n normalized?: boolean;\n integer?: boolean;\n\n buffer?: Buffer;\n index?: number;\n\n static getBytesPerElement(accessor: Accessor | AccessorObject): number {\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || GL.FLOAT);\n return ArrayType.BYTES_PER_ELEMENT;\n }\n\n static getBytesPerVertex(accessor: AccessorObject): number {\n assert(accessor.size);\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || GL.FLOAT);\n return ArrayType.BYTES_PER_ELEMENT * accessor.size;\n }\n\n // Combines (merges) a list of accessors. On top of default values\n // Usually [programAccessor, bufferAccessor, appAccessor]\n // All props will be set in the returned object.\n // TODO check for conflicts between values in the supplied accessors\n static resolve(...accessors: AccessorObject[]): Accessor {\n return new Accessor(...[DEFAULT_ACCESSOR_VALUES, ...accessors]); // Default values\n }\n\n constructor(...accessors: AccessorObject[]) {\n accessors.forEach((accessor) => this._assign(accessor)); // Merge in sequence\n Object.freeze(this);\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n\n // ACCESSORS\n\n // TODO - remove>\n get BYTES_PER_ELEMENT(): number {\n return Accessor.getBytesPerElement(this);\n }\n\n get BYTES_PER_VERTEX(): number {\n return Accessor.getBytesPerVertex(this);\n }\n\n // PRIVATE\n\n // eslint-disable-next-line complexity, max-statements\n _assign(props: AccessorObject = {}): this {\n props = checkProps('Accessor', props, PROP_CHECKS);\n\n if (props.type !== undefined) {\n this.type = props.type;\n\n // Auto-deduce integer type?\n if (props.type === GL.INT || props.type === GL.UNSIGNED_INT) {\n this.integer = true;\n }\n }\n if (props.size !== undefined) {\n this.size = props.size;\n }\n if (props.offset !== undefined) {\n this.offset = props.offset;\n }\n if (props.stride !== undefined) {\n this.stride = props.stride;\n }\n // @ts-expect-error\n if (props.normalize !== undefined) {\n // @ts-expect-error\n this.normalized = props.normalize;\n }\n if (props.normalized !== undefined) {\n this.normalized = props.normalized;\n }\n if (props.integer !== undefined) {\n this.integer = props.integer;\n }\n\n // INSTANCE DIVISOR\n if (props.divisor !== undefined) {\n this.divisor = props.divisor;\n }\n\n // Buffer is optional\n if (props.buffer !== undefined) {\n this.buffer = props.buffer;\n }\n\n // The binding index (for binding e.g. Transform feedbacks and Uniform buffers)\n // TODO - should this be part of accessor?\n if (props.index !== undefined) {\n if (typeof props.index === 'boolean') {\n this.index = props.index ? 1 : 0;\n } else {\n this.index = props.index;\n }\n }\n\n // DEPRECATED\n // @ts-expect-error\n if (props.instanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.instanced ? 1 : 0;\n }\n // @ts-expect-error\n if (props.isInstanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.isInstanced ? 1 : 0;\n }\n\n if (this.offset === undefined) delete this.offset;\n if (this.stride === undefined) delete this.stride;\n if (this.type === undefined) delete this.type;\n if (this.size === undefined) delete this.size;\n if (this.divisor === undefined) delete this.divisor;\n if (this.normalized === undefined) delete this.normalized;\n if (this.integer === undefined) delete this.integer;\n \n if (this.buffer === undefined) delete this.buffer;\n if (this.index === undefined) delete this.index;\n \n return this;\n }\n}\n\n// TEST EXPORTS\nexport {DEFAULT_ACCESSOR_VALUES};\n"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,UAAU,QAA+B,cAAc;AACvE,OAAOC,EAAE,MAAM,oBAAoB;AAAC,SAC5BC,uBAAuB;AAE/B,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE,CAAC;EACTC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAEL,EAAE,CAACM,KAAK;EACdC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,UAAU,EAAE,KAAK;EACjBC,OAAO,EAAE;AACX,CAAC;AAED,MAAMC,WAAW,GAAG;EAClBC,eAAe,EAAE;IACfC,SAAS,EAAE,SAAS;IACpBC,WAAW,EAAE;EACf;AACF,CAAC;AAED,OAAO,MAAMC,QAAQ,CA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;IAC7C,IAAI,IAAI,CAACE,IAAI,KAAKkC,SAAS,EAAE,OAAO,IAAI,CAAClC,IAAI;IAC7C,IAAI,IAAI,CAACC,OAAO,KAAKiC,SAAS,EAAE,OAAO,IAAI,CAACjC,OAAO;IACnD,IAAI,IAAI,CAACC,UAAU,KAAKgC,SAAS,EAAE,OAAO,IAAI,CAAChC,UAAU;IACzD,IAAI,IAAI,CAACC,OAAO,KAAK+B,SAAS,EAAE,OAAO,IAAI,CAAC/B,OAAO;IAEnD,IAAI,IAAI,CAACmC,MAAM,KAAKJ,SAAS,EAAE,OAAO,IAAI,CAACI,MAAM;IACjD,IAAI,IAAI,CAACC,KAAK,KAAKL,SAAS,EAAE,OAAO,IAAI,CAACK,KAAK;IAE/C,OAAO,IAAI;EACb;AACF;AAGA,SAAQ5C,uBAAuB"}
|
package/dist/classic/buffer.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Device, BufferProps, TypedArray } from '@luma.gl/api';
|
|
2
2
|
import GL from '@luma.gl/constants';
|
|
3
3
|
import { AccessorObject } from '../types';
|
|
4
|
-
import Accessor from './accessor';
|
|
5
|
-
import WEBGLBuffer from '../adapter/resources/webgl-buffer';
|
|
4
|
+
import { Accessor } from './accessor';
|
|
5
|
+
import { WEBGLBuffer } from '../adapter/resources/webgl-buffer';
|
|
6
6
|
/** WebGL Buffer interface */
|
|
7
7
|
export declare type ClassicBufferProps = BufferProps & {
|
|
8
8
|
handle?: WebGLBuffer;
|
|
@@ -19,13 +19,12 @@ export declare type ClassicBufferProps = BufferProps & {
|
|
|
19
19
|
type?: number;
|
|
20
20
|
};
|
|
21
21
|
/** WebGL Buffer interface */
|
|
22
|
-
export
|
|
22
|
+
export declare class ClassicBuffer extends WEBGLBuffer {
|
|
23
23
|
usage: number;
|
|
24
24
|
accessor: Accessor;
|
|
25
25
|
constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);
|
|
26
26
|
constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);
|
|
27
27
|
constructor(device: Device | WebGLRenderingContext, byteLength: number);
|
|
28
|
-
destroy(): void;
|
|
29
28
|
write(data: TypedArray, byteOffset?: number): void;
|
|
30
29
|
getElementCount(accessor?: AccessorObject): number;
|
|
31
30
|
getVertexCount(accessor?: AccessorObject): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/classic/buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/classic/buffer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAIpC,OAAO,EAAC,WAAW,EAAC,MAAM,mCAAmC,CAAC;AAoD9D,6BAA6B;AAC7B,oBAAY,kBAAkB,GAAG,WAAW,GAAG;IAC7C,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,6BAA6B;AAC7B,qBAAa,aAAc,SAAQ,WAAW;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;gBAEP,MAAM,EAAE,MAAM,GAAG,qBAAqB,EAAE,KAAK,C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,GAAG;IAsCP;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAwBhF,MAAM,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAcnD,YAAY,IAAI;QACd,IAAI,EAAE,GAAG,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;KAChB;IAQH,mBAAmB;IAOnB,QAAQ,CAAC,IAAI,KAAA,EAAE,MAAM,GAAE,MAAU,EAAE,UAAU,GAAE,MAAiC,GAAG,IAAI;IAwBvF,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,SAAkB,GAAG,IAAI;IA8BtE,UAAU;IAKV,yBAAyB,CAAC,aAAa,EAAE,MAAM;IAQ/C,UAAU,CAAC,IAAI,KAAA;IAQf,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,GAAG;IAQ5B,2CAA2C;IAC3C,IAAI,IAAI,WAEP;CACF"}
|
package/dist/classic/buffer.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import { assert, checkProps } from '@luma.gl/api';
|
|
3
3
|
import GL from '@luma.gl/constants';
|
|
4
|
-
import { assertWebGL2Context } from
|
|
5
|
-
import Accessor from
|
|
6
|
-
import { getGLTypeFromTypedArray, getTypedArrayFromGLType } from
|
|
7
|
-
import WebGLDevice from
|
|
8
|
-
import WEBGLBuffer from
|
|
4
|
+
import { assertWebGL2Context } from "../context/context/webgl-checks.js";
|
|
5
|
+
import { Accessor } from "./accessor.js";
|
|
6
|
+
import { getGLTypeFromTypedArray, getTypedArrayFromGLType } from "./typed-array-utils.js";
|
|
7
|
+
import { WebGLDevice } from "../adapter/webgl-device.js";
|
|
8
|
+
import { WEBGLBuffer } from "../adapter/resources/webgl-buffer.js";
|
|
9
9
|
const DEBUG_DATA_LENGTH = 10;
|
|
10
10
|
const DEPRECATED_PROPS = {
|
|
11
11
|
offset: 'accessor.offset',
|
|
@@ -28,7 +28,6 @@ const PROP_CHECKS_INITIALIZE = {
|
|
|
28
28
|
const PROP_CHECKS_SET_PROPS = {
|
|
29
29
|
removedProps: DEPRECATED_PROPS
|
|
30
30
|
};
|
|
31
|
-
|
|
32
31
|
function getWEBGLBufferProps(props) {
|
|
33
32
|
if (ArrayBuffer.isView(props)) {
|
|
34
33
|
return {
|
|
@@ -39,28 +38,22 @@ function getWEBGLBufferProps(props) {
|
|
|
39
38
|
byteLength: props
|
|
40
39
|
};
|
|
41
40
|
}
|
|
42
|
-
|
|
43
41
|
props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);
|
|
44
|
-
const bufferProps = {
|
|
42
|
+
const bufferProps = {
|
|
43
|
+
...props
|
|
45
44
|
};
|
|
46
|
-
|
|
47
45
|
if (bufferProps.offset) {
|
|
48
46
|
bufferProps.byteOffset = bufferProps.offset;
|
|
49
47
|
}
|
|
50
|
-
|
|
51
48
|
return bufferProps;
|
|
52
49
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
export class ClassicBuffer extends WEBGLBuffer {
|
|
51
|
+
constructor(device) {
|
|
52
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
56
53
|
super(WebGLDevice.attach(device), getWEBGLBufferProps(props));
|
|
57
|
-
|
|
58
54
|
_defineProperty(this, "usage", void 0);
|
|
59
|
-
|
|
60
55
|
_defineProperty(this, "accessor", void 0);
|
|
61
|
-
|
|
62
56
|
this.setAccessor(Object.assign({}, props, props.accessor));
|
|
63
|
-
|
|
64
57
|
if (this.props.data) {
|
|
65
58
|
const type = getGLTypeFromTypedArray(this.props.data);
|
|
66
59
|
assert(type);
|
|
@@ -68,100 +61,75 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
68
61
|
type
|
|
69
62
|
}));
|
|
70
63
|
}
|
|
71
|
-
|
|
72
64
|
Object.seal(this);
|
|
73
65
|
}
|
|
74
|
-
|
|
75
|
-
destroy() {
|
|
76
|
-
if (this.handle) {
|
|
77
|
-
this.removeStats();
|
|
78
|
-
this.trackDeallocatedMemory();
|
|
79
|
-
this.gl.deleteBuffer(this.handle);
|
|
80
|
-
this.handle = null;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
66
|
write(data, byteOffset) {
|
|
85
67
|
this.subData({
|
|
86
68
|
data,
|
|
87
69
|
offset: byteOffset
|
|
88
70
|
});
|
|
89
71
|
}
|
|
90
|
-
|
|
91
|
-
|
|
72
|
+
getElementCount() {
|
|
73
|
+
let accessor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.accessor;
|
|
92
74
|
return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));
|
|
93
75
|
}
|
|
94
|
-
|
|
95
|
-
|
|
76
|
+
getVertexCount() {
|
|
77
|
+
let accessor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.accessor;
|
|
96
78
|
return Math.round(this.byteLength / Accessor.getBytesPerVertex(accessor));
|
|
97
79
|
}
|
|
98
|
-
|
|
99
|
-
|
|
80
|
+
initialize() {
|
|
81
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
100
82
|
if (ArrayBuffer.isView(props)) {
|
|
101
83
|
props = {
|
|
102
84
|
data: props
|
|
103
85
|
};
|
|
104
86
|
}
|
|
105
|
-
|
|
106
87
|
if (Number.isFinite(props)) {
|
|
107
88
|
props = {
|
|
108
89
|
byteLength: props
|
|
109
90
|
};
|
|
110
91
|
}
|
|
111
|
-
|
|
112
92
|
props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);
|
|
113
93
|
this.webglUsage = props.webglUsage || GL.STATIC_DRAW;
|
|
114
94
|
this.debugData = null;
|
|
115
95
|
this.setAccessor(Object.assign({}, props, props.accessor));
|
|
116
|
-
|
|
117
96
|
if (props.data) {
|
|
118
97
|
this._setData(props.data, props.offset, props.byteLength);
|
|
119
98
|
} else {
|
|
120
99
|
this._setByteLength(props.byteLength || 0);
|
|
121
100
|
}
|
|
122
|
-
|
|
123
101
|
return this;
|
|
124
102
|
}
|
|
125
|
-
|
|
126
103
|
setProps(props) {
|
|
127
104
|
props = checkProps('Buffer', props, PROP_CHECKS_SET_PROPS);
|
|
128
|
-
|
|
129
105
|
if ('accessor' in props) {
|
|
130
106
|
this.setAccessor(props.accessor);
|
|
131
107
|
}
|
|
132
|
-
|
|
133
108
|
return this;
|
|
134
109
|
}
|
|
135
|
-
|
|
136
110
|
setAccessor(accessor) {
|
|
137
111
|
accessor = Object.assign({}, accessor);
|
|
138
112
|
delete accessor.buffer;
|
|
139
113
|
this.accessor = new Accessor(accessor);
|
|
140
114
|
return this;
|
|
141
115
|
}
|
|
142
|
-
|
|
143
116
|
reallocate(byteLength) {
|
|
144
117
|
if (byteLength > this.byteLength) {
|
|
145
118
|
this._setByteLength(byteLength);
|
|
146
|
-
|
|
147
119
|
return true;
|
|
148
120
|
}
|
|
149
|
-
|
|
150
121
|
this.bytesUsed = byteLength;
|
|
151
122
|
return false;
|
|
152
123
|
}
|
|
153
|
-
|
|
154
124
|
setData(props) {
|
|
155
125
|
return this.initialize(props);
|
|
156
126
|
}
|
|
157
|
-
|
|
158
127
|
subData(options) {
|
|
159
128
|
if (ArrayBuffer.isView(options)) {
|
|
160
129
|
options = {
|
|
161
130
|
data: options
|
|
162
131
|
};
|
|
163
132
|
}
|
|
164
|
-
|
|
165
133
|
const {
|
|
166
134
|
data,
|
|
167
135
|
offset = 0,
|
|
@@ -171,22 +139,17 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
171
139
|
assert(data);
|
|
172
140
|
const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;
|
|
173
141
|
this.gl.bindBuffer(target, this.handle);
|
|
174
|
-
|
|
175
142
|
if (srcOffset !== 0 || byteLength !== undefined) {
|
|
176
143
|
assertWebGL2Context(this.gl);
|
|
177
144
|
this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);
|
|
178
145
|
} else {
|
|
179
146
|
this.gl.bufferSubData(target, offset, data);
|
|
180
147
|
}
|
|
181
|
-
|
|
182
148
|
this.gl.bindBuffer(target, null);
|
|
183
149
|
this.debugData = null;
|
|
184
|
-
|
|
185
150
|
this._inferType(data);
|
|
186
|
-
|
|
187
151
|
return this;
|
|
188
152
|
}
|
|
189
|
-
|
|
190
153
|
copyData(options) {
|
|
191
154
|
const {
|
|
192
155
|
sourceBuffer,
|
|
@@ -201,14 +164,14 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
201
164
|
assertWebGL2Context(gl);
|
|
202
165
|
gl.bindBuffer(GL.COPY_READ_BUFFER, sourceBuffer.handle);
|
|
203
166
|
gl.bindBuffer(GL.COPY_WRITE_BUFFER, this.handle);
|
|
204
|
-
gl2.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);
|
|
167
|
+
gl2 === null || gl2 === void 0 ? void 0 : gl2.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);
|
|
205
168
|
gl.bindBuffer(GL.COPY_READ_BUFFER, null);
|
|
206
169
|
gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);
|
|
207
170
|
this.debugData = null;
|
|
208
171
|
return this;
|
|
209
172
|
}
|
|
210
|
-
|
|
211
173
|
getData(options) {
|
|
174
|
+
var _this$gl;
|
|
212
175
|
let {
|
|
213
176
|
dstData = null,
|
|
214
177
|
length = 0
|
|
@@ -221,13 +184,10 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
221
184
|
const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {
|
|
222
185
|
clamped: false
|
|
223
186
|
});
|
|
224
|
-
|
|
225
187
|
const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);
|
|
226
|
-
|
|
227
188
|
const dstElementOffset = dstOffset;
|
|
228
189
|
let dstAvailableElementCount;
|
|
229
190
|
let dstElementCount;
|
|
230
|
-
|
|
231
191
|
if (dstData) {
|
|
232
192
|
dstElementCount = dstData.length;
|
|
233
193
|
dstAvailableElementCount = dstElementCount - dstElementOffset;
|
|
@@ -235,17 +195,15 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
235
195
|
dstAvailableElementCount = Math.min(sourceAvailableElementCount, length || sourceAvailableElementCount);
|
|
236
196
|
dstElementCount = dstElementOffset + dstAvailableElementCount;
|
|
237
197
|
}
|
|
238
|
-
|
|
239
198
|
const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);
|
|
240
199
|
length = length || copyElementCount;
|
|
241
200
|
assert(length <= copyElementCount);
|
|
242
201
|
dstData = dstData || new ArrayType(dstElementCount);
|
|
243
202
|
this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);
|
|
244
|
-
this.gl2.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);
|
|
203
|
+
(_this$gl = this.gl2) === null || _this$gl === void 0 ? void 0 : _this$gl.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);
|
|
245
204
|
this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);
|
|
246
205
|
return dstData;
|
|
247
206
|
}
|
|
248
|
-
|
|
249
207
|
bind(options) {
|
|
250
208
|
const {
|
|
251
209
|
target = this.target,
|
|
@@ -253,37 +211,34 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
253
211
|
offset = 0,
|
|
254
212
|
size
|
|
255
213
|
} = options || {};
|
|
256
|
-
|
|
257
214
|
if (target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER) {
|
|
258
215
|
if (size !== undefined) {
|
|
259
|
-
|
|
216
|
+
var _this$gl2;
|
|
217
|
+
(_this$gl2 = this.gl2) === null || _this$gl2 === void 0 ? void 0 : _this$gl2.bindBufferRange(target, index, this.handle, offset, size);
|
|
260
218
|
} else {
|
|
219
|
+
var _this$gl3;
|
|
261
220
|
assert(offset === 0);
|
|
262
|
-
this.gl2.bindBufferBase(target, index, this.handle);
|
|
221
|
+
(_this$gl3 = this.gl2) === null || _this$gl3 === void 0 ? void 0 : _this$gl3.bindBufferBase(target, index, this.handle);
|
|
263
222
|
}
|
|
264
223
|
} else {
|
|
265
224
|
this.gl.bindBuffer(target, this.handle);
|
|
266
225
|
}
|
|
267
|
-
|
|
268
226
|
return this;
|
|
269
227
|
}
|
|
270
|
-
|
|
271
228
|
unbind(options) {
|
|
272
229
|
const {
|
|
273
230
|
target = this.target,
|
|
274
231
|
index = this.accessor && this.accessor.index
|
|
275
232
|
} = options || {};
|
|
276
233
|
const isIndexedBuffer = target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER;
|
|
277
|
-
|
|
278
234
|
if (isIndexedBuffer) {
|
|
279
|
-
|
|
235
|
+
var _this$gl4;
|
|
236
|
+
(_this$gl4 = this.gl2) === null || _this$gl4 === void 0 ? void 0 : _this$gl4.bindBufferBase(target, index, null);
|
|
280
237
|
} else {
|
|
281
238
|
this.gl.bindBuffer(target, null);
|
|
282
239
|
}
|
|
283
|
-
|
|
284
240
|
return this;
|
|
285
241
|
}
|
|
286
|
-
|
|
287
242
|
getDebugData() {
|
|
288
243
|
if (!this.debugData) {
|
|
289
244
|
this.debugData = this.getData({
|
|
@@ -294,23 +249,20 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
294
249
|
changed: true
|
|
295
250
|
};
|
|
296
251
|
}
|
|
297
|
-
|
|
298
252
|
return {
|
|
299
253
|
data: this.debugData,
|
|
300
254
|
changed: false
|
|
301
255
|
};
|
|
302
256
|
}
|
|
303
|
-
|
|
304
257
|
invalidateDebugData() {
|
|
305
258
|
this.debugData = null;
|
|
306
259
|
}
|
|
307
|
-
|
|
308
|
-
|
|
260
|
+
_setData(data) {
|
|
261
|
+
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
262
|
+
let byteLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : data.byteLength + offset;
|
|
309
263
|
assert(ArrayBuffer.isView(data));
|
|
310
264
|
this.trackDeallocatedMemory();
|
|
311
|
-
|
|
312
265
|
const target = this._getTarget();
|
|
313
|
-
|
|
314
266
|
this.gl.bindBuffer(target, this.handle);
|
|
315
267
|
this.gl.bufferData(target, byteLength, this.webglUsage);
|
|
316
268
|
this.gl.bufferSubData(target, offset, data);
|
|
@@ -326,18 +278,15 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
326
278
|
}));
|
|
327
279
|
return this;
|
|
328
280
|
}
|
|
329
|
-
|
|
330
|
-
|
|
281
|
+
_setByteLength(byteLength) {
|
|
282
|
+
let webglUsage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.webglUsage;
|
|
331
283
|
assert(byteLength >= 0);
|
|
332
284
|
this.trackDeallocatedMemory();
|
|
333
285
|
let data = byteLength;
|
|
334
|
-
|
|
335
286
|
if (byteLength === 0) {
|
|
336
287
|
data = new Float32Array(0);
|
|
337
288
|
}
|
|
338
|
-
|
|
339
289
|
const target = this._getTarget();
|
|
340
|
-
|
|
341
290
|
this.gl.bindBuffer(target, this.handle);
|
|
342
291
|
this.gl.bufferData(target, data, webglUsage);
|
|
343
292
|
this.gl.bindBuffer(target, null);
|
|
@@ -348,11 +297,9 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
348
297
|
this.trackAllocatedMemory(byteLength);
|
|
349
298
|
return this;
|
|
350
299
|
}
|
|
351
|
-
|
|
352
300
|
_getTarget() {
|
|
353
301
|
return this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;
|
|
354
302
|
}
|
|
355
|
-
|
|
356
303
|
_getAvailableElementCount(srcByteOffset) {
|
|
357
304
|
const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {
|
|
358
305
|
clamped: false
|
|
@@ -360,7 +307,6 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
360
307
|
const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;
|
|
361
308
|
return this.getElementCount() - sourceElementOffset;
|
|
362
309
|
}
|
|
363
|
-
|
|
364
310
|
_inferType(data) {
|
|
365
311
|
if (!this.accessor.type) {
|
|
366
312
|
this.setAccessor(new Accessor(this.accessor, {
|
|
@@ -368,17 +314,14 @@ export default class ClassicBuffer extends WEBGLBuffer {
|
|
|
368
314
|
}));
|
|
369
315
|
}
|
|
370
316
|
}
|
|
371
|
-
|
|
372
317
|
getParameter(pname) {
|
|
373
318
|
this.gl.bindBuffer(this.target, this.handle);
|
|
374
319
|
const value = this.gl.getBufferParameter(this.target, pname);
|
|
375
320
|
this.gl.bindBuffer(this.target, null);
|
|
376
321
|
return value;
|
|
377
322
|
}
|
|
378
|
-
|
|
379
323
|
get type() {
|
|
380
324
|
return this.accessor.type;
|
|
381
325
|
}
|
|
382
|
-
|
|
383
326
|
}
|
|
384
327
|
//# sourceMappingURL=buffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/classic/buffer.ts"],"names":["assert","checkProps","GL","assertWebGL2Context","Accessor","getGLTypeFromTypedArray","getTypedArrayFromGLType","WebGLDevice","WEBGLBuffer","DEBUG_DATA_LENGTH","DEPRECATED_PROPS","offset","stride","type","size","divisor","normalized","integer","instanced","isInstanced","PROP_CHECKS_INITIALIZE","removedProps","replacedProps","bytes","deprecatedProps","PROP_CHECKS_SET_PROPS","getWEBGLBufferProps","props","ArrayBuffer","isView","data","byteLength","bufferProps","byteOffset","ClassicBuffer","constructor","device","attach","setAccessor","Object","assign","accessor","seal","destroy","handle","removeStats","trackDeallocatedMemory","gl","deleteBuffer","write","subData","getElementCount","Math","round","getBytesPerElement","getVertexCount","getBytesPerVertex","initialize","Number","isFinite","webglUsage","STATIC_DRAW","debugData","_setData","_setByteLength","setProps","buffer","reallocate","bytesUsed","setData","options","srcOffset","length","target","webgl2","COPY_WRITE_BUFFER","bindBuffer","undefined","bufferSubData","_inferType","copyData","sourceBuffer","readOffset","writeOffset","gl2","COPY_READ_BUFFER","copyBufferSubData","getData","dstData","srcByteOffset","dstOffset","ArrayType","FLOAT","clamped","sourceAvailableElementCount","_getAvailableElementCount","dstElementOffset","dstAvailableElementCount","dstElementCount","min","copyElementCount","getBufferSubData","bind","index","UNIFORM_BUFFER","TRANSFORM_FEEDBACK_BUFFER","bindBufferRange","bindBufferBase","unbind","isIndexedBuffer","getDebugData","changed","invalidateDebugData","_getTarget","bufferData","slice","trackAllocatedMemory","Float32Array","sourceElementOffset","BYTES_PER_ELEMENT","getParameter","pname","value","getBufferParameter"],"mappings":";AACA,SAAqBA,MAArB,EAA6BC,UAA7B,QAA8C,cAA9C;AACA,OAAOC,EAAP,MAAe,oBAAf;AACA,SAAQC,mBAAR,QAAkC,iCAAlC;AAEA,OAAOC,QAAP,MAAqB,YAArB;AACA,SAAQC,uBAAR,EAAiCC,uBAAjC,QAA+D,qBAA/D;AAEA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,WAAP,MAAwB,mCAAxB;AAEA,MAAMC,iBAAiB,GAAG,EAA1B;AAGA,MAAMC,gBAAgB,GAAG;AACvBC,EAAAA,MAAM,EAAE,iBADe;AAEvBC,EAAAA,MAAM,EAAE,iBAFe;AAGvBC,EAAAA,IAAI,EAAE,eAHiB;AAIvBC,EAAAA,IAAI,EAAE,eAJiB;AAKvBC,EAAAA,OAAO,EAAE,kBALc;AAMvBC,EAAAA,UAAU,EAAE,qBANW;AAOvBC,EAAAA,OAAO,EAAE,kBAPc;AAQvBC,EAAAA,SAAS,EAAE,kBARY;AASvBC,EAAAA,WAAW,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C,QAAL,CAAc5B,IAAd,IAAsBX,EAAE,CAAC0F,KAA1B,EAAiC;AAACC,MAAAA,OAAO,EAAE;AAAV,KAAjC,CAAzC;AACA,UAAMyB,mBAAmB,GAAG7B,aAAa,GAAGE,SAAS,CAAC4B,iBAAtD;AACA,WAAO,KAAKpE,eAAL,KAAyBmE,mBAAhC;AACD;;AAIDvC,EAAAA,UAAU,CAACjD,IAAD,EAAO;AACf,QAAI,CAAC,KAAKW,QAAL,CAAc5B,IAAnB,EAAyB;AACvB,WAAKyB,WAAL,CAAiB,IAAIlC,QAAJ,CAAa,KAAKqC,QAAlB,EAA4B;AAAC5B,QAAAA,IAAI,EAAER,uBAAuB,CAACyB,IAAD;AAA9B,OAA5B,CAAjB;AACD;AACF;;AAID0F,EAAAA,YAAY,CAACC,KAAD,EAAiB;AAC3B,SAAK1E,EAAL,CAAQ6B,UAAR,CAAmB,KAAKH,MAAxB,EAAgC,KAAK7B,MAArC;AACA,UAAM8E,KAAK,GAAG,KAAK3E,EAAL,CAAQ4E,kBAAR,CAA2B,KAAKlD,MAAhC,EAAwCgD,KAAxC,CAAd;AACA,SAAK1E,EAAL,CAAQ6B,UAAR,CAAmB,KAAKH,MAAxB,EAAgC,IAAhC;AACA,WAAOiD,KAAP;AACD;;AAIO,MAAJ7G,IAAI,GAAG;AACT,WAAO,KAAK4B,QAAL,CAAc5B,IAArB;AACD;;AAvYoD","sourcesContent":["import type {Device, BufferProps, TypedArray} from '@luma.gl/api';\nimport {Buffer, log, assert, checkProps} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {assertWebGL2Context} from '../context/context/webgl-checks';\nimport {AccessorObject} from '../types';\nimport Accessor from './accessor';\nimport {getGLTypeFromTypedArray, getTypedArrayFromGLType} from './typed-array-utils';\n\nimport WebGLDevice from '../adapter/webgl-device';\nimport WEBGLBuffer from '../adapter/resources/webgl-buffer';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n// Shared prop checks for constructor and setProps\nconst DEPRECATED_PROPS = {\n offset: 'accessor.offset',\n stride: 'accessor.stride',\n type: 'accessor.type',\n size: 'accessor.size',\n divisor: 'accessor.divisor',\n normalized: 'accessor.normalized',\n integer: 'accessor.integer',\n instanced: 'accessor.divisor',\n isInstanced: 'accessor.divisor'\n};\n\n// Prop checks for constructor\nconst PROP_CHECKS_INITIALIZE = {\n removedProps: {},\n replacedProps: {\n bytes: 'byteLength'\n },\n // new Buffer() with individual accessor props is still used in apps, emit warnings\n deprecatedProps: DEPRECATED_PROPS\n};\n\n// Prop checks for setProps\nconst PROP_CHECKS_SET_PROPS = {\n // Buffer.setProps() with individual accessor props is rare => emit errors\n removedProps: DEPRECATED_PROPS\n};\n\nfunction getWEBGLBufferProps(props: ClassicBufferProps | ArrayBufferView | number): BufferProps {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n return {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n else if (typeof props === 'number') {\n return {byteLength: props as number};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n const bufferProps = {...props as ClassicBufferProps};\n if (bufferProps.offset) {\n bufferProps.byteOffset = bufferProps.offset;\n }\n return bufferProps;\n}\n\n/** WebGL Buffer interface */\nexport type ClassicBufferProps = BufferProps & {\n handle?: WebGLBuffer;\n\n target?: number;\n webglUsage?: number;\n\n accessor?: AccessorObject;\n\n /** @deprecated */\n index?: number;\n /** @deprecated */\n offset?: number;\n /** @deprecated */\n size?: number;\n /** @deprecated */\n type?: number\n}\n\n/** WebGL Buffer interface */\nexport default class ClassicBuffer extends WEBGLBuffer {\n usage: number;\n accessor: Accessor;\n\n constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);\n constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);\n constructor(device: Device | WebGLRenderingContext, byteLength: number);\n\n constructor(device: Device | WebGLRenderingContext, props = {}) {\n super(WebGLDevice.attach(device), getWEBGLBufferProps(props));\n\n // Base class initializes\n // this.initialize(props);\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, (props as ClassicBufferProps).accessor));\n\n // infer GL type from supplied typed array\n if (this.props.data) {\n const type = getGLTypeFromTypedArray(this.props.data as TypedArray);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n }\n\n Object.seal(this);\n }\n\n destroy(): void {\n if (this.handle) {\n this.removeStats();\n this.trackDeallocatedMemory();\n this.gl.deleteBuffer(this.handle);\n // @ts-expect-error\n this.handle = null;\n }\n }\n\n write(data: TypedArray, byteOffset?: number): void {\n this.subData({data, offset: byteOffset});\n }\n // returns number of elements in the buffer (assuming that the full buffer is used)\n getElementCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));\n }\n\n // returns number of vertices in the buffer (assuming that the full buffer is used)\n getVertexCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerVertex(accessor));\n }\n\n // Creates and initializes the buffer object's data store.\n // Signature: `new Buffer(gl, {data: new Float32Array(...)})`\n // Signature: `new Buffer(gl, new Float32Array(...))`\n // Signature: `new Buffer(gl, 100)`\n initialize(props: ClassicBufferProps = {}): this {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n props = {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n if (Number.isFinite(props)) {\n // @ts-expect-error\n props = {byteLength: props};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n\n // Initialize member fields\n this.webglUsage = props.webglUsage || GL.STATIC_DRAW;\n this.debugData = null;\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, props.accessor));\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._setData(props.data, props.offset, props.byteLength);\n } else {\n this._setByteLength(props.byteLength || 0);\n }\n\n return this;\n }\n\n setProps(props: ClassicBufferProps): this {\n props = checkProps('Buffer', props, PROP_CHECKS_SET_PROPS);\n\n if ('accessor' in props) {\n this.setAccessor(props.accessor);\n }\n\n return this;\n }\n\n // Optionally stores an accessor with the buffer, makes it easier to use it as an attribute later\n // {type, size = 1, offset = 0, stride = 0, normalized = false, integer = false, divisor = 0}\n setAccessor(accessor: AccessorObject | Accessor): this {\n // NOTE: From luma.gl v7.0, Accessors have an optional `buffer `field\n // (mainly to support \"interleaving\")\n // To avoid confusion, ensure `buffer.accessor` does not have a `buffer.accessor.buffer` field:\n accessor = Object.assign({}, accessor);\n // @ts-expect-error\n delete accessor.buffer;\n\n // This new statement ensures that an \"accessor object\" is re-packaged as an Accessor instance\n this.accessor = new Accessor(accessor);\n return this;\n }\n\n // Allocate a bigger GPU buffer (if the current buffer is not big enough).\n // If a reallocation is triggered it clears the buffer\n // Returns:\n // `true`: buffer was reallocated, data was cleared\n // `false`: buffer was big enough, data is intact\n reallocate(byteLength: number): boolean {\n if (byteLength > this.byteLength) {\n this._setByteLength(byteLength);\n return true;\n }\n this.bytesUsed = byteLength;\n return false;\n }\n\n // Update with new data. Reinitializes the buffer\n setData(props: ClassicBufferProps) {\n return this.initialize(props);\n }\n\n // Updates a subset of a buffer object's data store.\n // Data (Typed Array or ArrayBuffer), length is inferred unless provided\n // Offset into buffer\n // WebGL2 only: Offset into srcData\n // WebGL2 only: Number of bytes to be copied\n subData(options: TypedArray | {data: TypedArray, offset?: number; srcOffset?: number; byteLength?: number, length?: number}) {\n // Signature: buffer.subData(new Float32Array([...]))\n if (ArrayBuffer.isView(options)) {\n options = {data: options};\n }\n\n const {data, offset = 0, srcOffset = 0} = options;\n const byteLength = options.byteLength || options.length;\n\n assert(data);\n\n // Create the buffer - binding it here for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n // @ts-expect-error\n const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n this.gl.bindBuffer(target, this.handle);\n // WebGL2: subData supports additional srcOffset and length parameters\n if (srcOffset !== 0 || byteLength !== undefined) {\n assertWebGL2Context(this.gl);\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, offset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n this.debugData = null;\n\n this._inferType(data);\n\n return this;\n }\n\n /**\n * Copies part of the data of another buffer into this buffer\n * @note WEBGL2 ONLY\n */\n copyData(options: {\n sourceBuffer: any;\n readOffset?: number;\n writeOffset?: number;\n size: any;\n }): this {\n const {sourceBuffer, readOffset = 0, writeOffset = 0, size} = options;\n const {gl, gl2} = this;\n assertWebGL2Context(gl);\n\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n gl.bindBuffer(GL.COPY_READ_BUFFER, sourceBuffer.handle);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, this.handle);\n gl2.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);\n gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n this.debugData = null;\n\n return this;\n }\n\n /**\n * Reads data from buffer into an ArrayBufferView or SharedArrayBuffer.\n * @note WEBGL2 ONLY\n */\n getData(options?: {\n dstData?: any;\n srcByteOffset?: number;\n dstOffset?: number;\n length?: number;\n }): any {\n let {dstData = null, length = 0} = options || {};\n const {srcByteOffset = 0, dstOffset = 0} = options || {};\n assertWebGL2Context(this.gl);\n\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);\n\n const dstElementOffset = dstOffset;\n\n let dstAvailableElementCount;\n let dstElementCount;\n if (dstData) {\n dstElementCount = dstData.length;\n dstAvailableElementCount = dstElementCount - dstElementOffset;\n } else {\n // Allocate ArrayBufferView with enough size to copy all eligible data.\n dstAvailableElementCount = Math.min(\n sourceAvailableElementCount,\n length || sourceAvailableElementCount\n );\n dstElementCount = dstElementOffset + dstAvailableElementCount;\n }\n\n const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);\n length = length || copyElementCount;\n assert(length <= copyElementCount);\n dstData = dstData || new ArrayType(dstElementCount);\n\n // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);\n this.gl2.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n return dstData;\n }\n\n /**\n * Binds a buffer to a given binding point (target).\n * GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER take an index, and optionally a range.\n * - GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER need an index to affect state\n * - GL.UNIFORM_BUFFER: `offset` must be aligned to GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT.\n * - GL.UNIFORM_BUFFER: `size` must be a minimum of GL.UNIFORM_BLOCK_SIZE_DATA.\n */\n bind(options?: {target?: number; index?: any; offset?: number; size: any}): this {\n const {\n target = this.target, // target for the bind operation\n index = this.accessor && this.accessor.index, // index = index of target (indexed bind point)\n offset = 0,\n size\n } = options || {};\n // NOTE: While GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER could\n // be used as direct binding points, they will not affect transform feedback or\n // uniform buffer state. Instead indexed bindings need to be made.\n if (target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER) {\n if (size !== undefined) {\n this.gl2.bindBufferRange(target, index, this.handle, offset, size);\n } else {\n assert(offset === 0); // Make sure offset wasn't supplied\n this.gl2.bindBufferBase(target, index, this.handle);\n }\n } else {\n this.gl.bindBuffer(target, this.handle);\n }\n\n return this;\n }\n\n unbind(options?: {target?: any; index?: any}): this {\n const {target = this.target, index = this.accessor && this.accessor.index} = options || {};\n const isIndexedBuffer = target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER;\n if (isIndexedBuffer) {\n this.gl2.bindBufferBase(target, index, null);\n } else {\n this.gl.bindBuffer(target, null);\n }\n return this;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n // Returns a short initial data array\n getDebugData(): {\n data: any;\n changed: boolean;\n } {\n if (!this.debugData) {\n this.debugData = this.getData({length: Math.min(DEBUG_DATA_LENGTH, this.byteLength)});\n return {data: this.debugData, changed: true};\n }\n return {data: this.debugData, changed: false};\n }\n\n invalidateDebugData() {\n this.debugData = null;\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _setData(data, offset: number = 0, byteLength: number = data.byteLength + offset): this {\n assert(ArrayBuffer.isView(data));\n\n this.trackDeallocatedMemory();\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, offset, data);\n this.gl.bindBuffer(target, null);\n\n this.debugData = data.slice(0, DEBUG_DATA_LENGTH);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n\n // infer GL type from supplied typed array\n const type = getGLTypeFromTypedArray(data);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _setByteLength(byteLength: number, webglUsage = this.webglUsage): this {\n assert(byteLength >= 0);\n\n this.trackDeallocatedMemory();\n\n // Workaround needed for Safari (#291):\n // gl.bufferData with size equal to 0 crashes. Instead create zero sized array.\n let data = byteLength;\n if (byteLength === 0) {\n // @ts-expect-error\n data = new Float32Array(0);\n }\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.webglUsage = webglUsage;\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n this.trackAllocatedMemory(byteLength);\n\n return this;\n }\n\n // Binding a buffer for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n _getTarget() {\n // @ts-expect-error\n return this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getAvailableElementCount(srcByteOffset: number) {\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;\n return this.getElementCount() - sourceElementOffset;\n }\n\n // Automatically infers type from typed array passed to setData\n // Note: No longer that useful, since type is now autodeduced from the compiled shaders\n _inferType(data) {\n if (!this.accessor.type) {\n this.setAccessor(new Accessor(this.accessor, {type: getGLTypeFromTypedArray(data)}));\n }\n }\n\n // RESOURCE METHODS\n\n getParameter(pname: GL): any {\n this.gl.bindBuffer(this.target, this.handle);\n const value = this.gl.getBufferParameter(this.target, pname);\n this.gl.bindBuffer(this.target, null);\n return value;\n }\n\n // DEPRECATIONS - v7.0\n /** @deprecated Use Buffer.accessor.type */\n get type() {\n return this.accessor.type;\n }\n}\n"],"file":"buffer.js"}
|
|
1
|
+
{"version":3,"file":"buffer.js","names":["assert","checkProps","GL","assertWebGL2Context","Accessor","getGLTypeFromTypedArray","getTypedArrayFromGLType","WebGLDevice","WEBGLBuffer","DEBUG_DATA_LENGTH","DEPRECATED_PROPS","offset","stride","type","size","divisor","normalized","integer","instanced","isInstanced","PROP_CHECKS_INITIALIZE","removedProps","replacedProps","bytes","deprecatedProps","PROP_CHECKS_SET_PROPS","getWEBGLBufferProps","props","ArrayBuffer","isView","data","byteLength","bufferProps","byteOffset","ClassicBuffer","constructor","device","arguments","length","undefined","attach","_defineProperty","setAccessor","Object","assign","accessor","seal","write","subData","getElementCount","Math","round","getBytesPerElement","getVertexCount","getBytesPerVertex","initialize","Number","isFinite","webglUsage","STATIC_DRAW","debugData","_setData","_setByteLength","setProps","buffer","reallocate","bytesUsed","setData","options","srcOffset","target","gl","webgl2","COPY_WRITE_BUFFER","bindBuffer","handle","bufferSubData","_inferType","copyData","sourceBuffer","readOffset","writeOffset","gl2","COPY_READ_BUFFER","copyBufferSubData","getData","_this$gl","dstData","srcByteOffset","dstOffset","ArrayType","FLOAT","clamped","sourceAvailableElementCount","_getAvailableElementCount","dstElementOffset","dstAvailableElementCount","dstElementCount","min","copyElementCount","getBufferSubData","bind","index","UNIFORM_BUFFER","TRANSFORM_FEEDBACK_BUFFER","_this$gl2","bindBufferRange","_this$gl3","bindBufferBase","unbind","isIndexedBuffer","_this$gl4","getDebugData","changed","invalidateDebugData","trackDeallocatedMemory","_getTarget","bufferData","slice","trackAllocatedMemory","Float32Array","sourceElementOffset","BYTES_PER_ELEMENT","getParameter","pname","value","getBufferParameter"],"sources":["../../src/classic/buffer.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport type {Device, BufferProps, TypedArray} from '@luma.gl/api';\nimport {assert, checkProps} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {assertWebGL2Context} from '../context/context/webgl-checks';\nimport {AccessorObject} from '../types';\nimport {Accessor} from './accessor';\nimport {getGLTypeFromTypedArray, getTypedArrayFromGLType} from './typed-array-utils';\n\nimport {WebGLDevice} from '../adapter/webgl-device';\nimport {WEBGLBuffer} from '../adapter/resources/webgl-buffer';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n// Shared prop checks for constructor and setProps\nconst DEPRECATED_PROPS = {\n offset: 'accessor.offset',\n stride: 'accessor.stride',\n type: 'accessor.type',\n size: 'accessor.size',\n divisor: 'accessor.divisor',\n normalized: 'accessor.normalized',\n integer: 'accessor.integer',\n instanced: 'accessor.divisor',\n isInstanced: 'accessor.divisor'\n};\n\n// Prop checks for constructor\nconst PROP_CHECKS_INITIALIZE = {\n removedProps: {},\n replacedProps: {\n bytes: 'byteLength'\n },\n // new Buffer() with individual accessor props is still used in apps, emit warnings\n deprecatedProps: DEPRECATED_PROPS\n};\n\n// Prop checks for setProps\nconst PROP_CHECKS_SET_PROPS = {\n // Buffer.setProps() with individual accessor props is rare => emit errors\n removedProps: DEPRECATED_PROPS\n};\n\nfunction getWEBGLBufferProps(props: ClassicBufferProps | ArrayBufferView | number): BufferProps {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n return {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n else if (typeof props === 'number') {\n return {byteLength: props };\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n const bufferProps = {...props };\n if (bufferProps.offset) {\n bufferProps.byteOffset = bufferProps.offset;\n }\n return bufferProps;\n}\n\n/** WebGL Buffer interface */\nexport type ClassicBufferProps = BufferProps & {\n handle?: WebGLBuffer;\n\n target?: number;\n webglUsage?: number;\n\n accessor?: AccessorObject;\n\n /** @deprecated */\n index?: number;\n /** @deprecated */\n offset?: number;\n /** @deprecated */\n size?: number;\n /** @deprecated */\n type?: number\n}\n\n/** WebGL Buffer interface */\nexport class ClassicBuffer extends WEBGLBuffer {\n usage: number;\n accessor: Accessor;\n\n constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);\n constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);\n constructor(device: Device | WebGLRenderingContext, byteLength: number);\n\n constructor(device: Device | WebGLRenderingContext, props = {}) {\n super(WebGLDevice.attach(device), getWEBGLBufferProps(props));\n\n // Base class initializes\n // this.initialize(props);\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, (props as ClassicBufferProps).accessor));\n\n // infer GL type from supplied typed array\n if (this.props.data) {\n const type = getGLTypeFromTypedArray(this.props.data as TypedArray);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n }\n\n Object.seal(this);\n }\n\n override write(data: TypedArray, byteOffset?: number): void {\n this.subData({data, offset: byteOffset});\n }\n\n // returns number of elements in the buffer (assuming that the full buffer is used)\n getElementCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));\n }\n\n // returns number of vertices in the buffer (assuming that the full buffer is used)\n getVertexCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerVertex(accessor));\n }\n\n // Creates and initializes the buffer object's data store.\n // Signature: `new Buffer(gl, {data: new Float32Array(...)})`\n // Signature: `new Buffer(gl, new Float32Array(...))`\n // Signature: `new Buffer(gl, 100)`\n initialize(props: ClassicBufferProps = {}): this {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n props = {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n if (Number.isFinite(props)) {\n // @ts-expect-error\n props = {byteLength: props};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n\n // Initialize member fields\n this.webglUsage = props.webglUsage || GL.STATIC_DRAW;\n this.debugData = null;\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, props.accessor));\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._setData(props.data, props.offset, props.byteLength);\n } else {\n this._setByteLength(props.byteLength || 0);\n }\n\n return this;\n }\n\n setProps(props: ClassicBufferProps): this {\n props = checkProps('Buffer', props, PROP_CHECKS_SET_PROPS);\n\n if ('accessor' in props) {\n this.setAccessor(props.accessor);\n }\n\n return this;\n }\n\n // Optionally stores an accessor with the buffer, makes it easier to use it as an attribute later\n // {type, size = 1, offset = 0, stride = 0, normalized = false, integer = false, divisor = 0}\n setAccessor(accessor: AccessorObject | Accessor): this {\n // NOTE: From luma.gl v7.0, Accessors have an optional `buffer `field\n // (mainly to support \"interleaving\")\n // To avoid confusion, ensure `buffer.accessor` does not have a `buffer.accessor.buffer` field:\n accessor = Object.assign({}, accessor);\n // @ts-expect-error\n delete accessor.buffer;\n\n // This new statement ensures that an \"accessor object\" is re-packaged as an Accessor instance\n this.accessor = new Accessor(accessor);\n return this;\n }\n\n // Allocate a bigger GPU buffer (if the current buffer is not big enough).\n // If a reallocation is triggered it clears the buffer\n // Returns:\n // `true`: buffer was reallocated, data was cleared\n // `false`: buffer was big enough, data is intact\n reallocate(byteLength: number): boolean {\n if (byteLength > this.byteLength) {\n this._setByteLength(byteLength);\n return true;\n }\n this.bytesUsed = byteLength;\n return false;\n }\n\n // Update with new data. Reinitializes the buffer\n setData(props: ClassicBufferProps) {\n return this.initialize(props);\n }\n\n // Updates a subset of a buffer object's data store.\n // Data (Typed Array or ArrayBuffer), length is inferred unless provided\n // Offset into buffer\n // WebGL2 only: Offset into srcData\n // WebGL2 only: Number of bytes to be copied\n subData(options: TypedArray | {data: TypedArray, offset?: number; srcOffset?: number; byteLength?: number, length?: number}) {\n // Signature: buffer.subData(new Float32Array([...]))\n if (ArrayBuffer.isView(options)) {\n options = {data: options};\n }\n\n const {data, offset = 0, srcOffset = 0} = options;\n const byteLength = options.byteLength || options.length;\n\n assert(data);\n\n // Create the buffer - binding it here for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n // @ts-expect-error\n const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n this.gl.bindBuffer(target, this.handle);\n // WebGL2: subData supports additional srcOffset and length parameters\n if (srcOffset !== 0 || byteLength !== undefined) {\n assertWebGL2Context(this.gl);\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, offset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n this.debugData = null;\n\n this._inferType(data);\n\n return this;\n }\n\n /**\n * Copies part of the data of another buffer into this buffer\n * @note WEBGL2 ONLY\n */\n copyData(options: {\n sourceBuffer: any;\n readOffset?: number;\n writeOffset?: number;\n size: any;\n }): this {\n const {sourceBuffer, readOffset = 0, writeOffset = 0, size} = options;\n const {gl, gl2} = this;\n assertWebGL2Context(gl);\n\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n gl.bindBuffer(GL.COPY_READ_BUFFER, sourceBuffer.handle);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, this.handle);\n gl2?.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);\n gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n this.debugData = null;\n\n return this;\n }\n\n /**\n * Reads data from buffer into an ArrayBufferView or SharedArrayBuffer.\n * @note WEBGL2 ONLY\n */\n override getData(options?: {\n dstData?: any;\n srcByteOffset?: number;\n dstOffset?: number;\n length?: number;\n }): any {\n let {dstData = null, length = 0} = options || {};\n const {srcByteOffset = 0, dstOffset = 0} = options || {};\n assertWebGL2Context(this.gl);\n\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);\n\n const dstElementOffset = dstOffset;\n\n let dstAvailableElementCount;\n let dstElementCount;\n if (dstData) {\n dstElementCount = dstData.length;\n dstAvailableElementCount = dstElementCount - dstElementOffset;\n } else {\n // Allocate ArrayBufferView with enough size to copy all eligible data.\n dstAvailableElementCount = Math.min(\n sourceAvailableElementCount,\n length || sourceAvailableElementCount\n );\n dstElementCount = dstElementOffset + dstAvailableElementCount;\n }\n\n const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);\n length = length || copyElementCount;\n assert(length <= copyElementCount);\n dstData = dstData || new ArrayType(dstElementCount);\n\n // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);\n this.gl2?.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n return dstData;\n }\n\n /**\n * Binds a buffer to a given binding point (target).\n * GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER take an index, and optionally a range.\n * - GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER need an index to affect state\n * - GL.UNIFORM_BUFFER: `offset` must be aligned to GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT.\n * - GL.UNIFORM_BUFFER: `size` must be a minimum of GL.UNIFORM_BLOCK_SIZE_DATA.\n */\n bind(options?: {target?: number; index?: any; offset?: number; size: any}): this {\n const {\n target = this.target, // target for the bind operation\n index = this.accessor && this.accessor.index, // index = index of target (indexed bind point)\n offset = 0,\n size\n } = options || {};\n // NOTE: While GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER could\n // be used as direct binding points, they will not affect transform feedback or\n // uniform buffer state. Instead indexed bindings need to be made.\n if (target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER) {\n if (size !== undefined) {\n this.gl2?.bindBufferRange(target, index, this.handle, offset, size);\n } else {\n assert(offset === 0); // Make sure offset wasn't supplied\n this.gl2?.bindBufferBase(target, index, this.handle);\n }\n } else {\n this.gl.bindBuffer(target, this.handle);\n }\n\n return this;\n }\n\n unbind(options?: {target?: any; index?: any}): this {\n const {target = this.target, index = this.accessor && this.accessor.index} = options || {};\n const isIndexedBuffer = target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER;\n if (isIndexedBuffer) {\n this.gl2?.bindBufferBase(target, index, null);\n } else {\n this.gl.bindBuffer(target, null);\n }\n return this;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n // Returns a short initial data array\n getDebugData(): {\n data: any;\n changed: boolean;\n } {\n if (!this.debugData) {\n this.debugData = this.getData({length: Math.min(DEBUG_DATA_LENGTH, this.byteLength)});\n return {data: this.debugData, changed: true};\n }\n return {data: this.debugData, changed: false};\n }\n\n invalidateDebugData() {\n this.debugData = null;\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _setData(data, offset: number = 0, byteLength: number = data.byteLength + offset): this {\n assert(ArrayBuffer.isView(data));\n\n this.trackDeallocatedMemory();\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, offset, data);\n this.gl.bindBuffer(target, null);\n\n this.debugData = data.slice(0, DEBUG_DATA_LENGTH);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n\n // infer GL type from supplied typed array\n const type = getGLTypeFromTypedArray(data);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _setByteLength(byteLength: number, webglUsage = this.webglUsage): this {\n assert(byteLength >= 0);\n\n this.trackDeallocatedMemory();\n\n // Workaround needed for Safari (#291):\n // gl.bufferData with size equal to 0 crashes. Instead create zero sized array.\n let data = byteLength;\n if (byteLength === 0) {\n // @ts-expect-error\n data = new Float32Array(0);\n }\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.webglUsage = webglUsage;\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n this.trackAllocatedMemory(byteLength);\n\n return this;\n }\n\n // Binding a buffer for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n _getTarget() {\n // @ts-expect-error\n return this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getAvailableElementCount(srcByteOffset: number) {\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;\n return this.getElementCount() - sourceElementOffset;\n }\n\n // Automatically infers type from typed array passed to setData\n // Note: No longer that useful, since type is now autodeduced from the compiled shaders\n _inferType(data) {\n if (!this.accessor.type) {\n this.setAccessor(new Accessor(this.accessor, {type: getGLTypeFromTypedArray(data)}));\n }\n }\n\n // RESOURCE METHODS\n\n getParameter(pname: GL): any {\n this.gl.bindBuffer(this.target, this.handle);\n const value = this.gl.getBufferParameter(this.target, pname);\n this.gl.bindBuffer(this.target, null);\n return value;\n }\n\n // DEPRECATIONS - v7.0\n /** @deprecated Use Buffer.accessor.type */\n get type() {\n return this.accessor.type;\n }\n}\n"],"mappings":";AAGA,SAAQA,MAAM,EAAEC,UAAU,QAAO,cAAc;AAC/C,OAAOC,EAAE,MAAM,oBAAoB;AAAC,SAC5BC,mBAAmB;AAAA,SAEnBC,QAAQ;AAAA,SACRC,uBAAuB,EAAEC,uBAAuB;AAAA,SAEhDC,WAAW;AAAA,SACXC,WAAW;AAEnB,MAAMC,iBAAiB,GAAG,EAAE;AAG5B,MAAMC,gBAAgB,GAAG;EACvBC,MAAM,EAAE,iBAAiB;EACzBC,MAAM,EAAE,iBAAiB;EACzBC,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE,eAAe;EACrBC,OAAO,EAAE,kBAAkB;EAC3BC,UAAU,EAAE,qBAAqB;EACjCC,OAAO,EAAE,kBAAkB;EAC3BC,SAAS,EAAE,kBAAkB;EAC7BC,WAAW,EAAE;AACf,CAAC;AAGD,MAAMC,sBAAsB,GAAG;EAC7BC,YAAY,EAAE,CAAC,CAAC;EAChBC,aAAa,EAAE;IACbC,KAAK,EAAE;EACT,CAAC;EAEDC,eAAe,EAAEd;AACnB,CAAC;AAGD,MAAMe,qBAAqB,GAAG;EAE5BJ,YAAY,EAAEX;AAChB,CAAC;AAED,SAASgB,mBAAmBA,CAACC,KAAoD,EAAe;EAE9F,IAAIC,WAAW,CAACC,MAAM,CAACF,KAAK,CAAC,EAAE;IAC7B,OAAO;MAACG,IAAI,EAAEH;IAAK,CAAC;EACtB,CAAC,MAGI,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACl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;IAC/C,MAAME,SAAS,GAAGpF,uBAAuB,CAAC,IAAI,CAACuC,QAAQ,CAAChC,IAAI,IAAIX,EAAE,CAACyF,KAAK,EAAE;MAACC,OAAO,EAAE;IAAK,CAAC,CAAC;IAC3F,MAAM6B,mBAAmB,GAAGjC,aAAa,GAAGE,SAAS,CAACgC,iBAAiB;IACvE,OAAO,IAAI,CAACzE,eAAe,EAAE,GAAGwE,mBAAmB;EACrD;EAIA5C,UAAUA,CAAC/C,IAAI,EAAE;IACf,IAAI,CAAC,IAAI,CAACe,QAAQ,CAAChC,IAAI,EAAE;MACvB,IAAI,CAAC6B,WAAW,CAAC,IAAItC,QAAQ,CAAC,IAAI,CAACyC,QAAQ,EAAE;QAAChC,IAAI,EAAER,uBAAuB,CAACyB,IAAI;MAAC,CAAC,CAAC,CAAC;IACtF;EACF;EAIA6F,YAAYA,CAACC,KAAS,EAAO;IAC3B,IAAI,CAACrD,EAAE,CAACG,UAAU,CAAC,IAAI,CAACJ,MAAM,EAAE,IAAI,CAACK,MAAM,CAAC;IAC5C,MAAMkD,KAAK,GAAG,IAAI,CAACtD,EAAE,CAACuD,kBAAkB,CAAC,IAAI,CAACxD,MAAM,EAAEsD,KAAK,CAAC;IAC5D,IAAI,CAACrD,EAAE,CAACG,UAAU,CAAC,IAAI,CAACJ,MAAM,EAAE,IAAI,CAAC;IACrC,OAAOuD,KAAK;EACd;EAIA,IAAIhH,IAAIA,CAAA,EAAG;IACT,OAAO,IAAI,CAACgC,QAAQ,CAAChC,IAAI;EAC3B;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypedArray } from '@luma.gl/api
|
|
1
|
+
import { TypedArray } from '@luma.gl/api';
|
|
2
2
|
import { GLType } from '../types/webgl';
|
|
3
3
|
declare type TypedArrayConstructor = Float32ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor;
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-array-utils.d.ts","sourceRoot":"","sources":["../../src/classic/typed-array-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typed-array-utils.d.ts","sourceRoot":"","sources":["../../src/classic/typed-array-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAA;AAIrC,aAAK,qBAAqB,GACtB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,4BAA4B,GAC5B,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,CAAC;AAE1B;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,UAAU,GAAG,MAAM,CAuBvE;AAED;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,GAAG,EACX,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GACA,qBAAqB,CAwBvB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE;IAChC,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,GAAG,IAAI,CAgBP;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE;IACnC,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;CACb,GAAG;IACF,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAaA"}
|