@luma.gl/webgl 9.0.0-alpha.16 → 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 +117 -200
- package/dist/adapter/converters/device-parameters.js.map +1 -0
- package/dist/adapter/converters/renderbuffer-formats.d.ts +1 -1
- package/dist/adapter/converters/renderbuffer-formats.d.ts.map +1 -1
- package/dist/adapter/converters/renderbuffer-formats.js +172 -62
- package/dist/adapter/converters/renderbuffer-formats.js.map +1 -0
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +151 -149
- package/dist/adapter/converters/sampler-parameters.js.map +1 -0
- package/dist/adapter/converters/texture-formats.d.ts +2 -2
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +847 -438
- package/dist/adapter/converters/texture-formats.js.map +1 -0
- package/dist/adapter/converters/vertex-formats.js +24 -15
- package/dist/adapter/converters/vertex-formats.js.map +1 -0
- package/dist/adapter/device-helpers/device-features.js +84 -120
- package/dist/adapter/device-helpers/device-features.js.map +1 -0
- package/dist/adapter/device-helpers/device-limits.d.ts +1 -1
- package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +83 -88
- package/dist/adapter/device-helpers/device-limits.js.map +1 -0
- package/dist/adapter/device-helpers/get-device-info.js +37 -42
- package/dist/adapter/device-helpers/get-device-info.js.map +1 -0
- package/dist/adapter/device-helpers/is-old-ie.js +8 -10
- package/dist/adapter/device-helpers/is-old-ie.js.map +1 -0
- package/dist/adapter/helpers/attribute-utils.js +57 -50
- package/dist/adapter/helpers/attribute-utils.js.map +1 -0
- package/dist/adapter/helpers/get-shader-info.d.ts +1 -1
- package/dist/adapter/helpers/get-shader-info.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-info.js +19 -21
- package/dist/adapter/helpers/get-shader-info.js.map +1 -0
- package/dist/adapter/helpers/get-shader-layout.js +251 -310
- package/dist/adapter/helpers/get-shader-layout.js.map +1 -0
- package/dist/adapter/helpers/parse-shader-compiler-log.js +26 -32
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +80 -67
- package/dist/adapter/helpers/set-uniform.js.map +1 -0
- package/dist/adapter/helpers/uniforms.js +75 -80
- package/dist/adapter/helpers/uniforms.js.map +1 -0
- package/dist/adapter/objects/constants-to-keys.js +26 -33
- package/dist/adapter/objects/constants-to-keys.js.map +1 -0
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +70 -67
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -0
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +158 -213
- package/dist/adapter/objects/webgl-resource.js.map +1 -0
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.js +66 -74
- package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -0
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +118 -150
- package/dist/adapter/resources/webgl-buffer.js.map +1 -0
- package/dist/adapter/resources/webgl-command-buffer.d.ts +5 -5
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +41 -40
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -0
- package/dist/adapter/resources/webgl-command-encoder.js +37 -26
- package/dist/adapter/resources/webgl-command-encoder.js.map +1 -0
- package/dist/adapter/resources/webgl-external-texture.js +1 -91
- package/dist/adapter/resources/webgl-external-texture.js.map +1 -0
- package/dist/adapter/resources/webgl-framebuffer.d.ts +2 -2
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +198 -231
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -0
- package/dist/adapter/resources/webgl-render-pass.js +11 -8
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -0
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +289 -316
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -0
- package/dist/adapter/resources/webgl-sampler.js +35 -42
- package/dist/adapter/resources/webgl-sampler.js.map +1 -0
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +53 -57
- package/dist/adapter/resources/webgl-shader.js.map +1 -0
- package/dist/adapter/resources/webgl-texture.d.ts +4 -4
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +697 -661
- package/dist/adapter/resources/webgl-texture.js.map +1 -0
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +35 -55
- package/dist/adapter/webgl-canvas-context.js.map +1 -0
- 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 +270 -287
- package/dist/adapter/webgl-device.js.map +1 -0
- package/dist/classic/accessor.js +103 -120
- package/dist/classic/accessor.js.map +1 -0
- package/dist/classic/buffer.d.ts +1 -1
- package/dist/classic/buffer.d.ts.map +1 -1
- package/dist/classic/buffer.js +300 -325
- package/dist/classic/buffer.js.map +1 -0
- 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 +81 -91
- package/dist/classic/typed-array-utils.js.map +1 -0
- package/dist/context/context/create-browser-context.d.ts +3 -1
- package/dist/context/context/create-browser-context.d.ts.map +1 -1
- package/dist/context/context/create-browser-context.js +49 -66
- package/dist/context/context/create-browser-context.js.map +1 -0
- package/dist/context/context/create-headless-context.d.ts +1 -1
- package/dist/context/context/create-headless-context.d.ts.map +1 -1
- package/dist/context/context/create-headless-context.js +30 -24
- package/dist/context/context/create-headless-context.js.map +1 -0
- package/dist/context/context/webgl-checks.js +17 -25
- package/dist/context/context/webgl-checks.js.map +1 -0
- package/dist/context/debug/spector.d.ts +3 -1
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +50 -53
- package/dist/context/debug/spector.js.map +1 -0
- 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 +76 -107
- package/dist/context/debug/webgl-developer-tools.js.map +1 -0
- package/dist/context/parameters/unified-parameter-api.js +46 -93
- package/dist/context/parameters/unified-parameter-api.js.map +1 -0
- package/dist/context/parameters/webgl-parameter-tables.d.ts +1 -1
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +404 -462
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -0
- package/dist/context/polyfill/context-data.js +10 -16
- package/dist/context/polyfill/context-data.js.map +1 -0
- package/dist/context/polyfill/get-parameter-polyfill.js +71 -91
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -0
- package/dist/context/polyfill/polyfill-context.js +73 -75
- package/dist/context/polyfill/polyfill-context.js.map +1 -0
- package/dist/context/polyfill/polyfill-table.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-table.js +116 -133
- package/dist/context/polyfill/polyfill-table.js.map +1 -0
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +227 -255
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -0
- package/dist/context/state-tracker/deep-array-equal.js +14 -16
- package/dist/context/state-tracker/deep-array-equal.js.map +1 -0
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +127 -183
- package/dist/context/state-tracker/track-context-state.js.map +1 -0
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +29 -43
- package/dist/context/state-tracker/with-parameters.js.map +1 -0
- 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 +25 -41
- package/dist/index.js.map +1 -0
- package/dist/types/webgl.d.ts +16 -16
- package/dist/types/webgl.d.ts.map +1 -1
- package/dist/types/webgl.js +1 -0
- package/dist/types/webgl.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- 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 +1 -1
- package/src/adapter/helpers/get-shader-layout.ts +4 -4
- package/src/adapter/helpers/parse-shader-compiler-log.ts +1 -1
- 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-pipeline.ts +19 -20
- package/src/adapter/resources/webgl-shader.ts +1 -1
- package/src/adapter/resources/webgl-texture.ts +8 -9
- package/src/adapter/webgl-canvas-context.ts +2 -2
- package/src/adapter/webgl-device.ts +12 -2
- 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 -0
- 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 +2 -0
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -4
- package/dist/dist.min.js +0 -1
- package/dist/es5/adapter/converters/device-parameters.js +0 -139
- package/dist/es5/adapter/converters/device-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/renderbuffer-formats.js +0 -151
- package/dist/es5/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/es5/adapter/converters/sampler-parameters.js +0 -182
- package/dist/es5/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/texture-formats.js +0 -950
- package/dist/es5/adapter/converters/texture-formats.js.map +0 -1
- package/dist/es5/adapter/converters/vertex-formats.js +0 -36
- package/dist/es5/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/es5/adapter/device-helpers/device-features.js +0 -121
- package/dist/es5/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/es5/adapter/device-helpers/device-limits.js +0 -54
- package/dist/es5/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/es5/adapter/device-helpers/get-device-info.js +0 -49
- package/dist/es5/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/es5/adapter/device-helpers/is-old-ie.js +0 -15
- package/dist/es5/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/es5/adapter/helpers/attribute-utils.js +0 -69
- package/dist/es5/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/es5/adapter/helpers/get-shader-info.js +0 -31
- package/dist/es5/adapter/helpers/get-shader-info.js.map +0 -1
- package/dist/es5/adapter/helpers/get-shader-layout.js +0 -311
- package/dist/es5/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js +0 -54
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/es5/adapter/helpers/set-uniform.js +0 -92
- package/dist/es5/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/es5/adapter/helpers/uniforms.js +0 -88
- package/dist/es5/adapter/helpers/uniforms.js.map +0 -1
- package/dist/es5/adapter/objects/constants-to-keys.js +0 -43
- package/dist/es5/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-renderbuffer.js +0 -122
- package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-resource.js +0 -233
- package/dist/es5/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js +0 -109
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-buffer.js +0 -196
- package/dist/es5/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-command-buffer.js +0 -70
- package/dist/es5/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-command-encoder.js +0 -80
- 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 -275
- package/dist/es5/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pass.js +0 -45
- package/dist/es5/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pipeline.js +0 -385
- package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-sampler.js +0 -75
- package/dist/es5/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-shader.js +0 -111
- package/dist/es5/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-texture.js +0 -826
- package/dist/es5/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/es5/adapter/webgl-canvas-context.js +0 -72
- package/dist/es5/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/es5/adapter/webgl-device.js +0 -387
- package/dist/es5/adapter/webgl-device.js.map +0 -1
- package/dist/es5/bundle.js +0 -6
- package/dist/es5/bundle.js.map +0 -1
- package/dist/es5/classic/accessor.js +0 -151
- package/dist/es5/classic/accessor.js.map +0 -1
- package/dist/es5/classic/buffer.js +0 -398
- package/dist/es5/classic/buffer.js.map +0 -1
- package/dist/es5/classic/typed-array-utils.js +0 -99
- package/dist/es5/classic/typed-array-utils.js.map +0 -1
- package/dist/es5/context/context/create-browser-context.js +0 -66
- package/dist/es5/context/context/create-browser-context.js.map +0 -1
- package/dist/es5/context/context/create-headless-context.js +0 -47
- package/dist/es5/context/context/create-headless-context.js.map +0 -1
- package/dist/es5/context/context/webgl-checks.js +0 -44
- package/dist/es5/context/context/webgl-checks.js.map +0 -1
- package/dist/es5/context/debug/spector.js +0 -99
- package/dist/es5/context/debug/spector.js.map +0 -1
- package/dist/es5/context/debug/webgl-developer-tools.js +0 -146
- package/dist/es5/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/es5/context/parameters/unified-parameter-api.js +0 -76
- package/dist/es5/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/es5/context/parameters/webgl-parameter-tables.js +0 -346
- package/dist/es5/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/es5/context/polyfill/context-data.js +0 -18
- package/dist/es5/context/polyfill/context-data.js.map +0 -1
- package/dist/es5/context/polyfill/get-parameter-polyfill.js +0 -69
- package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-context.js +0 -109
- package/dist/es5/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-table.js +0 -143
- package/dist/es5/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js +0 -271
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/es5/context/state-tracker/deep-array-equal.js +0 -23
- package/dist/es5/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/es5/context/state-tracker/track-context-state.js +0 -167
- package/dist/es5/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/es5/context/state-tracker/with-parameters.js +0 -40
- package/dist/es5/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/es5/index.js +0 -249
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/init.js +0 -7
- package/dist/es5/init.js.map +0 -1
- package/dist/es5/types/webgl.js +0 -5
- 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 -137
- package/dist/esm/adapter/converters/device-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/renderbuffer-formats.js +0 -181
- package/dist/esm/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/esm/adapter/converters/sampler-parameters.js +0 -172
- package/dist/esm/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/texture-formats.js +0 -901
- package/dist/esm/adapter/converters/texture-formats.js.map +0 -1
- package/dist/esm/adapter/converters/vertex-formats.js +0 -29
- package/dist/esm/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/esm/adapter/device-helpers/device-features.js +0 -95
- package/dist/esm/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/esm/adapter/device-helpers/device-limits.js +0 -88
- package/dist/esm/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/esm/adapter/device-helpers/get-device-info.js +0 -42
- package/dist/esm/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/esm/adapter/device-helpers/is-old-ie.js +0 -9
- package/dist/esm/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/esm/adapter/helpers/attribute-utils.js +0 -64
- package/dist/esm/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/esm/adapter/helpers/get-shader-info.js +0 -25
- package/dist/esm/adapter/helpers/get-shader-info.js.map +0 -1
- package/dist/esm/adapter/helpers/get-shader-layout.js +0 -282
- package/dist/esm/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js +0 -30
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/esm/adapter/helpers/set-uniform.js +0 -85
- package/dist/esm/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/esm/adapter/helpers/uniforms.js +0 -89
- package/dist/esm/adapter/helpers/uniforms.js.map +0 -1
- package/dist/esm/adapter/objects/constants-to-keys.js +0 -35
- package/dist/esm/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-renderbuffer.js +0 -78
- package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-resource.js +0 -163
- package/dist/esm/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js +0 -74
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-buffer.js +0 -134
- package/dist/esm/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-command-buffer.js +0 -50
- package/dist/esm/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-command-encoder.js +0 -41
- 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 -207
- package/dist/esm/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-render-pass.js +0 -14
- package/dist/esm/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-render-pipeline.js +0 -311
- package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-sampler.js +0 -42
- package/dist/esm/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-shader.js +0 -62
- package/dist/esm/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-texture.js +0 -714
- package/dist/esm/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/esm/adapter/webgl-canvas-context.js +0 -41
- package/dist/esm/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/esm/adapter/webgl-device.js +0 -276
- package/dist/esm/adapter/webgl-device.js.map +0 -1
- package/dist/esm/bundle.js +0 -4
- package/dist/esm/bundle.js.map +0 -1
- package/dist/esm/classic/accessor.js +0 -120
- package/dist/esm/classic/accessor.js.map +0 -1
- package/dist/esm/classic/buffer.js +0 -327
- package/dist/esm/classic/buffer.js.map +0 -1
- package/dist/esm/classic/typed-array-utils.js +0 -92
- package/dist/esm/classic/typed-array-utils.js.map +0 -1
- package/dist/esm/context/context/create-browser-context.js +0 -53
- package/dist/esm/context/context/create-browser-context.js.map +0 -1
- package/dist/esm/context/context/create-headless-context.js +0 -39
- package/dist/esm/context/context/create-headless-context.js.map +0 -1
- package/dist/esm/context/context/webgl-checks.js +0 -31
- package/dist/esm/context/context/webgl-checks.js.map +0 -1
- package/dist/esm/context/debug/spector.js +0 -64
- package/dist/esm/context/debug/spector.js.map +0 -1
- package/dist/esm/context/debug/webgl-developer-tools.js +0 -97
- package/dist/esm/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/esm/context/parameters/unified-parameter-api.js +0 -55
- package/dist/esm/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/esm/context/parameters/webgl-parameter-tables.js +0 -427
- package/dist/esm/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/esm/context/polyfill/context-data.js +0 -12
- package/dist/esm/context/polyfill/context-data.js.map +0 -1
- package/dist/esm/context/polyfill/get-parameter-polyfill.js +0 -86
- package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-context.js +0 -84
- package/dist/esm/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-table.js +0 -138
- package/dist/esm/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js +0 -265
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/esm/context/state-tracker/deep-array-equal.js +0 -17
- package/dist/esm/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/esm/context/state-tracker/track-context-state.js +0 -148
- package/dist/esm/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/esm/context/state-tracker/with-parameters.js +0 -34
- 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 -3
- package/src/bundle.ts +0 -4
- package/src/init.ts +0 -4
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const DEFAULT_CONTEXT_PROPS = {
|
|
2
|
-
webgl2: true,
|
|
3
|
-
webgl1: true,
|
|
4
|
-
powerPreference: 'high-performance',
|
|
5
|
-
onContextLost: () => console.error('WebGL context lost'),
|
|
6
|
-
onContextRestored: () => console.info('WebGL context restored')
|
|
7
|
-
};
|
|
8
|
-
export function createBrowserContext(canvas, props) {
|
|
9
|
-
props = {
|
|
10
|
-
...DEFAULT_CONTEXT_PROPS,
|
|
11
|
-
...props
|
|
12
|
-
};
|
|
13
|
-
let errorMessage = null;
|
|
14
|
-
const onCreateError = error => errorMessage = error.statusMessage || errorMessage;
|
|
15
|
-
canvas.addEventListener('webglcontextcreationerror', onCreateError, false);
|
|
16
|
-
let gl = null;
|
|
17
|
-
if (props.type === 'webgl2') {
|
|
18
|
-
props = {
|
|
19
|
-
...props,
|
|
20
|
-
webgl1: false
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
if (props.type === 'webgl1') {
|
|
24
|
-
props = {
|
|
25
|
-
...props,
|
|
26
|
-
webgl2: false
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
if (props.webgl2) {
|
|
30
|
-
gl = gl || canvas.getContext('webgl2', props);
|
|
31
|
-
}
|
|
32
|
-
if (props.webgl1) {
|
|
33
|
-
gl = gl || canvas.getContext('webgl', props);
|
|
34
|
-
}
|
|
35
|
-
canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);
|
|
36
|
-
if (!gl) {
|
|
37
|
-
throw new Error("Failed to create ".concat(props.webgl2 && !props.webgl1 ? 'WebGL2' : 'WebGL', " context: ").concat(errorMessage || 'Unknown error'));
|
|
38
|
-
}
|
|
39
|
-
if (props.onContextLost) {
|
|
40
|
-
const {
|
|
41
|
-
onContextLost
|
|
42
|
-
} = props;
|
|
43
|
-
canvas.addEventListener('webglcontextlost', event => onContextLost(event), false);
|
|
44
|
-
}
|
|
45
|
-
if (props.onContextRestored) {
|
|
46
|
-
const {
|
|
47
|
-
onContextRestored
|
|
48
|
-
} = props;
|
|
49
|
-
canvas.addEventListener('webglcontextrestored', event => onContextRestored(event), false);
|
|
50
|
-
}
|
|
51
|
-
return gl;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=create-browser-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-browser-context.js","names":["DEFAULT_CONTEXT_PROPS","webgl2","webgl1","powerPreference","onContextLost","console","error","onContextRestored","info","createBrowserContext","canvas","props","errorMessage","onCreateError","statusMessage","addEventListener","gl","type","getContext","removeEventListener","Error","concat","event"],"sources":["../../../../src/context/context/create-browser-context.ts"],"sourcesContent":["// luma.gl, MIT license\n\n/**\n * ContextProps\n* @param webgl2 Set to false to not create a WebGL2 context (force webgl1)\n* @param webgl1 set to false to not create a WebGL1 context (fail if webgl2 not available)\n* @param onContextLost\n* @param onContextRestored\n*\n* BROWSER CONTEXT PARAMETERS\n* @param debug Instrument context (at the expense of performance).\n* @param alpha Default render target has an alpha buffer.\n* @param depth Default render target has a depth buffer of at least 16 bits.\n* @param stencil Default render target has a stencil buffer of at least 8 bits.\n* @param antialias Boolean that indicates whether or not to perform anti-aliasing.\n* @param premultipliedAlpha Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.\n* @param preserveDrawingBuffer Default render target buffers will not be automatically cleared and will preserve their values until cleared or overwritten\n* @param failIfMajorPerformanceCaveat Do not create if the system performance is low.\n*/\ntype ContextProps = {\n type?: 'webgl' | 'webgl1' | 'webgl2' | string;\n webgl1?: boolean;\n webgl2?: boolean;\n onContextLost?: (event: Event) => void;\n onContextRestored?: (event: Event) => void;\n alpha?: boolean; // indicates if the canvas contains an alpha buffer.\n desynchronized?: boolean; // hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop\n antialias?: boolean; // indicates whether or not to perform anti-aliasing.\n depth?: boolean; // indicates that the drawing buffer has a depth buffer of at least 16 bits.\n failIfMajorPerformanceCaveat?: boolean, // indicates if a context will be created if the system performance is low or if no hardware GPU is available.\n powerPreference?: 'default' | 'high-performance' | 'low-power',\n premultipliedAlpha?: boolean, // page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.\n preserveDrawingBuffer?: boolean // buffers will not be cleared and will preserve their values until cleared or overwritten by the author.\n};\n\nconst DEFAULT_CONTEXT_PROPS: ContextProps = {\n webgl2: true, // Attempt to create a WebGL2 context\n webgl1: true, // Attempt to create a WebGL1 context (false to fail if webgl2 not available)\n powerPreference: 'high-performance', // After all, most apps are using WebGL for performance reasons\n onContextLost: () => console.error('WebGL context lost'),\n onContextRestored: () => console.info('WebGL context restored'),\n};\n\n/**\n * Create a WebGL context for a canvas\n * Note calling this multiple time on the same canvas does return the same context\n* @param canvas A canvas element or offscreen canvas\n */\n export function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): WebGLRenderingContext {\n props = {...DEFAULT_CONTEXT_PROPS, ...props};\n\n // Try to extract any extra information about why context creation failed\n let errorMessage = null;\n const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n\n // Create the desired context\n let gl: WebGLRenderingContext | null = null;\n\n if (props.type === 'webgl2') {\n props = {...props, webgl1: false};\n }\n if (props.type === 'webgl1') {\n props = {...props, webgl2: false};\n }\n\n // Prefer webgl2 over webgl1 if both are acceptable\n if (props.webgl2) {\n gl = gl || canvas.getContext('webgl2', props) as WebGL2RenderingContext | null;\n }\n if (props.webgl1) {\n gl = gl || canvas.getContext('webgl', props) as WebGLRenderingContext | null;\n }\n\n // TODO are we removing this listener before giving it a chance to fire?\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n if (!gl) {\n throw new Error(\n `Failed to create ${props.webgl2 && !props.webgl1 ? 'WebGL2' : 'WebGL'} context: ${\n errorMessage || 'Unknown error'\n }`\n );\n }\n\n if (props.onContextLost) {\n // Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.\n const {onContextLost} = props;\n canvas.addEventListener('webglcontextlost',(event: Event) => onContextLost(event), false);\n }\n if (props.onContextRestored) {\n // Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.\n const {onContextRestored} = props;\n canvas.addEventListener('webglcontextrestored', (event: Event) => onContextRestored(event), false);\n }\n\n return gl;\n}\n\n/* TODO - can we call this asynchronously to catch the error events?\nexport async function createBrowserContextAsync(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): Promise<WebGLRenderingContext> {\n props = {...DEFAULT_CONTEXT_PROPS, ...props};\n\n // Try to extract any extra information about why context creation failed\n let errorMessage = null;\n const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n\n const gl = createBrowserContext(canvas, props);\n\n // Give the listener a chance to fire\n await new Promise(resolve => setTimeout(resolve, 0));\n\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n return gl;\n}\n*/\n"],"mappings":"AAmCA,MAAMA,qBAAmC,GAAG;EAC1CC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE,IAAI;EACZC,eAAe,EAAE,kBAAkB;EACnCC,aAAa,EAAEA,CAAA,KAAMC,OAAO,CAACC,KAAK,CAAC,oBAAoB,CAAC;EACxDC,iBAAiB,EAAEA,CAAA,KAAMF,OAAO,CAACG,IAAI,CAAC,wBAAwB;AAChE,CAAC;AAOA,OAAO,SAASC,oBAAoBA,CAACC,MAA2C,EAAEC,KAAmB,EAAyB;EAC5HA,KAAK,GAAG;IAAC,GAAGX,qBAAqB;IAAE,GAAGW;EAAK,CAAC;EAG7C,IAAIC,YAAY,GAAG,IAAI;EACvB,MAAMC,aAAa,GAAIP,KAAK,IAAMM,YAAY,GAAGN,KAAK,CAACQ,aAAa,IAAIF,YAAa;EACrFF,MAAM,CAACK,gBAAgB,CAAC,2BAA2B,EAAEF,aAAa,EAAE,KAAK,CAAC;EAG1E,IAAIG,EAAgC,GAAG,IAAI;EAE3C,IAAIL,KAAK,C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ESSGL_FAILED = 'Failed to create WebGL context in Node.js, headless gl returned null';
|
|
2
|
-
const ERR_HEADLESSGL_LOAD = " luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.";
|
|
3
|
-
const CONTEXT_DEFAULTS = {
|
|
4
|
-
width: 1,
|
|
5
|
-
height: 1,
|
|
6
|
-
debug: true,
|
|
7
|
-
throwOnError: false
|
|
8
|
-
};
|
|
9
|
-
let headlessGL = null;
|
|
10
|
-
export function registerHeadlessGL(headlessgl) {
|
|
11
|
-
headlessGL = headlessgl;
|
|
12
|
-
}
|
|
13
|
-
export function isHeadlessGLRegistered() {
|
|
14
|
-
return headlessGL !== null;
|
|
15
|
-
}
|
|
16
|
-
export function createHeadlessContext(options) {
|
|
17
|
-
options = {
|
|
18
|
-
...CONTEXT_DEFAULTS,
|
|
19
|
-
...options
|
|
20
|
-
};
|
|
21
|
-
const {
|
|
22
|
-
width,
|
|
23
|
-
height,
|
|
24
|
-
webgl1,
|
|
25
|
-
webgl2
|
|
26
|
-
} = options;
|
|
27
|
-
if (webgl2 && !webgl1) {
|
|
28
|
-
throw new Error('headless-gl does not support WebGL2');
|
|
29
|
-
}
|
|
30
|
-
if (!headlessGL) {
|
|
31
|
-
throw new Error(ERR_HEADLESSGL_LOAD);
|
|
32
|
-
}
|
|
33
|
-
const gl = headlessGL(width, height, options);
|
|
34
|
-
if (!gl) {
|
|
35
|
-
throw new Error(ERR_HEADLESSGL_FAILED);
|
|
36
|
-
}
|
|
37
|
-
return gl;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=create-headless-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-headless-context.js","names":["ERR_HEADLESSGL_FAILED","ERR_HEADLESSGL_LOAD","CONTEXT_DEFAULTS","width","height","debug","throwOnError","headlessGL","registerHeadlessGL","headlessgl","isHeadlessGLRegistered","createHeadlessContext","options","webgl1","webgl2","Error","gl"],"sources":["../../../../src/context/context/create-headless-context.ts"],"sourcesContent":["const ERR_HEADLESSGL_FAILED =\n 'Failed to create WebGL context in Node.js, headless gl returned null';\n\nconst ERR_HEADLESSGL_LOAD = `\\\n luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL \\\n contexts can not be created. This may not be an error. For example, this is a \\\n typical configuration for isorender applications running on the server.`;\n\nconst CONTEXT_DEFAULTS = {\n width: 1,\n height: 1,\n debug: true,\n throwOnError: false\n};\n\n/** Duck typing for the main headless gl export, a function to create contexts */\nexport type HeadlessGL = (width: number, height: number, options: Record<string, unknown>) => WebGLRenderingContext;\n\nlet headlessGL: HeadlessGL | null = null; \n\n/** By importing `gl` and registering it with this function, contexts can be created under Node.js */\nexport function registerHeadlessGL(headlessgl: HeadlessGL) {\n headlessGL = headlessgl;\n}\n\n/** @returns true if headless gl is registered */\nexport function isHeadlessGLRegistered(): boolean {\n return headlessGL !== null;\n}\n\n/** Create headless gl context (for running under Node.js) */\nexport function createHeadlessContext(options?: Record<string, any>): WebGLRenderingContext {\n options = {...CONTEXT_DEFAULTS, ...options};\n\n const {width, height, webgl1, webgl2} = options;\n\n if (webgl2 && !webgl1) {\n throw new Error('headless-gl does not support WebGL2');\n }\n if (!headlessGL) {\n throw new Error(ERR_HEADLESSGL_LOAD);\n }\n const gl = headlessGL(width, height, options);\n if (!gl) {\n throw new Error(ERR_HEADLESSGL_FAILED);\n }\n return gl;\n}\n"],"mappings":"AAAA,MAAMA,qBAAqB,GACzB,sEAAsE;AAExE,MAAMC,mBAAmB,gPAGiD;AAE1E,MAAMC,gBAAgB,GAAG;EACvBC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE,IAAI;EACXC,YAAY,EAAE;AAChB,CAAC;AAKD,IAAIC,UAA6B,GAAG,IAAI;AAGxC,OAAO,SAASC,kBAAkBA,CAACC,UAAsB,EAAE;EACzDF,UAAU,GAAGE,UAAU;AACzB;AAGA,OAAO,SAASC,sBAAsBA,CAAA,EAAY;EAChD,OAAOH,UAAU,KAAK,IAAI;AAC5B;AAGA,OAAO,SAASI,qBAAqBA,CAACC,OAA6B,EAAyB;EAC1FA,OAAO,GAAG;IAAC,GAAGV,gBAAgB;IAAE,GAAGU;EAAO,CAAC;EAE3C,MAAM;IAACT,KAAK;IAAEC,MAAM;IAAES,MAAM;IAAEC;EAAM,CAAC,GAAGF,OAAO;EAE/C,IAAIE,MAAM,IAAI,CAACD,MAAM,EAAE;IACrB,MAAM,IAAIE,KAAK,CAAC,qCAAqC,CAAC;EACxD;EACA,IAAI,CAACR,UAAU,EAAE;IACf,MAAM,IAAIQ,KAAK,CAACd,mBAAmB,CAAC;EACtC;EACA,MAAMe,EAAE,GAAGT,UAAU,CAACJ,KAAK,EAAEC,MAAM,EAAEQ,OAAO,CAAC;EAC7C,IAAI,CAACI,EAAE,EAAE;IACP,MAAM,IAAID,KAAK,CAACf,qBAAqB,CAAC;EACxC;EACA,OAAOgB,EAAE;AACX"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { assert } from '@luma.gl/api';
|
|
2
|
-
const ERR_CONTEXT = 'Invalid WebGLRenderingContext';
|
|
3
|
-
export const ERR_WEBGL = ERR_CONTEXT;
|
|
4
|
-
export const ERR_WEBGL2 = 'Requires WebGL2';
|
|
5
|
-
export function isWebGL(gl) {
|
|
6
|
-
if (typeof WebGLRenderingContext !== 'undefined' && gl instanceof WebGLRenderingContext) {
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
return Boolean(gl && Number.isFinite(gl._version));
|
|
13
|
-
}
|
|
14
|
-
export function isWebGL2(gl) {
|
|
15
|
-
if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
return Boolean(gl && gl._version === 2);
|
|
19
|
-
}
|
|
20
|
-
export function getWebGL2Context(gl) {
|
|
21
|
-
return isWebGL2(gl) ? gl : null;
|
|
22
|
-
}
|
|
23
|
-
export function assertWebGLContext(gl) {
|
|
24
|
-
assert(isWebGL(gl), ERR_CONTEXT);
|
|
25
|
-
return gl;
|
|
26
|
-
}
|
|
27
|
-
export function assertWebGL2Context(gl) {
|
|
28
|
-
assert(isWebGL2(gl), ERR_WEBGL2);
|
|
29
|
-
return gl;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=webgl-checks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-checks.js","names":["assert","ERR_CONTEXT","ERR_WEBGL","ERR_WEBGL2","isWebGL","gl","WebGLRenderingContext","WebGL2RenderingContext","Boolean","Number","isFinite","_version","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context"],"sources":["../../../../src/context/context/webgl-checks.ts"],"sourcesContent":["// luma.gl, MIT license\nimport {assert} from '@luma.gl/api';\n\nconst ERR_CONTEXT = 'Invalid WebGLRenderingContext';\nexport const ERR_WEBGL = ERR_CONTEXT;\nexport const ERR_WEBGL2 = 'Requires WebGL2';\n\n\n/** Check if supplied parameter is a WebGLRenderingContext */\nexport function isWebGL(gl: any): boolean {\n if (typeof WebGLRenderingContext !== 'undefined' && gl instanceof WebGLRenderingContext) {\n return true;\n }\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return true;\n }\n // Look for debug contexts, headless gl etc\n return Boolean(gl && Number.isFinite(gl._version));\n}\n\n\n/** Check if supplied parameter is a WebGL2RenderingContext */\nexport function isWebGL2(gl: any): boolean {\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return true;\n }\n // Look for debug contexts, headless gl etc\n return Boolean(gl && gl._version === 2);\n}\n\n\n/** Returns a properly typed WebGL2RenderingContext from a WebGL1 context, or null */\nexport function getWebGL2Context(gl: WebGLRenderingContext): WebGL2RenderingContext | null {\n // @ts-expect-error\n return isWebGL2(gl) ? gl : null;\n}\n\n\n/** Throw if supplied parameter is not a WebGLRenderingContext, otherwise return properly typed value */\nexport function assertWebGLContext(gl: any): WebGLRenderingContext {\n assert(isWebGL(gl), ERR_CONTEXT);\n return gl;\n}\n\n/** Throw if supplied parameter is not a WebGL2RenderingContext, otherwise return properly typed value */\nexport function assertWebGL2Context(gl: any): WebGL2RenderingContext {\n assert(isWebGL2(gl), ERR_WEBGL2);\n return gl;\n}\n"],"mappings":"AACA,SAAQA,MAAM,QAAO,cAAc;AAEnC,MAAMC,WAAW,GAAG,+BAA+B;AACnD,OAAO,MAAMC,SAAS,GAAGD,WAAW;AACpC,OAAO,MAAME,UAAU,GAAG,iBAAiB;AAI3C,OAAO,SAASC,OAAOA,CAACC,EAAO,EAAW;EACxC,IAAI,OAAOC,qBAAqB,KAAK,WAAW,IAAID,EAAE,YAAYC,qBAAqB,EAAE;IACvF,OAAO,IAAI;EACb;EACA,IAAI,OAAOC,sBAAsB,KAAK,WAAW,IAAIF,EAAE,YAAYE,sBAAsB,EAAE;IACzF,OAAO,IAAI;EACb;EAEA,OAAOC,OAAO,CAACH,EAAE,IAAII,MAAM,CAACC,QAAQ,CAACL,EAAE,CAACM,QAAQ,CAAC,CAAC;AACpD;AAIA,OAAO,SAASC,QAAQA,CAACP,EAAO,EAAW;EACzC,IAAI,OAAOE,sBAAsB,KAAK,WAAW,IAAIF,EAAE,YAAYE,sBAAsB,EAAE;IACzF,OAAO,IAAI;EACb;EAEA,OAAOC,OAAO,CAACH,EAAE,IAAIA,EAAE,CAACM,QAAQ,KAAK,CAAC,CAAC;AACzC;AAIA,OAAO,SAASE,gBAAgBA,CAACR,EAAyB,EAAiC;EAEzF,OAAOO,QAAQ,CAACP,EAAE,CAAC,GAAGA,EAAE,GAAG,IAAI;AACjC;AAIA,OAAO,SAASS,kBAAkBA,CAACT,EAAO,EAAyB;EACjEL,MAAM,CAACI,OAAO,CAACC,EAAE,CAAC,EAAEJ,WAAW,CAAC;EAChC,OAAOI,EAAE;AACX;AAGA,OAAO,SAASU,mBAAmBA,CAACV,EAAO,EAA0B;EACnEL,MAAM,CAACY,QAAQ,CAACP,EAAE,CAAC,EAAEF,UAAU,CAAC;EAChC,OAAOE,EAAE;AACX"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { log, loadScript } from '@luma.gl/api';
|
|
2
|
-
const DEFAULT_SPECTOR_PROPS = {
|
|
3
|
-
spector: log.get('spector') || log.get('inspect')
|
|
4
|
-
};
|
|
5
|
-
const SPECTOR_CDN_URL = 'https://spectorcdn.babylonjs.com/spector.bundle.js';
|
|
6
|
-
const LOG_LEVEL = 1;
|
|
7
|
-
let spector = null;
|
|
8
|
-
let initialized = false;
|
|
9
|
-
export async function loadSpectorJS(props) {
|
|
10
|
-
if (!globalThis.SPECTOR) {
|
|
11
|
-
try {
|
|
12
|
-
await loadScript(SPECTOR_CDN_URL);
|
|
13
|
-
} catch (error) {
|
|
14
|
-
log.warn(String(error));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function initializeSpectorJS(props) {
|
|
19
|
-
var _props, _props2;
|
|
20
|
-
props = {
|
|
21
|
-
...DEFAULT_SPECTOR_PROPS,
|
|
22
|
-
...props
|
|
23
|
-
};
|
|
24
|
-
if (!((_props = props) !== null && _props !== void 0 && _props.spector)) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
if (!spector && globalThis.SPECTOR) {
|
|
28
|
-
log.probe(LOG_LEVEL, "SPECTOR found and initialized")();
|
|
29
|
-
spector = new globalThis.SPECTOR.Spector();
|
|
30
|
-
if (globalThis.luma) {
|
|
31
|
-
globalThis.luma.spector = spector;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (!spector) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
if (!initialized) {
|
|
38
|
-
var _spector, _spector2;
|
|
39
|
-
initialized = true;
|
|
40
|
-
spector.spyCanvases();
|
|
41
|
-
(_spector = spector) === null || _spector === void 0 ? void 0 : _spector.onCaptureStarted.add(capture => log.info("Spector capture started:", capture)());
|
|
42
|
-
(_spector2 = spector) === null || _spector2 === void 0 ? void 0 : _spector2.onCapture.add(capture => {
|
|
43
|
-
var _spector3, _spector4, _spector5;
|
|
44
|
-
log.info("Spector capture complete:", capture)();
|
|
45
|
-
(_spector3 = spector) === null || _spector3 === void 0 ? void 0 : _spector3.getResultUI();
|
|
46
|
-
(_spector4 = spector) === null || _spector4 === void 0 ? void 0 : _spector4.resultView.display();
|
|
47
|
-
(_spector5 = spector) === null || _spector5 === void 0 ? void 0 : _spector5.resultView.addCapture(capture);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if ((_props2 = props) !== null && _props2 !== void 0 && _props2.canvas) {
|
|
51
|
-
var _spector6, _props3;
|
|
52
|
-
if (typeof props.spector === 'string' && props.spector !== props.canvas.id) {
|
|
53
|
-
return spector;
|
|
54
|
-
}
|
|
55
|
-
(_spector6 = spector) === null || _spector6 === void 0 ? void 0 : _spector6.startCapture((_props3 = props) === null || _props3 === void 0 ? void 0 : _props3.canvas, 500);
|
|
56
|
-
new Promise(resolve => setTimeout(resolve, 2000)).then(_ => {
|
|
57
|
-
var _spector7;
|
|
58
|
-
log.info("Spector capture stopped after 2 seconds")();
|
|
59
|
-
(_spector7 = spector) === null || _spector7 === void 0 ? void 0 : _spector7.stopCapture();
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return spector;
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=spector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spector.js","names":["log","loadScript","DEFAULT_SPECTOR_PROPS","spector","get","SPECTOR_CDN_URL","LOG_LEVEL","initialized","loadSpectorJS","props","globalThis","SPECTOR","error","warn","String","initializeSpectorJS","_props","_props2","probe","Spector","luma","_spector","_spector2","spyCanvases","onCaptureStarted","add","capture","info","onCapture","_spector3","_spector4","_spector5","getResultUI","resultView","display","addCapture","canvas","_spector6","_props3","id","startCapture","Promise","resolve","setTimeout","then","_","_spector7","stopCapture"],"sources":["../../../../src/context/debug/spector.ts"],"sourcesContent":["// luma.gl, MIT license\nimport {log, loadScript} from '@luma.gl/api';\n\n/** Spector debug initialization options */\ntype SpectorProps = {\n /** Canvas to monitor */\n canvas?: HTMLCanvasElement | OffscreenCanvas;\n /** Whether debug is enabled. Auto-detected if ommitted */\n debug?: boolean;\n /** Whether spector is disabled */\n spector?: boolean | string | object;\n};\n\nconst DEFAULT_SPECTOR_PROPS: SpectorProps = {\n spector: log.get('spector') || log.get('inspect')\n};\n\n// https://github.com/BabylonJS/Spector.js#basic-usage\nconst SPECTOR_CDN_URL = 'https://spectorcdn.babylonjs.com/spector.bundle.js';\nconst LOG_LEVEL = 1;\n\nlet spector: any = null;\nlet initialized: boolean = false;\n\ndeclare global {\n var SPECTOR: any;\n}\n\n/** Loads spector from CDN if not already installed */\nexport async function loadSpectorJS(props?: SpectorProps) {\n if (!globalThis.SPECTOR) {\n try {\n await loadScript(SPECTOR_CDN_URL);\n } catch(error) {\n log.warn(String(error))\n }\n }\n}\n\nexport function initializeSpectorJS(props?: SpectorProps) {\n props = {...DEFAULT_SPECTOR_PROPS, ...props};\n if (!props?.spector) {\n return null;\n }\n\n if (!spector && globalThis.SPECTOR) {\n log.probe(LOG_LEVEL, \"SPECTOR found and initialized\")();\n spector = new globalThis.SPECTOR.Spector();\n if (globalThis.luma) {\n globalThis.luma.spector = spector;\n }\n }\n\n if (!spector) {\n return null;\n }\n\n if (!initialized) {\n initialized = true;\n\n // enables recording some extra information merged in the capture like texture memory sizes and formats\n spector.spyCanvases();\n // A callback when results are ready\n spector?.onCaptureStarted.add((capture: unknown) => log.info(`Spector capture started:`, capture)());\n spector?.onCapture.add((capture: unknown) => {\n log.info(`Spector capture complete:`, capture)();\n // Use undocumented Spector API to open the UI with our capture\n // See https://github.com/BabylonJS/Spector.js/blob/767ad1195a25b85a85c381f400eb50a979239eca/src/spector.ts#L124\n spector?.getResultUI()\n spector?.resultView.display();\n spector?.resultView.addCapture(capture)\n });\n }\n\n if (props?.canvas) {\n // @ts-expect-error If spector is specified as a canvas id, only monitor that canvas\n if (typeof props.spector === 'string' && props.spector !== props.canvas.id) {\n return spector;\n }\n\n // capture startup\n // spector?.captureCanvas(props?.canvas);\n spector?.startCapture(props?.canvas, 500); // 500 commands\n new Promise(resolve => setTimeout(resolve, 2000)).then(_ => {\n log.info(`Spector capture stopped after 2 seconds`)();\n spector?.stopCapture();\n // spector?.displayUI();\n });\n }\n\n return spector;\n}\n"],"mappings":"AACA,SAAQA,GAAG,EAAEC,UAAU,QAAO,cAAc;AAY5C,MAAMC,qBAAmC,GAAG;EAC1CC,OAAO,EAAEH,GAAG,CAACI,GAAG,CAAC,SAAS,CAAC,IAAIJ,GAAG,CAACI,GAAG,CAAC,SAAS;AAClD,CAAC;AAGD,MAAMC,eAAe,GAAG,oDAAoD;AAC5E,MAAMC,SAAS,GAAG,CAAC;AAEnB,IAAIH,OAAY,GAAG,IAAI;AACvB,IAAII,WAAoB,GAAG,KAAK;AAOhC,OAAO,eAAeC,aAAaA,CAACC,KAAoB,EAAE;EACxD,IAAI,CAACC,UAAU,CAACC,OAAO,EAAE;IACvB,IAAI;MACF,MAAMV,UAAU,CAACI,eAAe,CAAC;IACnC,CAAC,CAAC,OAAMO,KAAK,EAAE;MACbZ,GAAG,CAACa,IAAI,CAACC,MAAM,CAACF,KAAK,CAAC,CAAC;IACzB;EACF;AACF;AAEA,OAAO,SAASG,mBAAmBA,CAACN,KAAoB,EAAE;EAAA,IAAAO,MAAA,EAAAC,OAAA;EACxDR,KAAK,GAAG;IAAC,GAAGP,qBAAqB;IAAE,GAAGO;EAAK,CAAC;EAC5C,IAAI,GAAAO,MAAA,GAACP,KAAK,cAAAO,MAAA,eAALA,MAAA,CAAOb,OAAO,GAAE;IACnB,OAAO,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E;IAAA,IAAAC,SAAA,EAAAC,OAAA;IAEjB,IAAI,OAAO7B,KAAK,CAACN,OAAO,KAAK,QAAQ,IAAIM,KAAK,CAACN,OAAO,KAAKM,KAAK,CAAC2B,MAAM,CAACG,EAAE,EAAE;MAC1E,OAAOpC,OAAO;IAChB;IAIA,CAAAkC,SAAA,GAAAlC,OAAO,cAAAkC,SAAA,uBAAPA,SAAA,CAASG,YAAY,EAAAF,OAAA,GAAC7B,KAAK,cAAA6B,OAAA,uBAALA,OAAA,CAAOF,MAAM,EAAE,GAAG,CAAC;IACzC,IAAIK,OAAO,CAACC,OAAO,IAAIC,UAAU,CAACD,OAAO,EAAE,IAAI,CAAC,CAAC,CAACE,IAAI,CAACC,CAAC,IAAI;MAAA,IAAAC,SAAA;MAC1D9C,GAAG,CAAC2B,IAAI,2CAA2C,EAAE;MACrD,CAAAmB,SAAA,GAAA3C,OAAO,cAAA2C,SAAA,uBAAPA,SAAA,CAASC,WAAW,EAAE;IAExB,CAAC,CAAC;EACJ;EAEA,OAAO5C,OAAO;AAChB"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { log, loadScript } from '@luma.gl/api';
|
|
2
|
-
import GL from '@luma.gl/constants';
|
|
3
|
-
const WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';
|
|
4
|
-
function getContextData(gl) {
|
|
5
|
-
gl.luma = gl.luma || {};
|
|
6
|
-
return gl.luma;
|
|
7
|
-
}
|
|
8
|
-
export async function loadWebGLDeveloperTools() {
|
|
9
|
-
if (!globalThis.WebGLDebugUtils) {
|
|
10
|
-
globalThis.global = globalThis.global || globalThis;
|
|
11
|
-
globalThis.global.module = {};
|
|
12
|
-
await loadScript(WEBGL_DEBUG_CDN_URL);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function makeDebugContext(gl) {
|
|
16
|
-
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
|
-
if (!gl) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
return props.debug ? getDebugContext(gl, props) : getRealContext(gl);
|
|
21
|
-
}
|
|
22
|
-
function getRealContext(gl) {
|
|
23
|
-
const data = getContextData(gl);
|
|
24
|
-
return data.realContext ? data.realContext : gl;
|
|
25
|
-
}
|
|
26
|
-
function getDebugContext(gl, props) {
|
|
27
|
-
if (!globalThis.WebGLDebugUtils) {
|
|
28
|
-
log.warn('webgl-debug not loaded')();
|
|
29
|
-
return gl;
|
|
30
|
-
}
|
|
31
|
-
const data = getContextData(gl);
|
|
32
|
-
if (data.debugContext) {
|
|
33
|
-
return data.debugContext;
|
|
34
|
-
}
|
|
35
|
-
globalThis.WebGLDebugUtils.init({
|
|
36
|
-
...GL,
|
|
37
|
-
...gl
|
|
38
|
-
});
|
|
39
|
-
const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(gl, onGLError.bind(null, props), onValidateGLFunc.bind(null, props));
|
|
40
|
-
for (const key in GL) {
|
|
41
|
-
if (!(key in glDebug) && typeof GL[key] === 'number') {
|
|
42
|
-
glDebug[key] = GL[key];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
class WebGLDebugContext {}
|
|
46
|
-
Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));
|
|
47
|
-
Object.setPrototypeOf(WebGLDebugContext, glDebug);
|
|
48
|
-
const debugContext = Object.create(WebGLDebugContext);
|
|
49
|
-
data.realContext = gl;
|
|
50
|
-
data.debugContext = debugContext;
|
|
51
|
-
debugContext.debug = true;
|
|
52
|
-
return debugContext;
|
|
53
|
-
}
|
|
54
|
-
function getFunctionString(functionName, functionArgs) {
|
|
55
|
-
functionArgs = Array.from(functionArgs).map(arg => arg === undefined ? 'undefined' : arg);
|
|
56
|
-
let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);
|
|
57
|
-
args = "".concat(args.slice(0, 100)).concat(args.length > 100 ? '...' : '');
|
|
58
|
-
return "gl.".concat(functionName, "(").concat(args, ")");
|
|
59
|
-
}
|
|
60
|
-
function onGLError(props, err, functionName, args) {
|
|
61
|
-
args = Array.from(args).map(arg => arg === undefined ? 'undefined' : arg);
|
|
62
|
-
const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);
|
|
63
|
-
const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);
|
|
64
|
-
const glName = props.webgl2 ? 'gl2' : 'gl1';
|
|
65
|
-
const message = "".concat(errorMessage, " in ").concat(glName, ".").concat(functionName, "(").concat(functionArgs, ")");
|
|
66
|
-
log.error(message)();
|
|
67
|
-
debugger;
|
|
68
|
-
if (props.throwOnError) {
|
|
69
|
-
throw new Error(message);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function onValidateGLFunc(props, functionName, functionArgs) {
|
|
73
|
-
let functionString = '';
|
|
74
|
-
if (log.level >= 1) {
|
|
75
|
-
functionString = getFunctionString(functionName, functionArgs);
|
|
76
|
-
log.log(1, functionString)();
|
|
77
|
-
}
|
|
78
|
-
if (props.break && props.break.length > 0) {
|
|
79
|
-
functionString = functionString || getFunctionString(functionName, functionArgs);
|
|
80
|
-
const isBreakpoint = props.break.every(breakOn => functionString.indexOf(breakOn) !== -1);
|
|
81
|
-
if (isBreakpoint) {
|
|
82
|
-
debugger;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
for (const arg of functionArgs) {
|
|
86
|
-
if (arg === undefined) {
|
|
87
|
-
functionString = functionString || getFunctionString(functionName, functionArgs);
|
|
88
|
-
if (props.throwOnError) {
|
|
89
|
-
throw new Error("Undefined argument: ".concat(functionString));
|
|
90
|
-
} else {
|
|
91
|
-
log.error("Undefined argument: ".concat(functionString))();
|
|
92
|
-
debugger;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=webgl-developer-tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-developer-tools.js","names":["log","loadScript","GL","WEBGL_DEBUG_CDN_URL","getContextData","gl","luma","loadWebGLDeveloperTools","globalThis","WebGLDebugUtils","global","module","makeDebugContext","props","arguments","length","undefined","debug","getDebugContext","getRealContext","data","realContext","warn","debugContext","init","glDebug","onGLError","bind","onValidateGLFunc","key","WebGLDebugContext","Object","setPrototypeOf","getPrototypeOf","create","getFunctionString","functionName","functionArgs","Array","from","map","arg","args","glFunctionArgsToString","concat","slice","err","errorMessage","glEnumToString","glName","webgl2","message","error","throwOnError","Error","functionString","level","break","isBreakpoint","every","breakOn","indexOf"],"sources":["../../../../src/context/debug/webgl-developer-tools.ts"],"sourcesContent":["// luma.gl, MIT license\nimport {log, loadScript} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\n\nconst WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';\n\ntype DebugContextProps = {\n debug?: boolean;\n throwOnError?: boolean;\n break?: string[];\n webgl2?: boolean;\n};\n\n// const DEFAULT_DEBUG_CONTEXT_PROPS: Required<DebugContextProps> = {\n// debug: true,\n// throwOnError: false,\n// break: [],\n// webgl2: false,\n// }\n\n// Helper to get shared context data\nfunction getContextData(gl: any) {\n gl.luma = gl.luma || {};\n return gl.luma;\n}\n\ndeclare global {\n var WebGLDebugUtils: any;\n}\n\n/**\n * Loads Khronos WebGLDeveloperTools from CDN if not already installed \n * const WebGLDebugUtils = require('webgl-debug');\n * @see https://github.com/KhronosGroup/WebGLDeveloperTools\n * @see https://github.com/vorg/webgl-debug\n */\nexport async function loadWebGLDeveloperTools(): Promise<void> {\n if (!globalThis.WebGLDebugUtils) {\n globalThis.global = globalThis.global || globalThis;\n // @ts-expect-error Developer tools expects global to be set\n globalThis.global.module = {};\n await loadScript(WEBGL_DEBUG_CDN_URL);\n }\n}\n\n// Returns (a potentially new) context with debug instrumentation turned off or on.\n// Note that this actually returns a new context\nexport function makeDebugContext(gl: WebGLRenderingContext, props: DebugContextProps = {}): WebGLRenderingContext | null {\n // Return null to ensure we don't try to create a context in this case (TODO what case is that?)\n if (!gl) {\n return null;\n }\n\n return props.debug ? getDebugContext(gl, props) : getRealContext(gl);\n}\n\n// Returns the real context from either of the real/debug contexts\nfunction getRealContext(gl: WebGLRenderingContext): WebGLRenderingContext {\n const data = getContextData(gl);\n // If the context has a realContext member, it is a debug context so return the realContext\n return data.realContext ? data.realContext : gl;\n}\n\n// Returns the debug context from either of the real/debug contexts\nfunction getDebugContext(gl: WebGLRenderingContext, props: DebugContextProps): WebGLRenderingContext {\n if (!globalThis.WebGLDebugUtils) {\n log.warn('webgl-debug not loaded')();\n return gl;\n }\n\n const data = getContextData(gl);\n\n // If this already has a debug context, return it.\n if (data.debugContext) {\n return data.debugContext;\n }\n\n // Create a new debug context\n globalThis.WebGLDebugUtils.init({...GL, ...gl});\n const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(\n gl,\n onGLError.bind(null, props),\n onValidateGLFunc.bind(null, props)\n );\n\n // Make sure we have all WebGL2 and extension constants (todo dynamic import to circumvent minification?)\n for (const key in GL) {\n if (!(key in glDebug) && typeof GL[key] === 'number') {\n glDebug[key] = GL[key];\n }\n }\n \n // Ensure we have a clean prototype on the instrumented object\n // Note: setPrototypeOf does come with perf warnings, but we already take a bigger perf reduction\n // by synchronizing the WebGL errors after each WebGL call.\n class WebGLDebugContext {}\n Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));\n Object.setPrototypeOf(WebGLDebugContext, glDebug);\n const debugContext = Object.create(WebGLDebugContext);\n // Store the debug context\n data.realContext = gl;\n data.debugContext = debugContext;\n debugContext.debug = true;\n\n // Return it\n return debugContext;\n}\n\n// DEBUG TRACING\n\nfunction getFunctionString(functionName: string, functionArgs): string {\n // Cover bug in webgl-debug-tools\n functionArgs = Array.from(functionArgs).map(arg => arg === undefined ? 'undefined' : arg);\n let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);\n args = `${args.slice(0, 100)}${args.length > 100 ? '...' : ''}`;\n return `gl.${functionName}(${args})`;\n}\n\nfunction onGLError(props: DebugContextProps, err, functionName: string, args: any[]): void {\n // Cover bug in webgl-debug-tools\n args = Array.from(args).map(arg => arg === undefined ? 'undefined' : arg);\n const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);\n const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);\n const glName = props.webgl2 ? 'gl2' : 'gl1';\n const message = `${errorMessage} in ${glName}.${functionName}(${functionArgs})`;\n log.error(message)();\n debugger; // eslint-disable-line\n if (props.throwOnError) {\n throw new Error(message);\n }\n}\n\n// Don't generate function string until it is needed\nfunction onValidateGLFunc(props: DebugContextProps, functionName: string, functionArgs: any[]): void {\n let functionString: string = '';\n if (log.level >= 1) {\n functionString = getFunctionString(functionName, functionArgs);\n log.log(1, functionString)();\n }\n\n // If array of breakpoint strings supplied, check if any of them is contained in current GL function\n if (props.break && props.break.length > 0) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n const isBreakpoint = props.break.every((breakOn: string) => functionString.indexOf(breakOn) !== -1);\n if (isBreakpoint) {\n debugger; // eslint-disable-line\n }\n }\n\n for (const arg of functionArgs) {\n if (arg === undefined) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n if (props.throwOnError) {\n throw new Error(`Undefined argument: ${functionString}`);\n } else {\n log.error(`Undefined argument: ${functionString}`)();\n debugger; // eslint-disable-line\n }\n }\n }\n}\n"],"mappings":"AACA,SAAQA,GAAG,EAAEC,UAAU,QAAO,cAAc;AAC5C,OAAOC,EAAE,MAAM,oBAAoB;AAEnC,MAAMC,mBAAmB,GAAG,8CAA8C;AAiB1E,SAASC,cAAcA,CAACC,EAAO,EAAE;EAC/BA,EAAE,CAACC,IAAI,GAAGD,EAAE,CAACC,IAAI,IAAI,CAAC,CAAC;EACvB,OAAOD,EAAE,CAACC,IAAI;AAChB;AAYA,OAAO,eAAeC,uBAAuBA,CAAA,EAAkB;EAC7D,IAAI,CAACC,UAAU,CAACC,e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CAAEC,OAAe,IAAKL,cAAc,CAACM,OAAO,CAACD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACnG,IAAIF,YAAY,EAAE;MAChB;IACF;EACF;EAEA,KAAK,MAAMjB,GAAG,IAAIJ,YAAY,EAAE;IAC9B,IAAII,GAAG,KAAKzB,SAAS,EAAE;MACrBuC,cAAc,GAAGA,cAAc,IAAIpB,iBAAiB,CAACC,YAAY,EAAEC,YAAY,CAAC;MAChF,IAAIxB,KAAK,CAACwC,YAAY,EAAE;QACtB,MAAM,IAAIC,KAAK,wBAAAV,MAAA,CAAwBW,cAAc,EAAG;MAC1D,CAAC,MAAM;QACLvD,GAAG,CAACoD,KAAK,wBAAAR,MAAA,CAAwBW,cAAc,EAAG,EAAE;QACpD;MACF;IACF;EACF;AACF"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { GL_PARAMETER_DEFAULTS, GL_PARAMETER_SETTERS, GL_COMPOSITE_PARAMETER_SETTERS, GL_PARAMETER_GETTERS } from './webgl-parameter-tables';
|
|
2
|
-
import WebGLDevice from '../../adapter/webgl-device';
|
|
3
|
-
export function setParameters(device, parameters) {
|
|
4
|
-
const webglDevice = WebGLDevice.attach(device);
|
|
5
|
-
const gl = webglDevice.gl;
|
|
6
|
-
if (isObjectEmpty(parameters)) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const compositeSetters = {};
|
|
10
|
-
for (const key in parameters) {
|
|
11
|
-
const glConstant = Number(key);
|
|
12
|
-
const setter = GL_PARAMETER_SETTERS[key];
|
|
13
|
-
if (setter) {
|
|
14
|
-
if (typeof setter === 'string') {
|
|
15
|
-
compositeSetters[setter] = true;
|
|
16
|
-
} else {
|
|
17
|
-
setter(gl, parameters[key], glConstant);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const cache = gl.state && gl.state.cache;
|
|
22
|
-
if (cache) {
|
|
23
|
-
for (const key in compositeSetters) {
|
|
24
|
-
const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];
|
|
25
|
-
compositeSetter(gl, parameters, cache);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export function getParameters(device) {
|
|
30
|
-
let parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GL_PARAMETER_DEFAULTS;
|
|
31
|
-
const webglDevice = WebGLDevice.attach(device);
|
|
32
|
-
const gl = webglDevice.gl;
|
|
33
|
-
if (typeof parameters === 'number') {
|
|
34
|
-
const key = parameters;
|
|
35
|
-
const getter = GL_PARAMETER_GETTERS[key];
|
|
36
|
-
return getter ? getter(gl, key) : gl.getParameter(key);
|
|
37
|
-
}
|
|
38
|
-
const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);
|
|
39
|
-
const state = {};
|
|
40
|
-
for (const key of parameterKeys) {
|
|
41
|
-
const getter = GL_PARAMETER_GETTERS[key];
|
|
42
|
-
state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));
|
|
43
|
-
}
|
|
44
|
-
return state;
|
|
45
|
-
}
|
|
46
|
-
export function resetParameters(device) {
|
|
47
|
-
setParameters(device, GL_PARAMETER_DEFAULTS);
|
|
48
|
-
}
|
|
49
|
-
function isObjectEmpty(object) {
|
|
50
|
-
for (const key in object) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=unified-parameter-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unified-parameter-api.js","names":["GL_PARAMETER_DEFAULTS","GL_PARAMETER_SETTERS","GL_COMPOSITE_PARAMETER_SETTERS","GL_PARAMETER_GETTERS","WebGLDevice","setParameters","device","parameters","webglDevice","attach","gl","isObjectEmpty","compositeSetters","key","glConstant","Number","setter","cache","state","compositeSetter","getParameters","arguments","length","undefined","getter","getParameter","parameterKeys","Array","isArray","Object","keys","resetParameters","object"],"sources":["../../../../src/context/parameters/unified-parameter-api.ts"],"sourcesContent":["// Provides a unified API for getting and setting any WebGL parameter\n// Also knows default values of all parameters, enabling fast cache initialization\n// Provides base functionality for the state caching.\nimport {Device} from '@luma.gl/api';\nimport type {GLParameters} from '../../types/webgl';\nimport {\n GL_PARAMETER_DEFAULTS,\n GL_PARAMETER_SETTERS,\n GL_COMPOSITE_PARAMETER_SETTERS,\n GL_PARAMETER_GETTERS\n} from './webgl-parameter-tables';\n\nimport WebGLDevice from '../../adapter/webgl-device';\n\nexport type {GLParameters};\n\n/**\n * Sets any GL parameter regardless of function (gl.blendMode, ...)\n *\n * @note requires a `cache` object to be set on the context (gl.state.cache)\n * This object is used to fill in any missing values for composite setter functions\n */\nexport function setParameters(\n device: Device | WebGLRenderingContext,\n parameters: GLParameters\n): void {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n return;\n }\n\n const compositeSetters = {};\n\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n\n for (const key in parameters) {\n const glConstant = Number(key);\n const setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n } else {\n // if (gl[glConstant] !== undefined) {\n // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...\n // TODO - deep equal on values? only call setter if value has changed?\n // NOTE - the setter will automatically update this.state\n setter(gl, parameters[key], glConstant);\n }\n }\n }\n\n // HANDLE COMPOSITE SETTERS\n\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n // @ts-expect-error\n const cache = gl.state && gl.state.cache;\n if (cache) {\n for (const key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, parameters, cache);\n }\n }\n\n // Add a log for the else case?\n}\n\n/**\n * Reads the entire WebGL state from a context\n\n // default to querying all parameters\n\n * @returns - a newly created map, with values keyed by GL parameters\n *\n * @note Copies the state from a context (gl.getParameter should not be overriden)\n * Reads the entire WebGL state from a context\n *\n * @note This can generates a huge amount of synchronous driver roundtrips and should be\n * considered a very slow operation, to be used only if/when a context already manipulated\n * by external code needs to be synchronized for the first time\n */\nexport function getParameters(\n device: Device | WebGLRenderingContext,\n parameters: keyof GLParameters | (keyof GLParameters)[] | GLParameters = GL_PARAMETER_DEFAULTS\n): GLParameters {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n // support both arrays of parameters and objects (keys represent parameters)\n\n if (typeof parameters === 'number') {\n // single GL enum\n const key = parameters;\n const getter = GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n\n const state = {};\n for (const key of parameterKeys) {\n const getter = GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n return state;\n}\n\n/**\n * Reset all parameters to a (almost) pure context state\n * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,\n * NOT the canvas size dimensions, so they will have to be properly set after\n * calling this function.\n */\nexport function resetParameters(device: Device | WebGLRenderingContext): void {\n setParameters(device, GL_PARAMETER_DEFAULTS);\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"mappings":"AAKA,SACEA,qBAAqB,EACrBC,oBAAoB,EACpBC,8BAA8B,EAC9BC,oBAAoB,QACf,0BAA0B;AAEjC,OAAOC,WAAW,MAAM,4BAA4B;AAUpD,OAAO,SAASC,aAAaA,CAC3BC,MAAsC,EACtC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