@luma.gl/webgl 9.0.0-alpha.15 → 9.0.0-alpha.17
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.map +1 -1
- package/dist/adapter/converters/device-parameters.js +3 -23
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/renderbuffer-formats.js +1 -5
- package/dist/adapter/converters/renderbuffer-formats.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +3 -58
- 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 +10 -54
- package/dist/adapter/converters/texture-formats.js.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +0 -9
- package/dist/adapter/converters/vertex-formats.js.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +5 -22
- 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 +6 -12
- 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.js +9 -57
- 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 +0 -30
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/uniforms.js +0 -10
- package/dist/adapter/helpers/uniforms.js.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.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +4 -20
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +13 -60
- package/dist/adapter/objects/webgl-resource.js.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.js +6 -16
- package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +13 -42
- package/dist/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +2 -17
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.js +1 -14
- 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.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +5 -65
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +1 -8
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +9 -98
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +1 -13
- package/dist/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/adapter/resources/webgl-shader.d.ts +1 -2
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +3 -17
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +44 -162
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +2 -16
- package/dist/adapter/webgl-canvas-context.js.map +1 -1
- package/dist/adapter/webgl-device.d.ts +5 -0
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +40 -107
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/classic/accessor.js +11 -35
- package/dist/classic/accessor.js.map +1 -1
- package/dist/classic/buffer.d.ts.map +1 -1
- package/dist/classic/buffer.js +20 -76
- package/dist/classic/buffer.js.map +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-browser-context.d.ts +1 -0
- package/dist/context/context/create-browser-context.d.ts.map +1 -1
- package/dist/context/context/create-browser-context.js +6 -14
- package/dist/context/context/create-browser-context.js.map +1 -1
- package/dist/context/context/create-headless-context.js +6 -7
- package/dist/context/context/create-headless-context.js.map +1 -1
- 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 +6 -18
- package/dist/context/debug/spector.js.map +1 -1
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +4 -22
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +4 -15
- package/dist/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +1 -20
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/context/polyfill/context-data.js +0 -2
- package/dist/context/polyfill/context-data.js.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 +17 -24
- package/dist/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/context/polyfill/polyfill-table.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-table.js +3 -26
- 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 +14 -48
- package/dist/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +3 -9
- package/dist/context/state-tracker/with-parameters.js.map +1 -1
- package/dist/dist.dev.js +9205 -0
- package/dist/index.cjs +5948 -0
- package/dist/index.d.ts +0 -2
- 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 +4 -4
- 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 +5 -2
- package/src/adapter/converters/sampler-parameters.ts +4 -2
- package/src/adapter/converters/texture-formats.ts +3 -1
- package/src/adapter/device-helpers/get-device-info.ts +8 -8
- package/src/adapter/helpers/get-shader-info.ts +37 -0
- package/src/adapter/helpers/get-shader-layout.ts +4 -4
- package/src/adapter/helpers/parse-shader-compiler-log.ts +2 -2
- package/src/adapter/helpers/set-uniform.ts +2 -0
- package/src/adapter/objects/webgl-renderbuffer.ts +1 -1
- package/src/adapter/objects/webgl-resource.ts +1 -1
- package/src/adapter/objects/webgl-vertex-array-object.ts +1 -1
- package/src/adapter/resources/webgl-buffer.ts +5 -5
- package/src/adapter/resources/webgl-command-encoder.ts +1 -1
- package/src/adapter/resources/webgl-framebuffer.ts +3 -4
- package/src/adapter/resources/webgl-render-pass.ts +1 -1
- package/src/adapter/resources/webgl-render-pipeline.ts +19 -20
- package/src/adapter/resources/webgl-shader.ts +3 -3
- package/src/adapter/resources/webgl-texture.ts +8 -9
- package/src/adapter/webgl-canvas-context.ts +2 -2
- package/src/adapter/webgl-device.ts +13 -3
- package/src/classic/accessor.ts +1 -1
- package/src/classic/buffer.ts +3 -3
- package/src/classic/typed-array-utils.ts +1 -1
- package/src/context/.DS_Store +0 -0
- package/src/context/context/create-browser-context.ts +4 -2
- package/src/context/context/create-headless-context.ts +2 -2
- package/src/context/debug/spector.ts +5 -4
- package/src/context/debug/webgl-developer-tools.ts +1 -1
- package/src/context/polyfill/polyfill-table.ts +1 -0
- package/src/context/polyfill/polyfill-vertex-array-object.ts +2 -0
- package/src/context/state-tracker/track-context-state.ts +6 -5
- package/src/context/state-tracker/with-parameters.ts +1 -1
- package/src/index.ts +1 -5
- package/src/types/webgl.ts +6 -4
- 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/es5/adapter/converters/device-parameters.js +0 -174
- 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 -245
- package/dist/es5/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/texture-formats.js +0 -1022
- package/dist/es5/adapter/converters/texture-formats.js.map +0 -1
- package/dist/es5/adapter/converters/vertex-formats.js +0 -48
- package/dist/es5/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/es5/adapter/device-helpers/device-features.js +0 -155
- 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 -59
- 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 -389
- 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 -287
- 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 -242
- 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 -347
- package/dist/es5/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pass.js +0 -62
- package/dist/es5/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pipeline.js +0 -494
- package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-sampler.js +0 -101
- package/dist/es5/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-shader.js +0 -150
- package/dist/es5/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-texture.js +0 -980
- package/dist/es5/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/es5/adapter/webgl-canvas-context.js +0 -96
- package/dist/es5/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/es5/adapter/webgl-device.js +0 -474
- 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 -468
- 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/create-browser-context.js +0 -83
- package/dist/es5/context/context/create-browser-context.js.map +0 -1
- package/dist/es5/context/context/create-headless-context.js +0 -60
- package/dist/es5/context/context/create-headless-context.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 -192
- package/dist/es5/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/es5/context/parameters/unified-parameter-api.js +0 -101
- package/dist/es5/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/es5/context/parameters/webgl-parameter-tables.js +0 -393
- package/dist/es5/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/es5/context/polyfill/context-data.js +0 -21
- package/dist/es5/context/polyfill/context-data.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 -134
- package/dist/es5/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-table.js +0 -167
- 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 -210
- package/dist/es5/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/es5/context/state-tracker/with-parameters.js +0 -52
- 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 -157
- 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 -227
- package/dist/esm/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/texture-formats.js +0 -945
- package/dist/esm/adapter/converters/texture-formats.js.map +0 -1
- package/dist/esm/adapter/converters/vertex-formats.js +0 -38
- package/dist/esm/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/esm/adapter/device-helpers/device-features.js +0 -112
- 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 -48
- 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 -328
- 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 -210
- 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 -162
- 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 -267
- package/dist/esm/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-render-pass.js +0 -21
- 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 -54
- package/dist/esm/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-shader.js +0 -76
- package/dist/esm/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-texture.js +0 -832
- package/dist/esm/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/esm/adapter/webgl-canvas-context.js +0 -55
- package/dist/esm/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/esm/adapter/webgl-device.js +0 -346
- 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 -383
- 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/create-browser-context.js +0 -61
- package/dist/esm/context/context/create-browser-context.js.map +0 -1
- package/dist/esm/context/context/create-headless-context.js +0 -43
- package/dist/esm/context/context/create-headless-context.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 -115
- package/dist/esm/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/esm/context/parameters/unified-parameter-api.js +0 -66
- package/dist/esm/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/esm/context/parameters/webgl-parameter-tables.js +0 -446
- package/dist/esm/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/esm/context/polyfill/context-data.js +0 -14
- package/dist/esm/context/polyfill/context-data.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 -91
- package/dist/esm/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-table.js +0 -161
- 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 -182
- package/dist/esm/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/esm/context/state-tracker/with-parameters.js +0 -40
- 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/init.ts +0 -4
|
@@ -1,43 +1,38 @@
|
|
|
1
1
|
import { assert } from '@luma.gl/api';
|
|
2
2
|
import GL from '@luma.gl/constants';
|
|
3
3
|
import { getBrowser } from '@probe.gl/env';
|
|
4
|
-
import WebGLResource from
|
|
4
|
+
import WebGLResource from "./webgl-resource.js";
|
|
5
5
|
const ERR_ELEMENTS = 'elements must be GL.ELEMENT_ARRAY_BUFFER';
|
|
6
6
|
export default class WEBGLVertexArrayObject extends WebGLResource {
|
|
7
7
|
get [Symbol.toStringTag]() {
|
|
8
8
|
return 'BaseVertexArrayObject';
|
|
9
9
|
}
|
|
10
|
-
|
|
11
10
|
constructor(device, props) {
|
|
12
11
|
super(device, props, {});
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
_createHandle() {
|
|
16
14
|
return this.gl2.createVertexArray();
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
_deleteHandle() {
|
|
20
17
|
this.gl2.deleteVertexArray(this.handle);
|
|
21
18
|
return [this.elements];
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
_bindHandle(handle) {
|
|
25
21
|
this.gl2.bindVertexArray(handle);
|
|
26
22
|
}
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
setElementBuffer() {
|
|
24
|
+
let elementBuffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
25
|
+
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29
26
|
assert(!elementBuffer || elementBuffer.target === GL.ELEMENT_ARRAY_BUFFER, ERR_ELEMENTS);
|
|
30
27
|
this.bind(() => {
|
|
31
28
|
this.gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, elementBuffer ? elementBuffer.handle : null);
|
|
32
29
|
});
|
|
33
30
|
return this;
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
setBuffer(location, buffer, accessor) {
|
|
37
33
|
if (buffer.target === GL.ELEMENT_ARRAY_BUFFER) {
|
|
38
34
|
return this.setElementBuffer(buffer, accessor);
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
const {
|
|
42
37
|
size,
|
|
43
38
|
type,
|
|
@@ -54,31 +49,26 @@ export default class WEBGLVertexArrayObject extends WebGLResource {
|
|
|
54
49
|
location = Number(location);
|
|
55
50
|
this.bind(() => {
|
|
56
51
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer.handle);
|
|
57
|
-
|
|
58
52
|
if (integer) {
|
|
59
53
|
this.device.assertWebGL2();
|
|
60
54
|
gl2.vertexAttribIPointer(location, size, type, stride, offset);
|
|
61
55
|
} else {
|
|
62
56
|
gl.vertexAttribPointer(location, size, type, normalized, stride, offset);
|
|
63
57
|
}
|
|
64
|
-
|
|
65
58
|
gl.enableVertexAttribArray(location);
|
|
66
59
|
gl2.vertexAttribDivisor(location, divisor || 0);
|
|
67
60
|
});
|
|
68
61
|
return this;
|
|
69
62
|
}
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
enable(location) {
|
|
64
|
+
let enable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
72
65
|
const canDisableAttributeZero = this.device.isWebGL2 || getBrowser() === 'Chrome';
|
|
73
66
|
const canDisableAttribute = canDisableAttributeZero || location !== 0;
|
|
74
|
-
|
|
75
67
|
if (enable || canDisableAttribute) {
|
|
76
68
|
location = Number(location);
|
|
77
69
|
this.bind(() => enable ? this.gl.enableVertexAttribArray(location) : this.gl.disableVertexAttribArray(location));
|
|
78
70
|
}
|
|
79
|
-
|
|
80
71
|
return this;
|
|
81
72
|
}
|
|
82
|
-
|
|
83
73
|
}
|
|
84
74
|
//# sourceMappingURL=webgl-vertex-array-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"webgl-vertex-array-object.js","names":["assert","GL","getBrowser","WebGLResource","ERR_ELEMENTS","WEBGLVertexArrayObject","Symbol","toStringTag","constructor","device","props","_createHandle","gl2","createVertexArray","_deleteHandle","deleteVertexArray","handle","elements","_bindHandle","bindVertexArray","setElementBuffer","elementBuffer","arguments","length","undefined","opts","target","ELEMENT_ARRAY_BUFFER","bind","gl","bindBuffer","setBuffer","location","buffer","accessor","size","type","stride","offset","normalized","integer","divisor","Number","ARRAY_BUFFER","assertWebGL2","vertexAttribIPointer","vertexAttribPointer","enableVertexAttribArray","vertexAttribDivisor","enable","canDisableAttributeZero","isWebGL2","canDisableAttribute","disableVertexAttribArray"],"sources":["../../../src/adapter/objects/webgl-vertex-array-object.ts"],"sourcesContent":["import {assert, ResourceProps} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {getBrowser} from '@probe.gl/env';\n\nimport WebGLDevice from '../webgl-device';\nimport WebGLResource from './webgl-resource';\n\nimport Buffer from '../resources/webgl-buffer';\n\nconst ERR_ELEMENTS = 'elements must be GL.ELEMENT_ARRAY_BUFFER';\n\n/**\n * VertexArrayObject properties\n */\nexport type VertexArrayObjectProps = ResourceProps & {\n};\n\n/** VertexArrayObject wrapper */\nexport default class WEBGLVertexArrayObject extends WebGLResource<VertexArrayObjectProps> {\n override get [Symbol.toStringTag](): string {\n return 'BaseVertexArrayObject';\n }\n\n constructor(device: WebGLDevice, props?: VertexArrayObjectProps) {\n // @ts-expect-error\n super(device, props, {});\n }\n\n override _createHandle() {\n return this.gl2.createVertexArray();\n }\n\n override _deleteHandle(): void {\n this.gl2.deleteVertexArray(this.handle);\n // @ts-expect-error\n return [this.elements];\n // return [this.elements, ...this.buffers];\n }\n\n override _bindHandle(handle: WEBGLVertexArrayObject): void {\n this.gl2.bindVertexArray(handle);\n }\n\n // Set (bind) an elements buffer, for indexed rendering.\n // Must be a Buffer bound to GL.ELEMENT_ARRAY_BUFFER. Constants not supported\n setElementBuffer(elementBuffer: Buffer | null = null, opts = {}) {\n assert(!elementBuffer || elementBuffer.target === GL.ELEMENT_ARRAY_BUFFER, ERR_ELEMENTS);\n\n // The GL.ELEMENT_ARRAY_BUFFER_BINDING is stored on the VertexArrayObject...\n this.bind(() => {\n this.gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, elementBuffer ? elementBuffer.handle : null);\n });\n\n return this;\n }\n\n /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */\n setBuffer(location: number, buffer: Buffer, accessor: any): this {\n // Check target\n if (buffer.target === GL.ELEMENT_ARRAY_BUFFER) {\n return this.setElementBuffer(buffer, accessor);\n }\n\n const {size, type, stride, offset, normalized, integer, divisor} = accessor;\n\n const {gl, gl2} = this;\n location = Number(location);\n\n this.bind(() => {\n // A non-zero buffer object must be bound to the GL_ARRAY_BUFFER target\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer.handle);\n\n // WebGL2 supports *integer* data formats, i.e. GPU will see integer values\n if (integer) {\n this.device.assertWebGL2();\n gl2.vertexAttribIPointer(location, size, type, stride, offset);\n } else {\n // Attaches ARRAY_BUFFER with specified buffer format to location\n gl.vertexAttribPointer(location, size, type, normalized, stride, offset);\n }\n gl.enableVertexAttribArray(location);\n gl2.vertexAttribDivisor(location, divisor || 0);\n\n // NOTE We don't unbind buffer here, typically another buffer will be bound just after\n });\n\n return this;\n }\n\n /**\n * Enabling an attribute location makes it reference the currently bound buffer\n * Disabling an attribute location makes it reference the global constant value\n * TODO - handle single values for size 1 attributes?\n * TODO - convert classic arrays based on known type?\n */\n enable(location: number, enable = true): this {\n // Attribute 0 cannot be disabled in most desktop OpenGL based browsers...\n const canDisableAttributeZero = this.device.isWebGL2 || getBrowser() === 'Chrome';\n const canDisableAttribute = canDisableAttributeZero || location !== 0;\n\n if (enable || canDisableAttribute) {\n location = Number(location);\n this.bind(() =>\n enable\n ? this.gl.enableVertexAttribArray(location)\n : this.gl.disableVertexAttribArray(location)\n );\n }\n return this;\n }\n}\n"],"mappings":"AAAA,SAAQA,MAAM,QAAsB,cAAc;AAClD,OAAOC,EAAE,MAAM,oBAAoB;AACnC,SAAQC,UAAU,QAAO,eAAe;AAAC,OAGlCC,aAAa;AAIpB,MAAMC,YAAY,GAAG,0CAA0C;AAS/D,eAAe,MAAMC,sBAAsB,SAASF,aAAa,CAAyB;EACxF,KAAcG,MAAM,CAACC,WAAW,IAAY;IAC1C,OAAO,uBAAuB;EAChC;EAEAC,WAAWA,CAACC,MAAmB,EAAEC,KAA8B,EAAE;IAE/D,KAAK,CAACD,MAAM,EAAEC,KAAK,EAAE,CAAC,CAAC,CAAC;EAC1B;EAESC,aAAaA,CAAA,EAAG;IACvB,OAAO,IAAI,CAACC,GAAG,CAACC,iBAAiB,EAAE;EACrC;EAESC,aAAaA,CAAA,EAAS;IAC7B,IAAI,CAACF,GAAG,CAACG,iBAAiB,CAAC,IAAI,CAACC,MAAM,CAAC;IAEvC,OAAO,CAAC,IAAI,CAACC,QAAQ,CAAC;EAExB;EAESC,WAAWA,CAACF,MAA8B,EAAQ;IACzD,IAAI,CAACJ,GAAG,CAACO,eAAe,CAACH,MAAM,CAAC;EAClC;EAIAI,gBAAgBA,CAAA,EAAiD;IAAA,IAAhDC,aAA4B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,I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UAAU,GAAE,MAAU,GAAG,IAAI;IAuBnE,gCAAgC;IACjB,SAAS,CACtB,UAAU,GAAE,MAAU,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,CAAC;IAmBvB,oBAAoB;IAIpB,eAAe;IAKf,cAAc;CAIf"}
|
|
@@ -3,51 +3,41 @@ import { Buffer, assert } from '@luma.gl/api';
|
|
|
3
3
|
import GL from '@luma.gl/constants';
|
|
4
4
|
const DEBUG_DATA_LENGTH = 10;
|
|
5
5
|
export default class WEBGLBuffer extends Buffer {
|
|
6
|
-
constructor(device
|
|
6
|
+
constructor(device) {
|
|
7
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7
8
|
super(device, props);
|
|
8
|
-
|
|
9
9
|
_defineProperty(this, "device", void 0);
|
|
10
|
-
|
|
11
10
|
_defineProperty(this, "gl", void 0);
|
|
12
|
-
|
|
13
11
|
_defineProperty(this, "gl2", void 0);
|
|
14
|
-
|
|
15
12
|
_defineProperty(this, "handle", void 0);
|
|
16
|
-
|
|
17
13
|
_defineProperty(this, "target", void 0);
|
|
18
|
-
|
|
19
14
|
_defineProperty(this, "byteLength", void 0);
|
|
20
|
-
|
|
21
15
|
_defineProperty(this, "bytesUsed", void 0);
|
|
22
|
-
|
|
23
16
|
_defineProperty(this, "debugData", null);
|
|
24
|
-
|
|
25
17
|
_defineProperty(this, "webglUsage", void 0);
|
|
26
|
-
|
|
27
18
|
this.device = device;
|
|
28
19
|
this.gl = this.device.gl;
|
|
29
20
|
this.gl2 = this.device.gl2;
|
|
30
21
|
const handle = typeof props === 'object' ? props.handle : undefined;
|
|
31
22
|
this.handle = handle || this.gl.createBuffer();
|
|
32
|
-
this.handle
|
|
23
|
+
device.setSpectorMetadata(this.handle, {
|
|
24
|
+
...this.props,
|
|
33
25
|
data: typeof this.props.data
|
|
34
|
-
};
|
|
26
|
+
});
|
|
35
27
|
this.target = this.props.target || getWebGLTarget(this.props.usage);
|
|
36
28
|
this.webglUsage = this.props.webglUsage || getWebGLUsage(this.props.usage);
|
|
37
29
|
this.debugData = null;
|
|
38
|
-
|
|
39
30
|
if (props.data) {
|
|
40
31
|
this._initWithData(props.data, props.byteOffset, props.byteLength);
|
|
41
32
|
} else {
|
|
42
33
|
this._initWithByteLength(props.byteLength || 0);
|
|
43
34
|
}
|
|
44
35
|
}
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
_initWithData(data) {
|
|
37
|
+
let byteOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
38
|
+
let byteLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : data.byteLength + byteOffset;
|
|
47
39
|
assert(ArrayBuffer.isView(data));
|
|
48
|
-
|
|
49
40
|
const target = this._getWriteTarget();
|
|
50
|
-
|
|
51
41
|
this.gl.bindBuffer(target, this.handle);
|
|
52
42
|
this.gl.bufferData(target, byteLength, this.webglUsage);
|
|
53
43
|
this.gl.bufferSubData(target, byteOffset, data);
|
|
@@ -58,17 +48,13 @@ export default class WEBGLBuffer extends Buffer {
|
|
|
58
48
|
this.trackAllocatedMemory(byteLength);
|
|
59
49
|
return this;
|
|
60
50
|
}
|
|
61
|
-
|
|
62
51
|
_initWithByteLength(byteLength) {
|
|
63
52
|
assert(byteLength >= 0);
|
|
64
53
|
let data = byteLength;
|
|
65
|
-
|
|
66
54
|
if (byteLength === 0) {
|
|
67
55
|
data = new Float32Array(0);
|
|
68
56
|
}
|
|
69
|
-
|
|
70
57
|
const target = this._getWriteTarget();
|
|
71
|
-
|
|
72
58
|
this.gl.bindBuffer(target, this.handle);
|
|
73
59
|
this.gl.bufferData(target, data, this.webglUsage);
|
|
74
60
|
this.gl.bindBuffer(target, null);
|
|
@@ -77,7 +63,6 @@ export default class WEBGLBuffer extends Buffer {
|
|
|
77
63
|
this.byteLength = byteLength;
|
|
78
64
|
return this;
|
|
79
65
|
}
|
|
80
|
-
|
|
81
66
|
destroy() {
|
|
82
67
|
if (!this.destroyed && this.handle) {
|
|
83
68
|
this.removeStats();
|
|
@@ -86,24 +71,23 @@ export default class WEBGLBuffer extends Buffer {
|
|
|
86
71
|
this.destroyed = true;
|
|
87
72
|
}
|
|
88
73
|
}
|
|
89
|
-
|
|
90
|
-
|
|
74
|
+
write(data) {
|
|
75
|
+
let byteOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
91
76
|
const srcOffset = 0;
|
|
92
77
|
const byteLength = data.byteLength;
|
|
93
78
|
const target = this.device.isWebGL2 ? GL.COPY_WRITE_BUFFER : this.target;
|
|
94
79
|
this.gl.bindBuffer(target, this.handle);
|
|
95
|
-
|
|
96
80
|
if (srcOffset !== 0 || byteLength !== undefined) {
|
|
97
81
|
this.device.assertWebGL2();
|
|
98
82
|
this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);
|
|
99
83
|
} else {
|
|
100
84
|
this.gl.bufferSubData(target, byteOffset, data);
|
|
101
85
|
}
|
|
102
|
-
|
|
103
86
|
this.gl.bindBuffer(target, null);
|
|
104
87
|
}
|
|
105
|
-
|
|
106
|
-
|
|
88
|
+
async readAsync() {
|
|
89
|
+
let byteOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
90
|
+
let byteLength = arguments.length > 1 ? arguments[1] : undefined;
|
|
107
91
|
this.device.assertWebGL2();
|
|
108
92
|
const data = new Uint8Array(byteLength);
|
|
109
93
|
const dstOffset = 0;
|
|
@@ -112,51 +96,38 @@ export default class WEBGLBuffer extends Buffer {
|
|
|
112
96
|
this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);
|
|
113
97
|
return data;
|
|
114
98
|
}
|
|
115
|
-
|
|
116
99
|
_invalidateDebugData() {
|
|
117
100
|
this.debugData = null;
|
|
118
101
|
}
|
|
119
|
-
|
|
120
102
|
_getWriteTarget() {
|
|
121
103
|
return this.target;
|
|
122
104
|
}
|
|
123
|
-
|
|
124
105
|
_getReadTarget() {
|
|
125
106
|
return this.target;
|
|
126
|
-
return this.device.isWebGL2 ? GL.COPY_READ_BUFFER : this.target;
|
|
127
107
|
}
|
|
128
|
-
|
|
129
108
|
}
|
|
130
|
-
|
|
131
109
|
function getWebGLTarget(usage) {
|
|
132
110
|
if (usage & Buffer.INDEX) {
|
|
133
111
|
return GL.ELEMENT_ARRAY_BUFFER;
|
|
134
112
|
}
|
|
135
|
-
|
|
136
113
|
if (usage & Buffer.VERTEX) {
|
|
137
114
|
return GL.ARRAY_BUFFER;
|
|
138
115
|
}
|
|
139
|
-
|
|
140
116
|
if (usage & Buffer.UNIFORM) {
|
|
141
117
|
return GL.UNIFORM_BUFFER;
|
|
142
118
|
}
|
|
143
|
-
|
|
144
119
|
return GL.ARRAY_BUFFER;
|
|
145
120
|
}
|
|
146
|
-
|
|
147
121
|
function getWebGLUsage(usage) {
|
|
148
122
|
if (usage & Buffer.INDEX) {
|
|
149
123
|
return GL.STATIC_DRAW;
|
|
150
124
|
}
|
|
151
|
-
|
|
152
125
|
if (usage & Buffer.VERTEX) {
|
|
153
126
|
return GL.STATIC_DRAW;
|
|
154
127
|
}
|
|
155
|
-
|
|
156
128
|
if (usage & Buffer.UNIFORM) {
|
|
157
129
|
return GL.DYNAMIC_DRAW;
|
|
158
130
|
}
|
|
159
|
-
|
|
160
131
|
return GL.DYNAMIC_DRAW;
|
|
161
132
|
}
|
|
162
133
|
//# sourceMappingURL=webgl-buffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgl-buffer.ts"],"names":["Buffer","assert","GL","DEBUG_DATA_LENGTH","WEBGLBuffer","constructor","device","props","gl","gl2","handle","undefined","createBuffer","__SPECTOR_Metadata","data","target","getWebGLTarget","usage","webglUsage","getWebGLUsage","debugData","_initWithData","byteOffset","byteLength","_initWithByteLength","ArrayBuffer","isView","_getWriteTarget","bindBuffer","bufferData","bufferSubData","slice","bytesUsed","trackAllocatedMemory","Float32Array","destroy","destroyed","removeStats","trackDeallocatedMemory","deleteBuffer","write","srcOffset","isWebGL2","COPY_WRITE_BUFFER","assertWebGL2","offset","readAsync","Uint8Array","dstOffset","COPY_READ_BUFFER","getBufferSubData","_invalidateDebugData","_getReadTarget","INDEX","ELEMENT_ARRAY_BUFFER","VERTEX","ARRAY_BUFFER","UNIFORM","UNIFORM_BUFFER","STATIC_DRAW","DYNAMIC_DRAW"],"mappings":";AACA,SAAQA,MAAR,EAAgBC,MAAhB,QAA6B,cAA7B;AACA,OAAOC,EAAP,MAAe,oBAAf;AAGA,MAAMC,iBAAiB,GAAG,EAA1B;AAGA,eAAe,MAAMC,WAAN,SAA0BJ,MAA1B,CAAiC;AAe9CK,EAAAA,WAAW,CAACC,MAAD,EAAsBC,KAAkB,GAAG,EAA3C,EAA+C;AACxD,UAAMD,MAAN,EAAcC,KAAd;;AADwD;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA,uCAN1B,IAM0B;;AAAA;;AAGxD,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKE,EAAL,GAAU,KAAKF,MAAL,CAAYE,EAAtB;AACA,SAAKC,GAAL,GAAW,KAAKH,MAAL,CAAYG,GAAvB;AAEA,UAAMC,MAAM,GAAG,OAAOH,KAAP,KAAiB,QAAjB,GAA6BA,KAAD,CAAuBG,MAAnD,GAA4DC,SAA3E;AACA,SAAKD,MAAL,GAAcA,MAAM,IAAI,KAAKF,EAAL,CAAQI,YAAR,EAAxB;AAEA,SAAKF,MAAL,CAAYG,kBAAZ,GAAiC,EAAC,GAAG,KAAKN,KAAT;AAAgBO,MAAAA,IAAI,EAAE,OAAO,KAAKP,KAAL,CAAWO;AAAxC,KAAjC;AAMA,SAAKC,MAAL,GAAc,KAAKR,KAAL,CAAWQ,MAAX,IAAqBC,cAAc,CAAC,KAAKT,KAAL,CAAWU,KAAZ,CAAjD;AAEA,SAAKC,UAAL,GAAkB,KAAKX,KAAL,CAAWW,UAAX,IAAyBC,aAAa,CAAC,KAAKZ,KAAL,CAAWU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IvC,KAAK,GAAGjB,MAAM,CAACyD,OAAnB,EAA4B;AAC1B,WAAOvD,EAAE,CAACwD,cAAV;AACD;;AAUD,SAAOxD,EAAE,CAACsD,YAAV;AACD;;AAED,SAASrC,aAAT,CAAuBF,KAAvB,EAA0C;AACxC,MAAIA,KAAK,GAAGjB,MAAM,CAACqD,KAAnB,EAA0B;AACxB,WAAOnD,EAAE,CAACyD,WAAV;AACD;;AACD,MAAI1C,KAAK,GAAGjB,MAAM,CAACuD,MAAnB,EAA2B;AACzB,WAAOrD,EAAE,CAACyD,WAAV;AACD;;AACD,MAAI1C,KAAK,GAAGjB,MAAM,CAACyD,OAAnB,EAA4B;AAC1B,WAAOvD,EAAE,CAAC0D,YAAV;AACD;;AACD,SAAO1D,EAAE,CAAC0D,YAAV;AACD","sourcesContent":["import type {BufferProps} from '@luma.gl/api';\nimport {Buffer, assert} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport WebGLDevice from '../webgl-device';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n/** WebGL Buffer interface */\nexport default class WEBGLBuffer extends Buffer {\n readonly device: WebGLDevice;\n readonly gl: WebGLRenderingContext;\n readonly gl2: WebGL2RenderingContext | null;\n readonly handle: WebGLBuffer;\n readonly target: number;\n\n byteLength: number;\n bytesUsed: number;\n debugData: ArrayBuffer | null = null;\n\n webglUsage: number;\n\n // accessor: {};\n\n constructor(device: WebGLDevice, props: BufferProps = {}) {\n super(device, props);\n\n this.device = device;\n this.gl = this.device.gl;\n this.gl2 = this.device.gl2;\n\n const handle = typeof props === 'object' ? (props as BufferProps).handle : undefined;\n this.handle = handle || this.gl.createBuffer();\n // @ts-expect-error Add metadata for spector\n this.handle.__SPECTOR_Metadata = {...this.props, data: typeof this.props.data}; // {name: this.props.id};\n\n // In WebGL1, need to make sure we use GL.ELEMENT_ARRAY_BUFFER when initializing element buffers\n // otherwise buffer type will lock to generic (non-element) buffer\n // In WebGL2, we can use GL.COPY_READ_BUFFER which avoids locking the type here\n // @ts-expect-error Hack - Checking for subclass prop\n this.target = this.props.target || getWebGLTarget(this.props.usage);\n // @ts-expect-error Hack - Checking for subclass prop\n this.webglUsage = this.props.webglUsage || getWebGLUsage(this.props.usage);\n this.debugData = null;\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._initWithData(props.data, props.byteOffset, props.byteLength);\n } else {\n this._initWithByteLength(props.byteLength || 0);\n }\n\n // Deprecated: Merge main props and accessor\n // this.accessor = {...props.accessor};\n\n // Object.seal(this);\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _initWithData(data, byteOffset: number = 0, byteLength: number = data.byteLength + byteOffset): this {\n assert(ArrayBuffer.isView(data));\n\n const target = this._getWriteTarget();\n\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, byteOffset, 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 return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _initWithByteLength(byteLength: number): this {\n assert(byteLength >= 0);\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._getWriteTarget();\n\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, this.webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n return this;\n }\n\n override destroy(): void {\n if (!this.destroyed && this.handle) {\n this.removeStats();\n this.trackDeallocatedMemory();\n this.gl.deleteBuffer(this.handle);\n this.destroyed = true;\n // this.handle = null;\n }\n }\n\n override write(data: ArrayBufferView, byteOffset: number = 0): void {\n const srcOffset = 0;\n const byteLength = data.byteLength;\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 const target = this.device.isWebGL2 ? 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 this.device.assertWebGL2();\n\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, byteOffset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n // this.debugData = data.slice(byteOffset, 40);\n }\n\n /** Read data from the buffer */\n override async readAsync(\n byteOffset: number = 0,\n byteLength?: number\n ): Promise<ArrayBuffer> {\n this.device.assertWebGL2();\n\n const data = new Uint8Array(byteLength);\n const dstOffset = 0;\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, byteOffset, data, dstOffset, byteLength);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n // this.debugData = null;\n\n return data;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n _invalidateDebugData() {\n this.debugData = null;\n }\n\n _getWriteTarget() {\n return this.target;\n // return this.device.isWebGL2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getReadTarget() {\n return this.target;\n return this.device.isWebGL2 ? GL.COPY_READ_BUFFER : this.target;\n }\n}\n\n// static MAP_READ = 0x01;\n// static MAP_WRITE = 0x02;\n// static COPY_SRC = 0x0004;\n// static COPY_DST = 0x0008;\n// static INDEX = 0x0010;\n// static VERTEX = 0x0020;\n// static UNIFORM = 0x0040;\n// static STORAGE = 0x0080;\n// static INDIRECT = 0x0100;\n// static QUERY_RESOLVE = 0x0200;\n\nfunction getWebGLTarget(usage: number): GL {\n if (usage & Buffer.INDEX) {\n return GL.ELEMENT_ARRAY_BUFFER;\n }\n if (usage & Buffer.VERTEX) {\n return GL.ARRAY_BUFFER;\n }\n if (usage & Buffer.UNIFORM) {\n return GL.UNIFORM_BUFFER;\n }\n\n // gl.COPY_READ_BUFFER: Buffer for copying from one buffer object to another.\n // gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another.\n // gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations.\n // gl.PIXEL_PACK_BUFFER: Buffer used for pixel transfer operations.\n // gl.PIXEL_UNPACK_BUFFER: Buffer used for pixel transfer operations.\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 return GL.ARRAY_BUFFER;\n}\n\nfunction getWebGLUsage(usage: number): GL {\n if (usage & Buffer.INDEX) {\n return GL.STATIC_DRAW;\n }\n if (usage & Buffer.VERTEX) {\n return GL.STATIC_DRAW;\n }\n if (usage & Buffer.UNIFORM) {\n return GL.DYNAMIC_DRAW;\n }\n return GL.DYNAMIC_DRAW;\n}\n"],"file":"webgl-buffer.js"}
|
|
1
|
+
{"version":3,"file":"webgl-buffer.js","names":["Buffer","assert","GL","DEBUG_DATA_LENGTH","WEBGLBuffer","constructor","device","props","arguments","length","undefined","_defineProperty","gl","gl2","handle","createBuffer","setSpectorMetadata","data","target","getWebGLTarget","usage","webglUsage","getWebGLUsage","debugData","_initWithData","byteOffset","byteLength","_initWithByteLength","ArrayBuffer","isView","_getWriteTarget","bindBuffer","bufferData","bufferSubData","slice","bytesUsed","trackAllocatedMemory","Float32Array","destroy","destroyed","removeStats","trackDeallocatedMemory","deleteBuffer","write","srcOffset","isWebGL2","COPY_WRITE_BUFFER","assertWebGL2","offset","readAsync","Uint8Array","dstOffset","COPY_READ_BUFFER","getBufferSubData","_invalidateDebugData","_getReadTarget","INDEX","ELEMENT_ARRAY_BUFFER","VERTEX","ARRAY_BUFFER","UNIFORM","UNIFORM_BUFFER","STATIC_DRAW","DYNAMIC_DRAW"],"sources":["../../../src/adapter/resources/webgl-buffer.ts"],"sourcesContent":["import type {BufferProps} from '@luma.gl/api';\nimport {Buffer, assert} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport WebGLDevice from '../webgl-device';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n/** WebGL Buffer interface */\nexport default class WEBGLBuffer extends Buffer {\n readonly device: WebGLDevice;\n readonly gl: WebGLRenderingContext;\n readonly gl2: WebGL2RenderingContext | null;\n readonly handle: WebGLBuffer;\n readonly target: number;\n\n byteLength: number;\n bytesUsed: number;\n debugData: ArrayBuffer | null = null;\n\n webglUsage: number;\n\n // accessor: {};\n\n \n constructor(device: WebGLDevice, props: BufferProps = {}) {\n super(device, props);\n\n this.device = device;\n this.gl = this.device.gl;\n this.gl2 = this.device.gl2;\n\n const handle = typeof props === 'object' ? (props ).handle : undefined;\n this.handle = handle || this.gl.createBuffer();\n device.setSpectorMetadata(this.handle, {...this.props, data: typeof this.props.data});\n\n // In WebGL1, need to make sure we use GL.ELEMENT_ARRAY_BUFFER when initializing element buffers\n // otherwise buffer type will lock to generic (non-element) buffer\n // In WebGL2, we can use GL.COPY_READ_BUFFER which avoids locking the type here\n // @ts-expect-error Hack - Checking for subclass prop\n this.target = this.props.target || getWebGLTarget(this.props.usage);\n // @ts-expect-error Hack - Checking for subclass prop\n this.webglUsage = this.props.webglUsage || getWebGLUsage(this.props.usage);\n this.debugData = null;\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._initWithData(props.data, props.byteOffset, props.byteLength);\n } else {\n this._initWithByteLength(props.byteLength || 0);\n }\n\n // Deprecated: Merge main props and accessor\n // this.accessor = {...props.accessor};\n\n // Object.seal(this);\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _initWithData(data, byteOffset: number = 0, byteLength: number = data.byteLength + byteOffset): this {\n assert(ArrayBuffer.isView(data));\n\n const target = this._getWriteTarget();\n\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, byteOffset, 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 return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _initWithByteLength(byteLength: number): this {\n assert(byteLength >= 0);\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._getWriteTarget();\n\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, this.webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n return this;\n }\n\n override destroy(): void {\n if (!this.destroyed && this.handle) {\n this.removeStats();\n this.trackDeallocatedMemory();\n this.gl.deleteBuffer(this.handle);\n this.destroyed = true;\n // this.handle = null;\n }\n }\n\n override write(data: ArrayBufferView, byteOffset: number = 0): void {\n const srcOffset = 0;\n const byteLength = data.byteLength;\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 const target = this.device.isWebGL2 ? 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 this.device.assertWebGL2();\n\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, byteOffset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n // this.debugData = data.slice(byteOffset, 40);\n }\n\n /** Read data from the buffer */\n override async readAsync(\n byteOffset: number = 0,\n byteLength?: number\n ): Promise<ArrayBuffer> {\n this.device.assertWebGL2();\n\n const data = new Uint8Array(byteLength);\n const dstOffset = 0;\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, byteOffset, data, dstOffset, byteLength);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n // this.debugData = null;\n\n return data;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n _invalidateDebugData() {\n this.debugData = null;\n }\n\n _getWriteTarget() {\n return this.target;\n // return this.device.isWebGL2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getReadTarget() {\n return this.target;\n // return this.device.isWebGL2 ? GL.COPY_READ_BUFFER : this.target;\n }\n}\n\n// static MAP_READ = 0x01;\n// static MAP_WRITE = 0x02;\n// static COPY_SRC = 0x0004;\n// static COPY_DST = 0x0008;\n// static INDEX = 0x0010;\n// static VERTEX = 0x0020;\n// static UNIFORM = 0x0040;\n// static STORAGE = 0x0080;\n// static INDIRECT = 0x0100;\n// static QUERY_RESOLVE = 0x0200;\n\nfunction getWebGLTarget(usage: number): GL {\n if (usage & Buffer.INDEX) {\n return GL.ELEMENT_ARRAY_BUFFER;\n }\n if (usage & Buffer.VERTEX) {\n return GL.ARRAY_BUFFER;\n }\n if (usage & Buffer.UNIFORM) {\n return GL.UNIFORM_BUFFER;\n }\n\n // gl.COPY_READ_BUFFER: Buffer for copying from one buffer object to another.\n // gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another.\n // gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations.\n // gl.PIXEL_PACK_BUFFER: Buffer used for pixel transfer operations.\n // gl.PIXEL_UNPACK_BUFFER: Buffer used for pixel transfer operations.\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 return GL.ARRAY_BUFFER;\n}\n\nfunction getWebGLUsage(usage: number): GL {\n if (usage & Buffer.INDEX) {\n return GL.STATIC_DRAW;\n }\n if (usage & Buffer.VERTEX) {\n return GL.STATIC_DRAW;\n }\n if (usage & Buffer.UNIFORM) {\n return GL.DYNAMIC_DRAW;\n }\n return GL.DYNAMIC_DRAW;\n}\n"],"mappings":";AACA,SAAQA,MAAM,EAAEC,MAAM,QAAO,cAAc;AAC3C,OAAOC,EAAE,MAAM,oBAAoB;AAGnC,MAAMC,iBAAiB,GAAG,EAAE;AAG5B,eAAe,MAAMC,WAAW,SAASJ,MAAM,CAAC;EAgB9CK,WAAWA,CAACC,MAAmB,EAA2B;IAAA,IAAzBC,KAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IACtD,KAAK,CAACF,MAAM,EAAEC,KAAK,CAAC;IAACI,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,oBARS,IAAI;IAAAA,eAAA;IAUlC,IAAI,CAACL,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACM,EAAE,GAAG,IAAI,CAACN,MAAM,CAACM,EAAE;IACxB,IAAI,CAACC,GAAG,GAAG,IAAI,CAACP,MAAM,CAACO,GAAG;IAE1B,MAAMC,MAAM,GAAG,OAAOP,KAAK,KAAK,QAAQ,GAAIA,KAAK,CAAGO,MAAM,GAAGJ,SAAS;IACtE,IAAI,CAACI,MAAM,GAAGA,MAAM,IAAI,IAAI,CAACF,EAAE,CAACG,YAAY,EAAE;IAC9CT,MAAM,CAACU,kBAAkB,CAAC,IAAI,CAACF,MAAM,EAAE;MAAC,GAAG,IAAI,CAACP,KAAK;MAAEU,IAAI,EAAE,OAAO,IAAI,CAACV,KAAK,CAACU;IAAI,CAAC,CAAC;IAMrF,IAAI,CAACC,MAAM,GAAG,IAAI,CAACX,KAAK,C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AU,EAAER,IAAI,EAAEkC,SAAS,EAAEzB,UAAU,CAAC;IACvF,IAAI,CAACd,EAAE,CAACmB,UAAU,CAAC7B,EAAE,CAACkD,gBAAgB,EAAE,IAAI,CAAC;IAK7C,OAAOnC,IAAI;EACb;EAIAqC,oBAAoBA,CAAA,EAAG;IACrB,IAAI,CAAC/B,SAAS,GAAG,IAAI;EACvB;EAEAO,eAAeA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACZ,MAAM;EAEpB;EAEAqC,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAACrC,MAAM;EAEpB;AACF;AAaA,SAASC,cAAcA,CAACC,KAAa,EAAM;EACzC,IAAIA,KAAK,GAAGpB,MAAM,CAACwD,KAAK,EAAE;IACxB,OAAOtD,EAAE,CAACuD,oBAAoB;EAChC;EACA,IAAIrC,KAAK,GAAGpB,MAAM,CAAC0D,MAAM,EAAE;IACzB,OAAOxD,EAAE,CAACyD,YAAY;EACxB;EACA,IAAIvC,KAAK,GAAGpB,MAAM,CAAC4D,OAAO,EAAE;IAC1B,OAAO1D,EAAE,CAAC2D,cAAc;EAC1B;EAUA,OAAO3D,EAAE,CAACyD,YAAY;AACxB;AAEA,SAASrC,aAAaA,CAACF,KAAa,EAAM;EACxC,IAAIA,KAAK,GAAGpB,MAAM,CAACwD,KAAK,EAAE;IACxB,OAAOtD,EAAE,CAAC4D,WAAW;EACvB;EACA,IAAI1C,KAAK,GAAGpB,MAAM,CAAC0D,MAAM,EAAE;IACzB,OAAOxD,EAAE,CAAC4D,WAAW;EACvB;EACA,IAAI1C,KAAK,GAAGpB,MAAM,CAAC4D,OAAO,EAAE;IAC1B,OAAO1D,EAAE,CAAC6D,YAAY;EACxB;EACA,OAAO7D,EAAE,CAAC6D,YAAY;AACxB"}
|
|
@@ -1,52 +1,40 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import GL from '@luma.gl/constants';
|
|
3
|
-
|
|
4
3
|
function cast(value) {
|
|
5
4
|
return value;
|
|
6
5
|
}
|
|
7
|
-
|
|
8
6
|
export default class CommandBuffer {
|
|
9
7
|
constructor() {
|
|
10
8
|
_defineProperty(this, "commands", []);
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
}
|
|
14
|
-
export function submitCommands(device
|
|
11
|
+
export function submitCommands(device) {
|
|
12
|
+
let commands = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
15
13
|
for (const command of commands) {
|
|
16
14
|
switch (command.name) {
|
|
17
15
|
case 'copy-buffer-to-buffer':
|
|
18
16
|
_copyBufferToBuffer(device, command.options);
|
|
19
|
-
|
|
20
17
|
break;
|
|
21
|
-
|
|
22
18
|
case 'copy-buffer-to-texture':
|
|
23
19
|
_copyBufferToTexture(device, command.options);
|
|
24
|
-
|
|
25
20
|
break;
|
|
26
|
-
|
|
27
21
|
case 'copy-texture-to-buffer':
|
|
28
22
|
_copyTextureToBuffer(device, command.options);
|
|
29
|
-
|
|
30
23
|
break;
|
|
31
|
-
|
|
32
24
|
case 'copy-texture-to-texture':
|
|
33
25
|
_copyTextureToTexture(device, command.options);
|
|
34
|
-
|
|
35
26
|
break;
|
|
36
27
|
}
|
|
37
28
|
}
|
|
38
29
|
}
|
|
39
|
-
|
|
40
30
|
function _copyBufferToBuffer(device, options) {
|
|
41
31
|
const source = cast(options.source);
|
|
42
32
|
const destination = cast(options.destination);
|
|
43
33
|
const {
|
|
44
34
|
gl2
|
|
45
35
|
} = device;
|
|
46
|
-
|
|
47
36
|
if (gl2) {
|
|
48
37
|
var _options$sourceOffset, _options$destinationO;
|
|
49
|
-
|
|
50
38
|
gl2.bindBuffer(GL.COPY_READ_BUFFER, source.handle);
|
|
51
39
|
gl2.bindBuffer(GL.COPY_WRITE_BUFFER, destination.handle);
|
|
52
40
|
gl2.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, (_options$sourceOffset = options.sourceOffset) !== null && _options$sourceOffset !== void 0 ? _options$sourceOffset : 0, (_options$destinationO = options.destinationOffset) !== null && _options$destinationO !== void 0 ? _options$destinationO : 0, options.size);
|
|
@@ -56,10 +44,7 @@ function _copyBufferToBuffer(device, options) {
|
|
|
56
44
|
throw new Error('copyBufferToBuffer not implemented in WebGL1');
|
|
57
45
|
}
|
|
58
46
|
}
|
|
59
|
-
|
|
60
47
|
function _copyBufferToTexture(device, options) {}
|
|
61
|
-
|
|
62
48
|
function _copyTextureToBuffer(device, options) {}
|
|
63
|
-
|
|
64
49
|
function _copyTextureToTexture(device, options) {}
|
|
65
50
|
//# sourceMappingURL=webgl-command-buffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"webgl-command-buffer.js","names":["GL","cast","value","CommandBuffer","constructor","_defineProperty","submitCommands","device","commands","arguments","length","undefined","command","name","_copyBufferToBuffer","options","_copyBufferToTexture","_copyTextureToBuffer","_copyTextureToTexture","source","destination","gl2","_options$sourceOffset","_options$destinationO","bindBuffer","COPY_READ_BUFFER","handle","COPY_WRITE_BUFFER","copyBufferSubData","sourceOffset","destinationOffset","size","Error"],"sources":["../../../src/adapter/resources/webgl-command-buffer.ts"],"sourcesContent":["import type {\n CopyBufferToBufferOptions,\n CopyBufferToTextureOptions,\n CopyTextureToBufferOptions,\n CopyTextureToTextureOptions\n} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport WebGLDevice from '../webgl-device';\nimport WEBGLBuffer from './webgl-buffer';\n\nfunction cast<T>(value: unknown): T {\n return value as T;\n}\n\ntype CopyBufferToBufferCommand = {\n name: 'copy-buffer-to-buffer';\n options: CopyBufferToBufferOptions;\n};\n\ntype CopyBufferToTextureCommand = {\n name: 'copy-buffer-to-texture';\n options: CopyBufferToTextureOptions;\n};\n\ntype CopyTextureToBufferCommand = {\n name: 'copy-texture-to-buffer';\n options: CopyTextureToBufferOptions;\n};\n\ntype CopyTextureToTextureCommand = {\n name: 'copy-texture-to-texture';\n options: CopyTextureToTextureOptions;\n};\n\ntype Command =\n | CopyBufferToBufferCommand\n | CopyBufferToTextureCommand\n | CopyTextureToBufferCommand\n | CopyTextureToTextureCommand;\n\nexport default class CommandBuffer {\n commands: Command[] = [];\n}\n\nexport function submitCommands(device: WebGLDevice, commands: Command[] = []) {\n for (const command of commands) {\n switch (command.name) {\n case 'copy-buffer-to-buffer':\n _copyBufferToBuffer(device, command.options);\n break;\n case 'copy-buffer-to-texture':\n _copyBufferToTexture(device, command.options);\n break;\n case 'copy-texture-to-buffer':\n _copyTextureToBuffer(device, command.options);\n break;\n case 'copy-texture-to-texture':\n _copyTextureToTexture(device, command.options);\n break;\n }\n }\n}\n\nfunction _copyBufferToBuffer(device: WebGLDevice, options: CopyBufferToBufferOptions): void {\n const source = cast<WEBGLBuffer>(options.source);\n const destination = cast<WEBGLBuffer>(options.destination);\n\n const {gl2} = device;\n if (gl2) {\n // In WebGL2 we can perform the copy on the GPU\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n gl2.bindBuffer(GL.COPY_READ_BUFFER, source.handle);\n gl2.bindBuffer(GL.COPY_WRITE_BUFFER, destination.handle);\n gl2.copyBufferSubData(\n GL.COPY_READ_BUFFER,\n GL.COPY_WRITE_BUFFER,\n options.sourceOffset ?? 0,\n options.destinationOffset ?? 0,\n options.size\n );\n gl2.bindBuffer(GL.COPY_READ_BUFFER, null);\n gl2.bindBuffer(GL.COPY_WRITE_BUFFER, null);\n } else {\n // TODO - in WebGL1 we would have to read back to CPU\n // read / write buffer from / to CPU\n throw new Error('copyBufferToBuffer not implemented in WebGL1');\n }\n}\n\nfunction _copyBufferToTexture(device: WebGLDevice, options: CopyBufferToTextureOptions): void {}\n\nfunction _copyTextureToBuffer(device: WebGLDevice, options: CopyTextureToBufferOptions): void {}\n\nfunction _copyTextureToTexture(device: WebGLDevice, options: CopyTextureToTextureOptions): void {}\n"],"mappings":";AAMA,OAAOA,EAAE,MAAM,oBAAo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B,CACnB5B,EAAE,CAACyB,gBAAgB,EACnBzB,EAAE,CAAC2B,iBAAiB,GAAAL,qBAAA,GACpBP,OAAO,CAACc,YAAY,cAAAP,qBAAA,cAAAA,qBAAA,GAAI,CAAC,GAAAC,qBAAA,GACzBR,OAAO,CAACe,iBAAiB,cAAAP,qBAAA,cAAAA,qBAAA,GAAI,CAAC,EAC9BR,OAAO,CAACgB,IAAI,CACb;IACDV,GAAG,CAACG,UAAU,CAACxB,EAAE,CAACyB,gBAAgB,EAAE,IAAI,CAAC;IACzCJ,GAAG,CAACG,UAAU,CAACxB,EAAE,CAAC2B,iBAAiB,EAAE,IAAI,CAAC;EAC5C,CAAC,MAAM;IAGL,MAAM,IAAIK,KAAK,CAAC,8CAA8C,CAAC;EACjE;AACF;AAEA,SAAShB,oBAAoBA,CAACT,MAAmB,EAAEQ,OAAmC,EAAQ,CAAC;AAE/F,SAASE,oBAAoBA,CAACV,MAAmB,EAAEQ,OAAmC,EAAQ,CAAC;AAE/F,SAASG,qBAAqBA,CAACX,MAAmB,EAAEQ,OAAoC,EAAQ,CAAC"}
|
|
@@ -1,53 +1,40 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import { CommandEncoder } from '@luma.gl/api';
|
|
3
|
-
import CommandBuffer from
|
|
3
|
+
import CommandBuffer from "./webgl-command-buffer.js";
|
|
4
4
|
export default class WEBGLCommandEncoder extends CommandEncoder {
|
|
5
5
|
constructor(device, props) {
|
|
6
6
|
super(props);
|
|
7
|
-
|
|
8
7
|
_defineProperty(this, "device", void 0);
|
|
9
|
-
|
|
10
8
|
_defineProperty(this, "commandBuffer", new CommandBuffer());
|
|
11
|
-
|
|
12
9
|
this.device = device;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
11
|
destroy() {}
|
|
16
|
-
|
|
17
12
|
copyBufferToBuffer(options) {
|
|
18
13
|
this.commandBuffer.commands.push({
|
|
19
14
|
name: 'copy-buffer-to-buffer',
|
|
20
15
|
options
|
|
21
16
|
});
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
copyBufferToTexture(options) {
|
|
25
19
|
this.commandBuffer.commands.push({
|
|
26
20
|
name: 'copy-buffer-to-texture',
|
|
27
21
|
options
|
|
28
22
|
});
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
copyTextureToBuffer(options) {
|
|
32
25
|
this.commandBuffer.commands.push({
|
|
33
26
|
name: 'copy-texture-to-buffer',
|
|
34
27
|
options
|
|
35
28
|
});
|
|
36
29
|
}
|
|
37
|
-
|
|
38
30
|
copyTextureToTexture(options) {
|
|
39
31
|
this.commandBuffer.commands.push({
|
|
40
32
|
name: 'copy-texture-to-texture',
|
|
41
33
|
options
|
|
42
34
|
});
|
|
43
35
|
}
|
|
44
|
-
|
|
45
36
|
pushDebugGroup(groupLabel) {}
|
|
46
|
-
|
|
47
37
|
popDebugGroup() {}
|
|
48
|
-
|
|
49
38
|
insertDebugMarker(markerLabel) {}
|
|
50
|
-
|
|
51
39
|
}
|
|
52
|
-
;
|
|
53
40
|
//# sourceMappingURL=webgl-command-encoder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"webgl-command-encoder.js","names":["CommandEncoder","CommandBuffer","WEBGLCommandEncoder","constructor","device","props","_defineProperty","destroy","copyBufferToBuffer","options","commandBuffer","commands","push","name","copyBufferToTexture","copyTextureToBuffer","copyTextureToTexture","pushDebugGroup","groupLabel","popDebugGroup","insertDebugMarker","markerLabel"],"sources":["../../../src/adapter/resources/webgl-command-encoder.ts"],"sourcesContent":["import {CommandEncoder, CommandEncoderProps} from '@luma.gl/api';\nimport type {\n CopyBufferToBufferOptions,\n CopyBufferToTextureOptions,\n CopyTextureToBufferOptions,\n CopyTextureToTextureOptions\n} from '@luma.gl/api';\n\nimport CommandBuffer from './webgl-command-buffer';\nimport WebGLDevice from '../webgl-device';\n\nexport default class WEBGLCommandEncoder extends CommandEncoder {\n readonly device: WebGLDevice;\n\n readonly commandBuffer = new CommandBuffer();\n\n constructor(device: WebGLDevice, props: CommandEncoderProps) {\n super(props);\n this.device = device;\n }\n\n override destroy(): void {}\n\n // beginRenderPass(GPURenderPassDescriptor descriptor): GPURenderPassEncoder;\n // beginComputePass(optional GPUComputePassDescriptor descriptor = {}): GPUComputePassEncoder;\n // finish(options?: {id?: string}): GPUCommandBuffer;\n\n copyBufferToBuffer(options: CopyBufferToBufferOptions): void {\n this.commandBuffer.commands.push({name: 'copy-buffer-to-buffer', options});\n }\n\n copyBufferToTexture(options: CopyBufferToTextureOptions) {\n this.commandBuffer.commands.push({name: 'copy-buffer-to-texture', options});\n }\n\n copyTextureToBuffer(options: CopyTextureToBufferOptions): void {\n this.commandBuffer.commands.push({name: 'copy-texture-to-buffer', options});\n }\n\n copyTextureToTexture(options: CopyTextureToTextureOptions): void {\n this.commandBuffer.commands.push({name: 'copy-texture-to-texture', options});\n }\n\n override pushDebugGroup(groupLabel: string): void {}\n override popDebugGroup() {}\n\n override insertDebugMarker(markerLabel: string): void {}\n\n // writeTimestamp(querySet: Query, queryIndex: number): void {}\n\n // resolveQuerySet(options: {\n // querySet: GPUQuerySet,\n // firstQuery: number,\n // queryCount: number,\n // destination: Buffer,\n // destinationOffset?: number;\n // }): void;\n}\n"],"mappings":";AAAA,SAAQA,cAAc,QAA4B,cAAc;AAAC,OAQ1DC,aAAa;AAGpB,eAAe,MAAMC,mBAAmB,SAASF,cAAc,CAAC;EAK9DG,WAAWA,CAACC,MAAmB,EAAEC,KAA0B,EAAE;IAC3D,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA;IAAAA,eAAA,wBAHU,IAAIL,aAAa,EAAE;IAI1C,IAAI,CAACG,MAAM,GAAGA,MAAM;EACtB;EAESG,OAAOA,CAAA,EAAS,CAAC;EAM1BC,kBAAkBA,CAACC,OAAkC,EAAQ;IAC3D,IAAI,CAACC,aAAa,CAACC,QAAQ,CAACC,IAAI,CAAC;MAACC,IAAI,EAAE,uBAAuB;MAAEJ;IAAO,CAAC,CAAC;EAC5E;EAEAK,mBAAmBA,CAACL,OAAmC,EAAE;IACvD,IAAI,CAACC,aAAa,CAACC,QAAQ,CAACC,IAAI,CAAC;MAACC,IAAI,EAAE,wBAAwB;MAAEJ;IAAO,CAAC,CAAC;EAC7E;EAEAM,mBAAmBA,CAACN,OAAmC,EAAQ;IAC7D,IAAI,CAACC,aAAa,CAACC,QAAQ,CAACC,IAAI,CAAC;MAACC,IAAI,EAAE,wBAAwB;MAAEJ;IAAO,CAAC,CAAC;EAC7E;EAEAO,oBAAoBA,CAACP,OAAoC,EAAQ;IAC/D,IAAI,CAACC,aAAa,CAACC,QAAQ,CAACC,IAAI,CAAC;MAACC,IAAI,EAAE,yBAAyB;MAAEJ;IAAO,CAAC,CAAC;EAC9E;EAESQ,cAAcA,CAACC,UAAkB,EAAQ,CAAC;EAC1CC,aAAaA,CAAA,EAAG,CAAC;EAEjBC,iBAAiBA,CAACC,WAAmB,EAAQ,CAAC;AAWzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"webgl-external-texture.js","names":[],"sources":["../../../src/adapter/resources/webgl-external-texture.ts"],"sourcesContent":["/*\nexport default class WEBGLExternalTexture extends WEBGLTexture {\n readonly device: WebGLDevice;\n readonly gl: WebGLRenderingContext;\n readonly gl2: WebGL2RenderingContext | null;\n readonly handle: WebGLTexture;\n\n data;\n\n width: number = undefined;\n height: number = undefined;\n depth: number = undefined;\n\n format = undefined;\n type = undefined;\n dataFormat = undefined;\n border = undefined;\n mipmaps: boolean = undefined;\n\n textureUnit: number = undefined;\n\n sampler: WEBGLSampler;\n\n // Program.draw() checks the loaded flag of all textures to avoid\n // Textures that are still loading from promises\n // Set to true as soon as texture has been initialized with valid data\n loaded = false;\n _video;\n\n readonly target: GL;\n // target cannot be modified by bind:\n // textures are special because when you first bind them to a target,\n // they get special information. When you first bind a texture as a\n // GL_TEXTURE_2D, you are actually setting special state in the texture.\n // You are saying that this texture is a 2D texture.\n // And it will always be a 2D texture; this state cannot be changed ever.\n // If you have a texture that was first bound as a GL_TEXTURE_2D,\n // you must always bind it as a GL_TEXTURE_2D;\n // attempting to bind it as GL_TEXTURE_3D will give rise to an error\n // (while run-time).\n\n static isSupported(device: WebGLDevice, options?: TextureSupportOptions): boolean {\n const {format, linearFiltering} = options;\n let supported = true;\n if (format) {\n supported = supported && isFormatSupported(device.gl, format);\n supported = supported && (!linearFiltering || isTextureFormatFilterable(device.gl, format));\n }\n return supported;\n }\n\n // eslint-disable-next-line max-statements\n constructor(device: Device | WebGLRenderingContext, props: TextureProps) {\n super(WebGLDevice.attach(device), {id: uid('texture'), ...props});\n\n this.target = getWebGLTextureTarget(props);\n\n this.device = WebGLDevice.attach(device);\n this.gl = this.device.gl;\n this.gl2 = this.device.gl2;\n this.handle = this.props.handle || this.gl.createTexture();\n\n let data = props.data;\n\n const isVideo = typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement;\n // @ts-expect-error\n if (isVideo && data.readyState < HTMLVideoElement.HAVE_METADATA) {\n this._video = null; // Declare member before the object is sealed\n data.addEventListener('loadeddata', () => this.initialize(props));\n return this;\n }\n\n update(): this {\n if (this._video) {\n const {video, parameters, lastTime} = this._video;\n // @ts-expect-error\n if (lastTime === video.currentTime || video.readyState < HTMLVideoElement.HAVE_CURRENT_DATA) {\n return;\n }\n this.setSubImageData({\n data: video,\n parameters\n });\n if (this.mipmaps) {\n this.generateMipmap();\n }\n this._video.lastTime = video.currentTime;\n }\n }\n\n\n*/"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-framebuffer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,cAAc,CAAC;AACvE,OAAO,EAAC,WAAW,EAAE,OAAO,EAAc,MAAM,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