@luma.gl/webgl 9.0.0-alpha.14 → 9.0.0-alpha.16
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.js +199 -136
- 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 +62 -176
- package/dist/adapter/converters/sampler-parameters.js +149 -206
- 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 +437 -890
- package/dist/adapter/converters/vertex-formats.js +15 -33
- package/dist/adapter/device-helpers/device-features.js +119 -100
- 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 +88 -86
- package/dist/adapter/device-helpers/get-device-info.js +42 -43
- package/dist/adapter/device-helpers/is-old-ie.js +9 -6
- package/dist/adapter/helpers/attribute-utils.js +50 -74
- 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 +27 -0
- package/dist/adapter/helpers/get-shader-layout.js +307 -296
- 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 +32 -33
- package/dist/adapter/helpers/set-uniform.js +67 -110
- package/dist/adapter/helpers/uniforms.js +80 -85
- package/dist/adapter/objects/constants-to-keys.js +33 -33
- 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 +67 -86
- package/dist/adapter/objects/webgl-resource.js +213 -205
- 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 +74 -76
- package/dist/adapter/resources/webgl-buffer.js +150 -147
- 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 +39 -55
- package/dist/adapter/resources/webgl-command-encoder.js +25 -49
- package/dist/adapter/resources/webgl-external-texture.js +91 -1
- 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 +231 -258
- 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 +8 -18
- package/dist/adapter/resources/webgl-render-pipeline.js +316 -378
- package/dist/adapter/resources/webgl-sampler.js +42 -47
- 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 +58 -68
- package/dist/adapter/resources/webgl-texture.d.ts +5 -5
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +661 -815
- package/dist/adapter/webgl-canvas-context.js +55 -49
- package/dist/adapter/webgl-device.js +288 -338
- package/dist/bundle.js +1 -2
- package/dist/classic/accessor.js +120 -127
- package/dist/classic/buffer.d.ts +1 -1
- package/dist/classic/buffer.d.ts.map +1 -1
- package/dist/classic/buffer.js +325 -356
- 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 +91 -101
- package/dist/context/context/create-browser-context.d.ts +1 -2
- package/dist/context/context/create-browser-context.d.ts.map +1 -1
- package/dist/context/context/create-browser-context.js +61 -52
- 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 +26 -33
- package/dist/context/context/webgl-checks.js +25 -20
- package/dist/context/debug/spector.d.ts +1 -2
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +53 -62
- 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 +106 -93
- package/dist/context/parameters/unified-parameter-api.js +91 -55
- 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 +462 -423
- package/dist/context/polyfill/context-data.js +16 -12
- package/dist/context/polyfill/get-parameter-polyfill.js +91 -76
- package/dist/context/polyfill/polyfill-context.js +75 -80
- package/dist/context/polyfill/polyfill-table.js +133 -139
- package/dist/context/polyfill/polyfill-vertex-array-object.js +255 -297
- package/dist/context/state-tracker/deep-array-equal.js +16 -18
- package/dist/context/state-tracker/track-context-state.js +183 -161
- package/dist/context/state-tracker/with-parameters.js +43 -35
- package/dist/dist.min.js +1 -0
- package/dist/es5/adapter/converters/device-parameters.js +3 -38
- package/dist/es5/adapter/converters/device-parameters.js.map +1 -1
- package/dist/es5/adapter/converters/renderbuffer-formats.js +2 -14
- package/dist/es5/adapter/converters/renderbuffer-formats.js.map +1 -1
- package/dist/es5/adapter/converters/sampler-parameters.js +2 -65
- package/dist/es5/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/es5/adapter/converters/texture-formats.js +9 -81
- package/dist/es5/adapter/converters/texture-formats.js.map +1 -1
- package/dist/es5/adapter/converters/vertex-formats.js +0 -12
- package/dist/es5/adapter/converters/vertex-formats.js.map +1 -1
- package/dist/es5/adapter/device-helpers/device-features.js +6 -40
- package/dist/es5/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/es5/adapter/device-helpers/device-limits.js +0 -10
- package/dist/es5/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/es5/adapter/device-helpers/get-device-info.js +0 -10
- package/dist/es5/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/es5/adapter/device-helpers/is-old-ie.js +0 -1
- package/dist/es5/adapter/device-helpers/is-old-ie.js.map +1 -1
- package/dist/es5/adapter/helpers/attribute-utils.js +3 -25
- package/dist/es5/adapter/helpers/attribute-utils.js.map +1 -1
- package/dist/es5/adapter/helpers/get-shader-info.js +31 -0
- package/dist/es5/adapter/helpers/get-shader-info.js.map +1 -0
- package/dist/es5/adapter/helpers/get-shader-layout.js +23 -101
- package/dist/es5/adapter/helpers/get-shader-layout.js.map +1 -1
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js +6 -24
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
- package/dist/es5/adapter/helpers/set-uniform.js +0 -33
- package/dist/es5/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/es5/adapter/helpers/uniforms.js +13 -37
- package/dist/es5/adapter/helpers/uniforms.js.map +1 -1
- package/dist/es5/adapter/objects/constants-to-keys.js +1 -12
- package/dist/es5/adapter/objects/constants-to-keys.js.map +1 -1
- package/dist/es5/adapter/objects/webgl-renderbuffer.js +5 -33
- package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/es5/adapter/objects/webgl-resource.js +6 -60
- package/dist/es5/adapter/objects/webgl-resource.js.map +1 -1
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js +7 -35
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-buffer.js +20 -66
- package/dist/es5/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-command-buffer.js +6 -32
- package/dist/es5/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-command-encoder.js +0 -18
- package/dist/es5/adapter/resources/webgl-command-encoder.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-external-texture.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-framebuffer.js +10 -82
- package/dist/es5/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-render-pass.js +2 -19
- package/dist/es5/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-render-pipeline.js +24 -133
- package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-sampler.js +2 -28
- package/dist/es5/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-shader.js +13 -52
- package/dist/es5/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/es5/adapter/resources/webgl-texture.js +137 -291
- package/dist/es5/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/es5/adapter/webgl-canvas-context.js +0 -24
- package/dist/es5/adapter/webgl-canvas-context.js.map +1 -1
- package/dist/es5/adapter/webgl-device.js +40 -127
- package/dist/es5/adapter/webgl-device.js.map +1 -1
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/classic/accessor.js +1 -31
- package/dist/es5/classic/accessor.js.map +1 -1
- package/dist/es5/classic/buffer.js +32 -102
- package/dist/es5/classic/buffer.js.map +1 -1
- package/dist/es5/classic/typed-array-utils.js +10 -37
- package/dist/es5/classic/typed-array-utils.js.map +1 -1
- package/dist/es5/context/context/create-browser-context.js +4 -21
- package/dist/es5/context/context/create-browser-context.js.map +1 -1
- package/dist/es5/context/context/create-headless-context.js +8 -21
- package/dist/es5/context/context/create-headless-context.js.map +1 -1
- package/dist/es5/context/context/webgl-checks.js +4 -14
- package/dist/es5/context/context/webgl-checks.js.map +1 -1
- package/dist/es5/context/debug/spector.js +20 -54
- package/dist/es5/context/debug/spector.js.map +1 -1
- package/dist/es5/context/debug/webgl-developer-tools.js +19 -65
- package/dist/es5/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/es5/context/parameters/unified-parameter-api.js +3 -28
- package/dist/es5/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/es5/context/parameters/webgl-parameter-tables.js +18 -65
- package/dist/es5/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/es5/context/polyfill/context-data.js +0 -3
- package/dist/es5/context/polyfill/context-data.js.map +1 -1
- package/dist/es5/context/polyfill/get-parameter-polyfill.js +0 -12
- package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/es5/context/polyfill/polyfill-context.js +8 -33
- package/dist/es5/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/es5/context/polyfill/polyfill-table.js +3 -27
- package/dist/es5/context/polyfill/polyfill-table.js.map +1 -1
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js +0 -70
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
- package/dist/es5/context/state-tracker/deep-array-equal.js +0 -5
- package/dist/es5/context/state-tracker/deep-array-equal.js.map +1 -1
- package/dist/es5/context/state-tracker/track-context-state.js +10 -53
- package/dist/es5/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/es5/context/state-tracker/with-parameters.js +1 -13
- package/dist/es5/context/state-tracker/with-parameters.js.map +1 -1
- package/dist/es5/index.js +72 -99
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/init.js +0 -3
- package/dist/es5/init.js.map +1 -1
- package/dist/es5/types/webgl.js +0 -1
- package/dist/es5/types/webgl.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/adapter/converters/device-parameters.js +0 -20
- package/dist/esm/adapter/converters/device-parameters.js.map +1 -1
- package/dist/esm/adapter/converters/renderbuffer-formats.js +0 -4
- package/dist/esm/adapter/converters/renderbuffer-formats.js.map +1 -1
- package/dist/esm/adapter/converters/sampler-parameters.js +2 -57
- package/dist/esm/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/esm/adapter/converters/texture-formats.js +8 -52
- package/dist/esm/adapter/converters/texture-formats.js.map +1 -1
- package/dist/esm/adapter/converters/vertex-formats.js +0 -9
- package/dist/esm/adapter/converters/vertex-formats.js.map +1 -1
- package/dist/esm/adapter/device-helpers/device-features.js +2 -19
- package/dist/esm/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/esm/adapter/device-helpers/device-limits.js +0 -3
- package/dist/esm/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/esm/adapter/device-helpers/get-device-info.js +0 -6
- package/dist/esm/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/esm/adapter/device-helpers/is-old-ie.js +2 -1
- package/dist/esm/adapter/device-helpers/is-old-ie.js.map +1 -1
- package/dist/esm/adapter/helpers/attribute-utils.js +0 -17
- package/dist/esm/adapter/helpers/attribute-utils.js.map +1 -1
- package/dist/esm/adapter/helpers/get-shader-info.js +25 -0
- package/dist/esm/adapter/helpers/get-shader-info.js.map +1 -0
- package/dist/esm/adapter/helpers/get-shader-layout.js +2 -48
- package/dist/esm/adapter/helpers/get-shader-layout.js.map +1 -1
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js +0 -7
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
- package/dist/esm/adapter/helpers/set-uniform.js +0 -30
- package/dist/esm/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/esm/adapter/helpers/uniforms.js +0 -10
- package/dist/esm/adapter/helpers/uniforms.js.map +1 -1
- package/dist/esm/adapter/objects/constants-to-keys.js +0 -7
- package/dist/esm/adapter/objects/constants-to-keys.js.map +1 -1
- package/dist/esm/adapter/objects/webgl-renderbuffer.js +2 -18
- package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/esm/adapter/objects/webgl-resource.js +10 -57
- package/dist/esm/adapter/objects/webgl-resource.js.map +1 -1
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js +5 -15
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-buffer.js +12 -40
- package/dist/esm/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-command-buffer.js +2 -17
- package/dist/esm/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-command-encoder.js +0 -12
- package/dist/esm/adapter/resources/webgl-command-encoder.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-external-texture.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-framebuffer.js +0 -60
- package/dist/esm/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-render-pass.js +1 -8
- package/dist/esm/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-render-pipeline.js +0 -89
- package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-sampler.js +0 -12
- package/dist/esm/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-shader.js +2 -16
- package/dist/esm/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/esm/adapter/resources/webgl-texture.js +36 -154
- package/dist/esm/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/esm/adapter/webgl-canvas-context.js +0 -14
- package/dist/esm/adapter/webgl-canvas-context.js.map +1 -1
- package/dist/esm/adapter/webgl-device.js +19 -89
- package/dist/esm/adapter/webgl-device.js.map +1 -1
- package/dist/esm/bundle.js +0 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/classic/accessor.js +10 -34
- package/dist/esm/classic/accessor.js.map +1 -1
- package/dist/esm/classic/buffer.js +15 -71
- package/dist/esm/classic/buffer.js.map +1 -1
- package/dist/esm/classic/typed-array-utils.js +0 -20
- package/dist/esm/classic/typed-array-utils.js.map +1 -1
- package/dist/esm/context/context/create-browser-context.js +6 -14
- package/dist/esm/context/context/create-browser-context.js.map +1 -1
- package/dist/esm/context/context/create-headless-context.js +2 -6
- package/dist/esm/context/context/create-headless-context.js.map +1 -1
- package/dist/esm/context/context/webgl-checks.js +0 -3
- package/dist/esm/context/context/webgl-checks.js.map +1 -1
- package/dist/esm/context/debug/spector.js +2 -14
- package/dist/esm/context/debug/spector.js.map +1 -1
- package/dist/esm/context/debug/webgl-developer-tools.js +4 -22
- package/dist/esm/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/esm/context/parameters/unified-parameter-api.js +2 -13
- package/dist/esm/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/esm/context/parameters/webgl-parameter-tables.js +0 -19
- package/dist/esm/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/esm/context/polyfill/context-data.js +0 -2
- package/dist/esm/context/polyfill/context-data.js.map +1 -1
- package/dist/esm/context/polyfill/get-parameter-polyfill.js +0 -5
- package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/esm/context/polyfill/polyfill-context.js +14 -21
- package/dist/esm/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/esm/context/polyfill/polyfill-table.js +0 -23
- package/dist/esm/context/polyfill/polyfill-table.js.map +1 -1
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js +0 -70
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
- package/dist/esm/context/state-tracker/deep-array-equal.js +0 -4
- package/dist/esm/context/state-tracker/deep-array-equal.js.map +1 -1
- package/dist/esm/context/state-tracker/track-context-state.js +11 -45
- package/dist/esm/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/esm/context/state-tracker/with-parameters.js +0 -6
- package/dist/esm/context/state-tracker/with-parameters.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/init.js.map +1 -1
- package/dist/esm/types/webgl.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/index.js +39 -25
- package/dist/init.js +1 -2
- package/dist/types/webgl.d.ts +20 -20
- package/dist/types/webgl.d.ts.map +1 -1
- package/dist/types/webgl.js +0 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -1
- package/package.json +8 -8
- package/src/adapter/helpers/get-shader-info.ts +37 -0
- package/src/adapter/helpers/parse-shader-compiler-log.ts +1 -1
- package/src/adapter/resources/webgl-render-pass.ts +1 -1
- package/src/adapter/resources/webgl-shader.ts +2 -2
- package/src/adapter/webgl-device.ts +1 -1
- package/src/context/debug/webgl-developer-tools.ts +0 -1
- package/src/types/webgl.ts +4 -4
- package/dist/adapter/converters/device-parameters.js.map +0 -1
- package/dist/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/adapter/converters/texture-formats.js.map +0 -1
- package/dist/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/adapter/helpers/uniforms.js.map +0 -1
- package/dist/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/adapter/objects/webgl-vertex-array-object.js.map +0 -1
- package/dist/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/adapter/webgl-device.js.map +0 -1
- package/dist/bundle.js.map +0 -1
- package/dist/classic/accessor.js.map +0 -1
- package/dist/classic/buffer.js.map +0 -1
- package/dist/classic/typed-array-utils.js.map +0 -1
- package/dist/context/context/create-browser-context.js.map +0 -1
- package/dist/context/context/create-headless-context.js.map +0 -1
- package/dist/context/context/webgl-checks.js.map +0 -1
- package/dist/context/debug/spector.js.map +0 -1
- package/dist/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/context/polyfill/context-data.js.map +0 -1
- package/dist/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init.js.map +0 -1
- package/dist/types/webgl.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
const MESSAGE_TYPES = ['warning', 'error', 'info'];
|
|
2
|
+
/**
|
|
3
|
+
* Parse a WebGL-format GLSL compilation log into an array of WebGPU style message records.
|
|
4
|
+
* This follows documented WebGL conventions for compilation logs.
|
|
5
|
+
* Based on https://github.com/wwwtyro/gl-format-compiler-error (public domain)
|
|
6
|
+
*/
|
|
2
7
|
export function parseShaderCompilerLog(errLog) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
// Parse the error - note: browser and driver dependent
|
|
9
|
+
const lines = errLog.split(/\r?\n/);
|
|
10
|
+
const messages = [];
|
|
11
|
+
for (const line of lines) {
|
|
12
|
+
if (line.length <= 1) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const segments = line.split(':');
|
|
16
|
+
const [messageType, linePosition, lineNumber, ...rest] = segments;
|
|
17
|
+
let lineNum = parseInt(lineNumber, 10);
|
|
18
|
+
if (isNaN(lineNum)) {
|
|
19
|
+
lineNum = 0;
|
|
20
|
+
}
|
|
21
|
+
let linePos = parseInt(linePosition, 10);
|
|
22
|
+
if (isNaN(linePos)) {
|
|
23
|
+
linePos = 0;
|
|
24
|
+
}
|
|
25
|
+
// Ensure supported type
|
|
26
|
+
const lowerCaseType = messageType.toLowerCase();
|
|
27
|
+
const type = (MESSAGE_TYPES.includes(lowerCaseType) ? lowerCaseType : 'info');
|
|
28
|
+
messages.push({
|
|
29
|
+
message: rest.join(':').trim(),
|
|
30
|
+
type,
|
|
31
|
+
lineNum,
|
|
32
|
+
linePos // TODO
|
|
33
|
+
});
|
|
9
34
|
}
|
|
10
|
-
|
|
11
|
-
const segments = line.split(':');
|
|
12
|
-
const [messageType, linePosition, lineNumber, ...rest] = segments;
|
|
13
|
-
let lineNum = parseInt(lineNumber, 10);
|
|
14
|
-
|
|
15
|
-
if (isNaN(lineNum)) {
|
|
16
|
-
lineNum = 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let linePos = parseInt(linePosition, 10);
|
|
20
|
-
|
|
21
|
-
if (isNaN(linePos)) {
|
|
22
|
-
linePos = 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const lowerCaseType = messageType.toLowerCase();
|
|
26
|
-
const type = MESSAGE_TYPES.includes(lowerCaseType) ? lowerCaseType : 'info';
|
|
27
|
-
messages.push({
|
|
28
|
-
message: rest.join(':').trim(),
|
|
29
|
-
type,
|
|
30
|
-
lineNum,
|
|
31
|
-
linePos
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return messages;
|
|
35
|
+
return messages;
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=parse-shader-compiler-log.js.map
|
|
@@ -1,115 +1,72 @@
|
|
|
1
|
+
// Uniforms
|
|
1
2
|
import GL from '@luma.gl/constants';
|
|
3
|
+
/** Set a raw uniform (without type conversion and caching) */
|
|
4
|
+
/* eslint-disable max-len */
|
|
2
5
|
export function setUniform(gl, location, type, value) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
const gl2 = gl;
|
|
7
|
+
if (typeof value === 'number') {
|
|
8
|
+
// prettier-ignore
|
|
9
|
+
switch (type) {
|
|
10
|
+
// WebGL1 samplers
|
|
11
|
+
case GL.SAMPLER_2D:
|
|
12
|
+
case GL.SAMPLER_CUBE:
|
|
13
|
+
// WebGL2 samplers
|
|
14
|
+
case GL.SAMPLER_3D:
|
|
15
|
+
case GL.SAMPLER_2D_SHADOW:
|
|
16
|
+
case GL.SAMPLER_2D_ARRAY:
|
|
17
|
+
case GL.SAMPLER_2D_ARRAY_SHADOW:
|
|
18
|
+
case GL.SAMPLER_CUBE_SHADOW:
|
|
19
|
+
case GL.INT_SAMPLER_2D:
|
|
20
|
+
case GL.INT_SAMPLER_3D:
|
|
21
|
+
case GL.INT_SAMPLER_CUBE:
|
|
22
|
+
case GL.INT_SAMPLER_2D_ARRAY:
|
|
23
|
+
case GL.UNSIGNED_INT_SAMPLER_2D:
|
|
24
|
+
case GL.UNSIGNED_INT_SAMPLER_3D:
|
|
25
|
+
case GL.UNSIGNED_INT_SAMPLER_CUBE:
|
|
26
|
+
case GL.UNSIGNED_INT_SAMPLER_2D_ARRAY:
|
|
27
|
+
return gl.uniform1i(location, value);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// @ts-expect-error
|
|
31
|
+
if (value === true) {
|
|
32
|
+
value = 1;
|
|
33
|
+
}
|
|
34
|
+
// @ts-expect-error
|
|
35
|
+
if (value === false) {
|
|
36
|
+
value = 1;
|
|
37
|
+
}
|
|
38
|
+
const arrayValue = (typeof value === 'number') ? [value] : value;
|
|
39
|
+
// prettier-ignore
|
|
6
40
|
switch (type) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return
|
|
41
|
+
case GL.FLOAT: return gl.uniform1fv(location, arrayValue);
|
|
42
|
+
case GL.FLOAT_VEC2: return gl.uniform2fv(location, arrayValue);
|
|
43
|
+
case GL.FLOAT_VEC3: return gl.uniform3fv(location, arrayValue);
|
|
44
|
+
case GL.FLOAT_VEC4: return gl.uniform4fv(location, arrayValue);
|
|
45
|
+
case GL.INT: return gl.uniform1iv(location, arrayValue);
|
|
46
|
+
case GL.INT_VEC2: return gl.uniform2iv(location, arrayValue);
|
|
47
|
+
case GL.INT_VEC3: return gl.uniform3iv(location, arrayValue);
|
|
48
|
+
case GL.INT_VEC4: return gl.uniform4iv(location, arrayValue);
|
|
49
|
+
case GL.BOOL: return gl.uniform1iv(location, arrayValue);
|
|
50
|
+
case GL.BOOL_VEC2: return gl.uniform2iv(location, arrayValue);
|
|
51
|
+
case GL.BOOL_VEC3: return gl.uniform3iv(location, arrayValue);
|
|
52
|
+
case GL.BOOL_VEC4: return gl.uniform4iv(location, arrayValue);
|
|
53
|
+
// WEBGL2 - unsigned integers
|
|
54
|
+
case GL.UNSIGNED_INT: return gl2.uniform1uiv(location, arrayValue, 1);
|
|
55
|
+
case GL.UNSIGNED_INT_VEC2: return gl2.uniform2uiv(location, arrayValue, 2);
|
|
56
|
+
case GL.UNSIGNED_INT_VEC3: return gl2.uniform3uiv(location, arrayValue, 3);
|
|
57
|
+
case GL.UNSIGNED_INT_VEC4: return gl2.uniform4uiv(location, arrayValue, 4);
|
|
58
|
+
// WebGL2 - quadratic matrices
|
|
59
|
+
// false: don't transpose the matrix
|
|
60
|
+
case GL.FLOAT_MAT2: return gl.uniformMatrix2fv(location, false, arrayValue);
|
|
61
|
+
case GL.FLOAT_MAT3: return gl.uniformMatrix3fv(location, false, arrayValue);
|
|
62
|
+
case GL.FLOAT_MAT4: return gl.uniformMatrix4fv(location, false, arrayValue);
|
|
63
|
+
// WebGL2 - rectangular matrices
|
|
64
|
+
case GL.FLOAT_MAT2x3: return gl2.uniformMatrix2x3fv(location, false, arrayValue);
|
|
65
|
+
case GL.FLOAT_MAT2x4: return gl2.uniformMatrix2x4fv(location, false, arrayValue);
|
|
66
|
+
case GL.FLOAT_MAT3x2: return gl2.uniformMatrix3x2fv(location, false, arrayValue);
|
|
67
|
+
case GL.FLOAT_MAT3x4: return gl2.uniformMatrix3x4fv(location, false, arrayValue);
|
|
68
|
+
case GL.FLOAT_MAT4x2: return gl2.uniformMatrix4x2fv(location, false, arrayValue);
|
|
69
|
+
case GL.FLOAT_MAT4x3: return gl2.uniformMatrix4x3fv(location, false, arrayValue);
|
|
23
70
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (value === true) {
|
|
27
|
-
value = 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (value === false) {
|
|
31
|
-
value = 1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const arrayValue = typeof value === 'number' ? [value] : value;
|
|
35
|
-
|
|
36
|
-
switch (type) {
|
|
37
|
-
case GL.FLOAT:
|
|
38
|
-
return gl.uniform1fv(location, arrayValue);
|
|
39
|
-
|
|
40
|
-
case GL.FLOAT_VEC2:
|
|
41
|
-
return gl.uniform2fv(location, arrayValue);
|
|
42
|
-
|
|
43
|
-
case GL.FLOAT_VEC3:
|
|
44
|
-
return gl.uniform3fv(location, arrayValue);
|
|
45
|
-
|
|
46
|
-
case GL.FLOAT_VEC4:
|
|
47
|
-
return gl.uniform4fv(location, arrayValue);
|
|
48
|
-
|
|
49
|
-
case GL.INT:
|
|
50
|
-
return gl.uniform1iv(location, arrayValue);
|
|
51
|
-
|
|
52
|
-
case GL.INT_VEC2:
|
|
53
|
-
return gl.uniform2iv(location, arrayValue);
|
|
54
|
-
|
|
55
|
-
case GL.INT_VEC3:
|
|
56
|
-
return gl.uniform3iv(location, arrayValue);
|
|
57
|
-
|
|
58
|
-
case GL.INT_VEC4:
|
|
59
|
-
return gl.uniform4iv(location, arrayValue);
|
|
60
|
-
|
|
61
|
-
case GL.BOOL:
|
|
62
|
-
return gl.uniform1iv(location, arrayValue);
|
|
63
|
-
|
|
64
|
-
case GL.BOOL_VEC2:
|
|
65
|
-
return gl.uniform2iv(location, arrayValue);
|
|
66
|
-
|
|
67
|
-
case GL.BOOL_VEC3:
|
|
68
|
-
return gl.uniform3iv(location, arrayValue);
|
|
69
|
-
|
|
70
|
-
case GL.BOOL_VEC4:
|
|
71
|
-
return gl.uniform4iv(location, arrayValue);
|
|
72
|
-
|
|
73
|
-
case GL.UNSIGNED_INT:
|
|
74
|
-
return gl2.uniform1uiv(location, arrayValue, 1);
|
|
75
|
-
|
|
76
|
-
case GL.UNSIGNED_INT_VEC2:
|
|
77
|
-
return gl2.uniform2uiv(location, arrayValue, 2);
|
|
78
|
-
|
|
79
|
-
case GL.UNSIGNED_INT_VEC3:
|
|
80
|
-
return gl2.uniform3uiv(location, arrayValue, 3);
|
|
81
|
-
|
|
82
|
-
case GL.UNSIGNED_INT_VEC4:
|
|
83
|
-
return gl2.uniform4uiv(location, arrayValue, 4);
|
|
84
|
-
|
|
85
|
-
case GL.FLOAT_MAT2:
|
|
86
|
-
return gl.uniformMatrix2fv(location, false, arrayValue);
|
|
87
|
-
|
|
88
|
-
case GL.FLOAT_MAT3:
|
|
89
|
-
return gl.uniformMatrix3fv(location, false, arrayValue);
|
|
90
|
-
|
|
91
|
-
case GL.FLOAT_MAT4:
|
|
92
|
-
return gl.uniformMatrix4fv(location, false, arrayValue);
|
|
93
|
-
|
|
94
|
-
case GL.FLOAT_MAT2x3:
|
|
95
|
-
return gl2.uniformMatrix2x3fv(location, false, arrayValue);
|
|
96
|
-
|
|
97
|
-
case GL.FLOAT_MAT2x4:
|
|
98
|
-
return gl2.uniformMatrix2x4fv(location, false, arrayValue);
|
|
99
|
-
|
|
100
|
-
case GL.FLOAT_MAT3x2:
|
|
101
|
-
return gl2.uniformMatrix3x2fv(location, false, arrayValue);
|
|
102
|
-
|
|
103
|
-
case GL.FLOAT_MAT3x4:
|
|
104
|
-
return gl2.uniformMatrix3x4fv(location, false, arrayValue);
|
|
105
|
-
|
|
106
|
-
case GL.FLOAT_MAT4x2:
|
|
107
|
-
return gl2.uniformMatrix4x2fv(location, false, arrayValue);
|
|
108
|
-
|
|
109
|
-
case GL.FLOAT_MAT4x3:
|
|
110
|
-
return gl2.uniformMatrix4x3fv(location, false, arrayValue);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
throw new Error('Illegal uniform');
|
|
71
|
+
throw new Error('Illegal uniform');
|
|
114
72
|
}
|
|
115
|
-
//# sourceMappingURL=set-uniform.js.map
|
|
@@ -1,99 +1,94 @@
|
|
|
1
1
|
import GL from '@luma.gl/constants';
|
|
2
|
+
/** Check is uniform is of sampler type */
|
|
2
3
|
export function isSamplerUniform(type) {
|
|
3
|
-
|
|
4
|
+
return SAMPLER_TYPES.includes(type);
|
|
4
5
|
}
|
|
5
|
-
const SAMPLER_TYPES = [
|
|
6
|
+
const SAMPLER_TYPES = [
|
|
7
|
+
GL.SAMPLER_2D,
|
|
8
|
+
GL.SAMPLER_CUBE,
|
|
9
|
+
GL.SAMPLER_3D,
|
|
10
|
+
GL.SAMPLER_2D_SHADOW,
|
|
11
|
+
GL.SAMPLER_2D_ARRAY,
|
|
12
|
+
GL.SAMPLER_2D_ARRAY_SHADOW,
|
|
13
|
+
GL.SAMPLER_CUBE_SHADOW,
|
|
14
|
+
GL.INT_SAMPLER_2D,
|
|
15
|
+
GL.INT_SAMPLER_3D,
|
|
16
|
+
GL.INT_SAMPLER_CUBE,
|
|
17
|
+
GL.INT_SAMPLER_2D_ARRAY,
|
|
18
|
+
GL.UNSIGNED_INT_SAMPLER_2D,
|
|
19
|
+
GL.UNSIGNED_INT_SAMPLER_3D,
|
|
20
|
+
GL.UNSIGNED_INT_SAMPLER_CUBE,
|
|
21
|
+
GL.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
22
|
+
];
|
|
23
|
+
// Composite types table
|
|
6
24
|
const COMPOSITE_GL_TYPES = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
[GL.FLOAT]: [GL.FLOAT, 1, 'float', 'f32', 'float32'],
|
|
26
|
+
[GL.FLOAT_VEC2]: [GL.FLOAT, 2, 'vec2', 'vec2<f32>', 'float32x2'],
|
|
27
|
+
[GL.FLOAT_VEC3]: [GL.FLOAT, 3, 'vec3', 'vec3<f32>', 'float32x3'],
|
|
28
|
+
[GL.FLOAT_VEC4]: [GL.FLOAT, 4, 'vec4', 'vec4<f32>', 'float32x4'],
|
|
29
|
+
[GL.INT]: [GL.INT, 1, 'int', 'i32', 'sint32'],
|
|
30
|
+
[GL.INT_VEC2]: [GL.INT, 2, 'ivec2', 'vec2<i32>', 'sint32x2'],
|
|
31
|
+
[GL.INT_VEC3]: [GL.INT, 3, 'ivec3', 'vec3<i32>', 'sint32x3'],
|
|
32
|
+
[GL.INT_VEC4]: [GL.INT, 4, 'ivec4', 'vec4<i32>', 'sint32x4'],
|
|
33
|
+
[GL.UNSIGNED_INT]: [GL.UNSIGNED_INT, 1, 'uint', 'u32', 'uint32'],
|
|
34
|
+
[GL.UNSIGNED_INT_VEC2]: [GL.UNSIGNED_INT, 2, 'uvec2', 'vec2<u32>', 'uint32x2'],
|
|
35
|
+
[GL.UNSIGNED_INT_VEC3]: [GL.UNSIGNED_INT, 3, 'uvec3', 'vec3<u32>', 'uint32x3'],
|
|
36
|
+
[GL.UNSIGNED_INT_VEC4]: [GL.UNSIGNED_INT, 4, 'uvec4', 'vec4<u32>', 'uint32x4'],
|
|
37
|
+
[GL.BOOL]: [GL.FLOAT, 1, 'bool', 'f32', 'float32x2'],
|
|
38
|
+
[GL.BOOL_VEC2]: [GL.FLOAT, 2, 'bvec2', 'vec2<f32>'],
|
|
39
|
+
[GL.BOOL_VEC3]: [GL.FLOAT, 3, 'bvec3', 'vec3<f32>'],
|
|
40
|
+
[GL.BOOL_VEC4]: [GL.FLOAT, 4, 'bvec4', 'vec4<f32>'],
|
|
41
|
+
[GL.FLOAT_MAT2]: [GL.FLOAT, 8, 'mat2', 'mat2x2<f32>'],
|
|
42
|
+
[GL.FLOAT_MAT2x3]: [GL.FLOAT, 8, 'mat2x3', 'mat2x3<f32>'],
|
|
43
|
+
[GL.FLOAT_MAT2x4]: [GL.FLOAT, 8, 'mat2x4', 'mat2x4<f32>'],
|
|
44
|
+
[GL.FLOAT_MAT3x2]: [GL.FLOAT, 12, 'mat3x2', 'mat3x2<f32>'],
|
|
45
|
+
[GL.FLOAT_MAT3]: [GL.FLOAT, 12, 'mat3', 'mat3x3<f32>'],
|
|
46
|
+
[GL.FLOAT_MAT3x4]: [GL.FLOAT, 12, 'mat3x4', 'mat3x4<f32>'],
|
|
47
|
+
[GL.FLOAT_MAT4x2]: [GL.FLOAT, 16, 'mat4x2', 'mat4x2<f32>'],
|
|
48
|
+
[GL.FLOAT_MAT4x3]: [GL.FLOAT, 16, 'mat4x3', 'mat4x3<f32>'],
|
|
49
|
+
[GL.FLOAT_MAT4]: [GL.FLOAT, 16, 'mat4', 'mat4x4<f32>'] // 16
|
|
32
50
|
};
|
|
51
|
+
/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */
|
|
33
52
|
export function decodeUniformType(uniformType) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const [glType, components,, format] = typeAndSize;
|
|
41
|
-
return {
|
|
42
|
-
format,
|
|
43
|
-
components,
|
|
44
|
-
glType
|
|
45
|
-
};
|
|
53
|
+
const typeAndSize = COMPOSITE_GL_TYPES[uniformType];
|
|
54
|
+
if (!typeAndSize) {
|
|
55
|
+
throw new Error('uniform');
|
|
56
|
+
}
|
|
57
|
+
const [glType, components, , format] = typeAndSize;
|
|
58
|
+
return { format, components, glType };
|
|
46
59
|
}
|
|
47
60
|
export function decodeAttributeType(attributeType) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const [glType, components,,, format] = typeAndSize;
|
|
55
|
-
return {
|
|
56
|
-
format,
|
|
57
|
-
components,
|
|
58
|
-
glType
|
|
59
|
-
};
|
|
61
|
+
const typeAndSize = COMPOSITE_GL_TYPES[attributeType];
|
|
62
|
+
if (!typeAndSize) {
|
|
63
|
+
throw new Error('attribute');
|
|
64
|
+
}
|
|
65
|
+
const [glType, components, , , format] = typeAndSize;
|
|
66
|
+
return { format, components, glType };
|
|
60
67
|
}
|
|
68
|
+
/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */
|
|
61
69
|
export function decomposeCompositeGLType(compositeGLType) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const [type, components] = typeAndSize;
|
|
69
|
-
return {
|
|
70
|
-
type,
|
|
71
|
-
components
|
|
72
|
-
};
|
|
70
|
+
const typeAndSize = COMPOSITE_GL_TYPES[compositeGLType];
|
|
71
|
+
if (!typeAndSize) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const [type, components] = typeAndSize;
|
|
75
|
+
return { type, components };
|
|
73
76
|
}
|
|
74
77
|
export function getCompositeGLType(type, components) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (compType === type && compComponents === components) {
|
|
90
|
-
return {
|
|
91
|
-
glType: Number(glType),
|
|
92
|
-
name
|
|
93
|
-
};
|
|
78
|
+
switch (type) {
|
|
79
|
+
case GL.BYTE:
|
|
80
|
+
case GL.UNSIGNED_BYTE:
|
|
81
|
+
case GL.SHORT:
|
|
82
|
+
case GL.UNSIGNED_SHORT:
|
|
83
|
+
type = GL.FLOAT;
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
}
|
|
87
|
+
for (const glType in COMPOSITE_GL_TYPES) {
|
|
88
|
+
const [compType, compComponents, name] = COMPOSITE_GL_TYPES[glType];
|
|
89
|
+
if (compType === type && compComponents === components) {
|
|
90
|
+
return { glType: Number(glType), name };
|
|
91
|
+
}
|
|
94
92
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return null;
|
|
93
|
+
return null;
|
|
98
94
|
}
|
|
99
|
-
//# sourceMappingURL=uniforms.js.map
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { assert } from '@luma.gl/api';
|
|
2
|
+
// Resolve a WebGL enumeration name (returns itself if already a number)
|
|
2
3
|
export function getKeyValue(gl, name) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
// If not a string, return (assume number)
|
|
5
|
+
if (typeof name !== 'string') {
|
|
6
|
+
return name;
|
|
7
|
+
}
|
|
8
|
+
// If string converts to number, return number
|
|
9
|
+
const number = Number(name);
|
|
10
|
+
if (!isNaN(number)) {
|
|
11
|
+
return number;
|
|
12
|
+
}
|
|
13
|
+
// Look up string, after removing any 'GL.' or 'gl.' prefix
|
|
14
|
+
name = name.replace(/^.*\./, '');
|
|
15
|
+
// @ts-ignore expect-error depends on settings
|
|
16
|
+
const value = gl[name];
|
|
17
|
+
assert(value !== undefined, `Accessing undefined constant GL.${name}`);
|
|
18
|
+
return value;
|
|
17
19
|
}
|
|
18
20
|
export function getKey(gl, value) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
// @ts-ignore expect-error depends on settings
|
|
22
|
+
gl = gl.gl || gl;
|
|
23
|
+
value = Number(value);
|
|
24
|
+
for (const key in gl) {
|
|
25
|
+
// @ts-ignore expect-error depends on settings
|
|
26
|
+
if (gl[key] === value) {
|
|
27
|
+
return `GL.${key}`;
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return String(value);
|
|
30
|
+
return String(value);
|
|
29
31
|
}
|
|
30
32
|
export function getKeyType(gl, value) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
assert(value !== undefined, 'undefined key');
|
|
34
|
+
value = Number(value);
|
|
35
|
+
for (const key in gl) {
|
|
36
|
+
// @ts-ignore expect-error depends on settings
|
|
37
|
+
if (gl[key] === value) {
|
|
38
|
+
return `GL.${key}`;
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return String(value);
|
|
41
|
+
return String(value);
|
|
41
42
|
}
|
|
42
|
-
//# sourceMappingURL=constants-to-keys.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResourceProps } from '@luma.gl/api';
|
|
2
2
|
import WebGLDevice from '../webgl-device';
|
|
3
3
|
import WebGLResource from './webgl-resource';
|
|
4
|
-
export
|
|
4
|
+
export type RenderbufferProps = ResourceProps & {
|
|
5
5
|
format: number;
|
|
6
6
|
width?: number;
|
|
7
7
|
height?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-renderbuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-renderbuffer.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,aAAa,EAAC,MAAM,cAAc,CAAC;AAEnD,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAK7C,
|
|
1
|
+
{"version":3,"file":"webgl-renderbuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-renderbuffer.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,aAAa,EAAC,MAAM,cAAc,CAAC;AAEnD,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAK7C,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAYF;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IAC9E,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAA2B;IAErE,IAAI,KAAK,IAAI,MAAM,CAA6B;IAChD,IAAI,MAAM,IAAI,MAAM,CAA8B;IAClD,IAAI,MAAM,IAAI,MAAM,CAA+B;IACnD,IAAI,OAAO,IAAI,MAAM,CAA+B;IAEpD,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO;gBAIvE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,iBAAiB;IAKzD,MAAM,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI;IAWnD,iEAAiE;IACjE,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IA0B/C,aAAa;IAIb,aAAa,IAAI,IAAI;IAKrB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAGtD"}
|