@luma.gl/webgl 9.0.0-alpha.3 → 9.0.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -1
- package/dist/adapter/converters/device-parameters.d.ts +14 -4
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +28 -46
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.d.ts +5 -5
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +20 -56
- package/dist/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/adapter/converters/texture-formats.d.ts +31 -42
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +163 -178
- package/dist/adapter/converters/texture-formats.js.map +1 -1
- package/dist/adapter/converters/vertex-formats.d.ts +2 -2
- package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +3 -9
- package/dist/adapter/converters/vertex-formats.js.map +1 -1
- package/dist/adapter/device-helpers/device-features.d.ts +1 -1
- package/dist/adapter/device-helpers/device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +13 -20
- package/dist/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/adapter/device-helpers/device-limits.d.ts +3 -3
- package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +2 -5
- package/dist/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.d.ts +1 -1
- package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.js +9 -11
- package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/adapter/device-helpers/is-old-ie.js +2 -1
- package/dist/adapter/device-helpers/is-old-ie.js.map +1 -1
- package/dist/adapter/helpers/attribute-utils.d.ts +4 -4
- package/dist/adapter/helpers/attribute-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/attribute-utils.js +1 -18
- package/dist/adapter/helpers/attribute-utils.js.map +1 -1
- package/dist/adapter/helpers/get-shader-info.d.ts +9 -0
- package/dist/adapter/helpers/get-shader-info.d.ts.map +1 -0
- package/dist/adapter/helpers/get-shader-info.js +25 -0
- package/dist/adapter/helpers/get-shader-info.js.map +1 -0
- package/dist/adapter/helpers/get-shader-layout.d.ts +10 -7
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +101 -84
- package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js +0 -7
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts +2 -2
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +3 -33
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/uniforms.d.ts +9 -10
- package/dist/adapter/helpers/uniforms.d.ts.map +1 -1
- package/dist/adapter/helpers/uniforms.js +8 -18
- package/dist/adapter/helpers/uniforms.js.map +1 -1
- package/dist/adapter/objects/constants-to-keys.d.ts +1 -3
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
- package/dist/adapter/objects/constants-to-keys.js +1 -28
- package/dist/adapter/objects/constants-to-keys.js.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.d.ts +15 -12
- package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +35 -41
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/adapter/objects/webgl-resource.d.ts +6 -9
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +19 -75
- package/dist/adapter/objects/webgl-resource.js.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts +38 -11
- package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-vertex-array-object.js +122 -32
- package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts +18 -10
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +43 -71
- package/dist/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.d.ts +15 -9
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +169 -41
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.d.ts +7 -6
- package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.js +8 -17
- package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
- package/dist/adapter/resources/webgl-external-texture.js.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts +21 -24
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +41 -149
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts +19 -4
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +88 -9
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +44 -11
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +90 -152
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-sampler.d.ts +6 -5
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +7 -15
- package/dist/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/adapter/resources/webgl-shader.d.ts +3 -4
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +9 -22
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +64 -44
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +98 -213
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/webgl-canvas-context.d.ts +6 -7
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +8 -20
- package/dist/adapter/webgl-canvas-context.js.map +1 -1
- package/dist/adapter/webgl-device.d.ts +64 -41
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +133 -113
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/classic/accessor.d.ts +3 -3
- package/dist/classic/accessor.d.ts.map +1 -1
- package/dist/classic/accessor.js +14 -38
- package/dist/classic/accessor.js.map +1 -1
- package/dist/classic/{buffer.d.ts → buffer-with-accessor.d.ts} +16 -28
- package/dist/classic/buffer-with-accessor.d.ts.map +1 -0
- package/dist/classic/{buffer.js → buffer-with-accessor.js} +54 -122
- package/dist/classic/buffer-with-accessor.js.map +1 -0
- package/dist/classic/clear.d.ts +22 -0
- package/dist/classic/clear.d.ts.map +1 -0
- package/dist/classic/clear.js +88 -0
- package/dist/classic/clear.js.map +1 -0
- package/dist/classic/copy-and-blit.d.ts +62 -0
- package/dist/classic/copy-and-blit.d.ts.map +1 -0
- package/dist/classic/copy-and-blit.js +202 -0
- package/dist/classic/copy-and-blit.js.map +1 -0
- package/dist/classic/format-utils.d.ts +3 -0
- package/dist/classic/format-utils.d.ts.map +1 -0
- package/dist/classic/format-utils.js +38 -0
- package/dist/classic/format-utils.js.map +1 -0
- package/dist/classic/typed-array-utils.d.ts +15 -17
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +1 -21
- package/dist/classic/typed-array-utils.js.map +1 -1
- package/dist/context/context/create-browser-context.d.ts +40 -0
- package/dist/context/context/create-browser-context.d.ts.map +1 -0
- package/dist/{esm/context/context/create-context.js → context/context/create-browser-context.js} +23 -19
- package/dist/context/context/create-browser-context.js.map +1 -0
- package/dist/context/context/create-headless-context.d.ts +9 -0
- package/dist/context/context/create-headless-context.d.ts.map +1 -0
- package/dist/context/context/create-headless-context.js +42 -0
- package/dist/context/context/create-headless-context.js.map +1 -0
- package/dist/context/context/webgl-checks.js +1 -4
- package/dist/context/context/webgl-checks.js.map +1 -1
- package/dist/context/debug/spector.d.ts +1 -2
- package/dist/context/debug/spector.d.ts.map +1 -1
- package/dist/context/debug/spector.js +8 -20
- package/dist/context/debug/spector.js.map +1 -1
- package/dist/context/debug/webgl-developer-tools.d.ts +2 -2
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +11 -34
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/parameters/unified-parameter-api.d.ts +8 -7
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +8 -18
- package/dist/context/parameters/unified-parameter-api.js.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.d.ts +105 -106
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +18 -36
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/context/polyfill/context-data.d.ts +13 -0
- package/dist/context/polyfill/context-data.d.ts.map +1 -0
- package/dist/context/polyfill/context-data.js +12 -0
- package/dist/context/polyfill/context-data.js.map +1 -0
- package/dist/context/polyfill/get-parameter-polyfill.d.ts +1 -1
- package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +1 -1
- package/dist/context/polyfill/get-parameter-polyfill.js +4 -9
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/context/polyfill/polyfill-context.js +21 -29
- package/dist/context/polyfill/polyfill-context.js.map +1 -1
- package/dist/context/polyfill/polyfill-table.d.ts +8 -8
- package/dist/context/polyfill/polyfill-table.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-table.js +10 -32
- package/dist/context/polyfill/polyfill-table.js.map +1 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +1 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +0 -70
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
- package/dist/context/state-tracker/deep-array-equal.js +0 -4
- package/dist/context/state-tracker/deep-array-equal.js.map +1 -1
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +16 -51
- package/dist/context/state-tracker/track-context-state.js.map +1 -1
- package/dist/context/state-tracker/with-parameters.d.ts +2 -1
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +7 -9
- package/dist/context/state-tracker/with-parameters.js.map +1 -1
- package/dist/dist.dev.js +10158 -0
- package/dist/index.cjs +6604 -0
- package/dist/index.d.ts +25 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -26
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist.min.js +37 -0
- package/package.json +21 -9
- package/src/adapter/converters/device-parameters.ts +88 -35
- package/src/adapter/converters/sampler-parameters.ts +19 -9
- package/src/adapter/converters/texture-formats.ts +261 -178
- package/src/adapter/converters/vertex-formats.ts +3 -2
- package/src/adapter/device-helpers/device-features.ts +10 -3
- package/src/adapter/device-helpers/device-limits.ts +3 -3
- package/src/adapter/device-helpers/get-device-info.ts +14 -10
- package/src/adapter/helpers/attribute-utils.ts +4 -5
- package/src/adapter/helpers/get-shader-info.ts +40 -0
- package/src/adapter/helpers/get-shader-layout.ts +150 -68
- package/src/adapter/helpers/parse-shader-compiler-log.ts +2 -2
- package/src/adapter/helpers/set-uniform.ts +7 -6
- package/src/adapter/helpers/uniforms.ts +23 -13
- package/src/adapter/objects/constants-to-keys.ts +3 -25
- package/src/adapter/objects/webgl-renderbuffer.ts +40 -37
- package/src/adapter/objects/webgl-resource.ts +14 -23
- package/src/adapter/objects/webgl-vertex-array-object.ts +201 -37
- package/src/adapter/resources/webgl-buffer.ts +56 -58
- package/src/adapter/resources/webgl-command-buffer.ts +332 -25
- package/src/adapter/resources/webgl-command-encoder.ts +16 -11
- package/src/adapter/resources/webgl-external-texture.ts +2 -2
- package/src/adapter/resources/webgl-framebuffer.ts +88 -133
- package/src/adapter/resources/webgl-render-pass.ts +155 -4
- package/src/adapter/resources/webgl-render-pipeline.ts +161 -104
- package/src/adapter/resources/webgl-sampler.ts +13 -8
- package/src/adapter/resources/webgl-shader.ts +11 -10
- package/src/adapter/resources/webgl-texture.ts +113 -85
- package/src/adapter/webgl-canvas-context.ts +14 -14
- package/src/adapter/webgl-device.ts +192 -77
- package/src/classic/accessor.ts +4 -17
- package/src/classic/{buffer.ts → buffer-with-accessor.ts} +67 -75
- package/src/classic/clear.ts +110 -0
- package/src/classic/copy-and-blit.ts +308 -0
- package/src/classic/format-utils.ts +43 -0
- package/src/classic/typed-array-utils.ts +18 -27
- package/src/context/context/{create-context.ts → create-browser-context.ts} +48 -31
- package/src/context/context/create-headless-context.ts +48 -0
- package/src/context/context/webgl-checks.ts +1 -1
- package/src/context/debug/spector.ts +7 -6
- package/src/context/debug/webgl-developer-tools.ts +21 -15
- package/src/context/parameters/unified-parameter-api.ts +20 -14
- package/src/context/parameters/webgl-parameter-tables.ts +117 -98
- package/src/context/polyfill/context-data.ts +27 -0
- package/src/context/polyfill/get-parameter-polyfill.ts +8 -7
- package/src/context/polyfill/polyfill-context.ts +7 -9
- package/src/context/polyfill/polyfill-table.ts +18 -16
- package/src/context/polyfill/polyfill-vertex-array-object.ts +2 -0
- package/src/context/state-tracker/track-context-state.ts +14 -13
- package/src/context/state-tracker/with-parameters.ts +8 -2
- package/src/index.ts +42 -33
- package/dist/adapter/converters/renderbuffer-formats.d.ts +0 -16
- package/dist/adapter/converters/renderbuffer-formats.d.ts.map +0 -1
- package/dist/adapter/converters/renderbuffer-formats.js +0 -185
- package/dist/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/bundle.js.map +0 -1
- package/dist/classic/buffer.d.ts.map +0 -1
- package/dist/classic/buffer.js.map +0 -1
- package/dist/context/context/context-state.d.ts +0 -18
- package/dist/context/context/context-state.d.ts.map +0 -1
- package/dist/context/context/context-state.js +0 -26
- package/dist/context/context/context-state.js.map +0 -1
- package/dist/context/context/create-context.d.ts +0 -41
- package/dist/context/context/create-context.d.ts.map +0 -1
- package/dist/context/context/create-context.js +0 -49
- package/dist/context/context/create-context.js.map +0 -1
- package/dist/context/context/device-pixels.d.ts +0 -25
- package/dist/context/context/device-pixels.d.ts.map +0 -1
- package/dist/context/context/device-pixels.js +0 -98
- package/dist/context/context/device-pixels.js.map +0 -1
- package/dist/es5/adapter/converters/device-parameters.js +0 -170
- package/dist/es5/adapter/converters/device-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/renderbuffer-formats.js +0 -163
- package/dist/es5/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/es5/adapter/converters/sampler-parameters.js +0 -226
- package/dist/es5/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/es5/adapter/converters/texture-formats.js +0 -1031
- package/dist/es5/adapter/converters/texture-formats.js.map +0 -1
- package/dist/es5/adapter/converters/vertex-formats.js +0 -45
- package/dist/es5/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/es5/adapter/device-helpers/device-features.js +0 -144
- package/dist/es5/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/es5/adapter/device-helpers/device-limits.js +0 -64
- package/dist/es5/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/es5/adapter/device-helpers/get-device-info.js +0 -55
- package/dist/es5/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/es5/adapter/device-helpers/is-old-ie.js +0 -16
- package/dist/es5/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/es5/adapter/helpers/attribute-utils.js +0 -91
- package/dist/es5/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/es5/adapter/helpers/get-shader-layout.js +0 -371
- package/dist/es5/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js +0 -72
- package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/es5/adapter/helpers/set-uniform.js +0 -125
- package/dist/es5/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/es5/adapter/helpers/uniforms.js +0 -112
- package/dist/es5/adapter/helpers/uniforms.js.map +0 -1
- package/dist/es5/adapter/objects/constants-to-keys.js +0 -54
- package/dist/es5/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-renderbuffer.js +0 -150
- package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-resource.js +0 -292
- package/dist/es5/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js +0 -137
- package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-buffer.js +0 -243
- package/dist/es5/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-command-buffer.js +0 -96
- package/dist/es5/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-command-encoder.js +0 -98
- package/dist/es5/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-external-texture.js +0 -2
- package/dist/es5/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-framebuffer.js +0 -345
- package/dist/es5/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pass.js +0 -61
- package/dist/es5/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-render-pipeline.js +0 -505
- package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-sampler.js +0 -96
- package/dist/es5/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-shader.js +0 -149
- package/dist/es5/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/es5/adapter/resources/webgl-texture.js +0 -986
- package/dist/es5/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/es5/adapter/webgl-canvas-context.js +0 -97
- package/dist/es5/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/es5/adapter/webgl-device.js +0 -399
- package/dist/es5/adapter/webgl-device.js.map +0 -1
- package/dist/es5/bundle.js +0 -7
- package/dist/es5/bundle.js.map +0 -1
- package/dist/es5/classic/accessor.js +0 -181
- package/dist/es5/classic/accessor.js.map +0 -1
- package/dist/es5/classic/buffer.js +0 -470
- package/dist/es5/classic/buffer.js.map +0 -1
- package/dist/es5/classic/typed-array-utils.js +0 -126
- package/dist/es5/classic/typed-array-utils.js.map +0 -1
- package/dist/es5/context/context/context-state.js +0 -31
- package/dist/es5/context/context/context-state.js.map +0 -1
- package/dist/es5/context/context/create-context.js +0 -69
- package/dist/es5/context/context/create-context.js.map +0 -1
- package/dist/es5/context/context/device-pixels.js +0 -115
- package/dist/es5/context/context/device-pixels.js.map +0 -1
- package/dist/es5/context/context/webgl-checks.js +0 -54
- package/dist/es5/context/context/webgl-checks.js.map +0 -1
- package/dist/es5/context/debug/spector.js +0 -133
- package/dist/es5/context/debug/spector.js.map +0 -1
- package/dist/es5/context/debug/webgl-developer-tools.js +0 -198
- package/dist/es5/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/es5/context/parameters/unified-parameter-api.js +0 -97
- package/dist/es5/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/es5/context/parameters/webgl-parameter-tables.js +0 -392
- package/dist/es5/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/es5/context/polyfill/get-parameter-polyfill.js +0 -81
- package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-context.js +0 -135
- package/dist/es5/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-table.js +0 -166
- package/dist/es5/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js +0 -341
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/es5/context/state-tracker/deep-array-equal.js +0 -28
- package/dist/es5/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/es5/context/state-tracker/track-context-state.js +0 -211
- package/dist/es5/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/es5/context/state-tracker/with-parameters.js +0 -44
- package/dist/es5/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/es5/index.js +0 -276
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/init.js +0 -10
- package/dist/es5/init.js.map +0 -1
- package/dist/es5/types/webgl.js +0 -6
- package/dist/es5/types/webgl.js.map +0 -1
- package/dist/es5/types.js +0 -2
- package/dist/es5/types.js.map +0 -1
- package/dist/esm/adapter/converters/device-parameters.js +0 -155
- package/dist/esm/adapter/converters/device-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/renderbuffer-formats.js +0 -185
- package/dist/esm/adapter/converters/renderbuffer-formats.js.map +0 -1
- package/dist/esm/adapter/converters/sampler-parameters.js +0 -208
- package/dist/esm/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/esm/adapter/converters/texture-formats.js +0 -954
- package/dist/esm/adapter/converters/texture-formats.js.map +0 -1
- package/dist/esm/adapter/converters/vertex-formats.js +0 -35
- package/dist/esm/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/esm/adapter/device-helpers/device-features.js +0 -102
- package/dist/esm/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/esm/adapter/device-helpers/device-limits.js +0 -91
- package/dist/esm/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/esm/adapter/device-helpers/get-device-info.js +0 -44
- package/dist/esm/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/esm/adapter/device-helpers/is-old-ie.js +0 -8
- package/dist/esm/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/esm/adapter/helpers/attribute-utils.js +0 -81
- package/dist/esm/adapter/helpers/attribute-utils.js.map +0 -1
- package/dist/esm/adapter/helpers/get-shader-layout.js +0 -306
- package/dist/esm/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js +0 -37
- package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/esm/adapter/helpers/set-uniform.js +0 -115
- package/dist/esm/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/esm/adapter/helpers/uniforms.js +0 -99
- package/dist/esm/adapter/helpers/uniforms.js.map +0 -1
- package/dist/esm/adapter/objects/constants-to-keys.js +0 -42
- package/dist/esm/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-renderbuffer.js +0 -94
- package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-resource.js +0 -216
- package/dist/esm/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js +0 -84
- package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-buffer.js +0 -164
- package/dist/esm/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-command-buffer.js +0 -65
- package/dist/esm/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-command-encoder.js +0 -53
- package/dist/esm/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-external-texture.js +0 -2
- package/dist/esm/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-framebuffer.js +0 -265
- package/dist/esm/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-render-pass.js +0 -19
- package/dist/esm/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-render-pipeline.js +0 -400
- package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-sampler.js +0 -50
- package/dist/esm/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-shader.js +0 -75
- package/dist/esm/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/esm/adapter/resources/webgl-texture.js +0 -831
- package/dist/esm/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/esm/adapter/webgl-canvas-context.js +0 -54
- package/dist/esm/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/esm/adapter/webgl-device.js +0 -280
- package/dist/esm/adapter/webgl-device.js.map +0 -1
- package/dist/esm/bundle.js +0 -5
- package/dist/esm/bundle.js.map +0 -1
- package/dist/esm/classic/accessor.js +0 -144
- package/dist/esm/classic/accessor.js.map +0 -1
- package/dist/esm/classic/buffer.js +0 -384
- package/dist/esm/classic/buffer.js.map +0 -1
- package/dist/esm/classic/typed-array-utils.js +0 -112
- package/dist/esm/classic/typed-array-utils.js.map +0 -1
- package/dist/esm/context/context/context-state.js +0 -26
- package/dist/esm/context/context/context-state.js.map +0 -1
- package/dist/esm/context/context/create-context.js.map +0 -1
- package/dist/esm/context/context/device-pixels.js +0 -98
- package/dist/esm/context/context/device-pixels.js.map +0 -1
- package/dist/esm/context/context/webgl-checks.js +0 -34
- package/dist/esm/context/context/webgl-checks.js.map +0 -1
- package/dist/esm/context/debug/spector.js +0 -76
- package/dist/esm/context/debug/spector.js.map +0 -1
- package/dist/esm/context/debug/webgl-developer-tools.js +0 -121
- package/dist/esm/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/esm/context/parameters/unified-parameter-api.js +0 -65
- package/dist/esm/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/esm/context/parameters/webgl-parameter-tables.js +0 -445
- package/dist/esm/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/esm/context/polyfill/get-parameter-polyfill.js +0 -91
- package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-context.js +0 -92
- package/dist/esm/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-table.js +0 -160
- package/dist/esm/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js +0 -335
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/esm/context/state-tracker/deep-array-equal.js +0 -21
- package/dist/esm/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/esm/context/state-tracker/track-context-state.js +0 -183
- package/dist/esm/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/esm/context/state-tracker/with-parameters.js +0 -36
- package/dist/esm/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/esm/index.js +0 -27
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/init.js +0 -4
- package/dist/esm/init.js.map +0 -1
- package/dist/esm/types/webgl.js +0 -2
- package/dist/esm/types/webgl.js.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
- package/dist/init.d.ts +0 -2
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -4
- package/dist/init.js.map +0 -1
- package/dist/types/webgl.d.ts +0 -144
- package/dist/types/webgl.d.ts.map +0 -1
- package/dist/types/webgl.js +0 -2
- package/dist/types/webgl.js.map +0 -1
- package/src/adapter/converters/renderbuffer-formats.ts +0 -92
- package/src/bundle.ts +0 -4
- package/src/context/context/context-state.ts +0 -41
- package/src/context/context/device-pixels.ts +0 -152
- package/src/init.ts +0 -4
- package/src/types/webgl.ts +0 -283
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// Provides a function that enables simple checking of which WebGL features are
|
|
3
3
|
// available in an WebGL1 or WebGL2 environment.
|
|
4
4
|
|
|
5
|
-
import {DeviceFeature} from '@luma.gl/
|
|
6
|
-
import GL from '@luma.gl/constants';
|
|
5
|
+
import {DeviceFeature} from '@luma.gl/core';
|
|
7
6
|
import {isWebGL2} from '../../context/context/webgl-checks';
|
|
8
7
|
import {isOldIE} from './is-old-ie';
|
|
9
8
|
import {getTextureFeatures, _checkFloat32ColorAttachment} from '../converters/texture-formats';
|
|
@@ -47,7 +46,12 @@ export function getWebGLFeatures(gl: WebGLRenderingContext): Set<DeviceFeature>
|
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
function isFeatureSupported(gl: WebGLRenderingContext, feature: DeviceFeature): boolean {
|
|
50
|
-
const
|
|
49
|
+
const featureInfo = WEBGL_FEATURES[feature];
|
|
50
|
+
if (!featureInfo) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const [webgl1Feature, webgl2Feature] = featureInfo || [];
|
|
51
55
|
|
|
52
56
|
// Get extension name from table
|
|
53
57
|
const featureDefinition = isWebGL2(gl) ? webgl2Feature : webgl1Feature;
|
|
@@ -100,6 +104,9 @@ export function canCompileGLSLExtension(gl: WebGLRenderingContext, extensionName
|
|
|
100
104
|
const source = `#extension GL_${extensionName} : ${behavior}\nvoid main(void) {}`;
|
|
101
105
|
|
|
102
106
|
const shader = gl.createShader(gl.VERTEX_SHADER);
|
|
107
|
+
if (!shader) {
|
|
108
|
+
throw new Error('shader');
|
|
109
|
+
}
|
|
103
110
|
gl.shaderSource(shader, source);
|
|
104
111
|
gl.compileShader(shader);
|
|
105
112
|
const canCompile = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// luma.gl, MIT license
|
|
2
|
-
import type {DeviceLimits} from '@luma.gl/
|
|
3
|
-
import GL from '@luma.gl/constants';
|
|
2
|
+
import type {DeviceLimits} from '@luma.gl/core';
|
|
3
|
+
import {GL} from '@luma.gl/constants';
|
|
4
4
|
import {getWebGL2Context} from '../../context/context/webgl-checks';
|
|
5
5
|
|
|
6
6
|
/** Populate a WebGPU style device limits */
|
|
7
7
|
export function getDeviceLimits(gl: WebGLRenderingContext): DeviceLimits {
|
|
8
|
-
const gl2: WebGL2RenderingContext = getWebGL2Context(gl);
|
|
8
|
+
const gl2: WebGL2RenderingContext | null = getWebGL2Context(gl);
|
|
9
9
|
return {
|
|
10
10
|
maxTextureDimension1D: 0, // WebGL does not support 1D textures
|
|
11
11
|
maxTextureDimension2D: gl.getParameter(GL.MAX_TEXTURE_SIZE),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {DeviceInfo} from '@luma.gl/
|
|
2
|
-
import GL from '@luma.gl/constants';
|
|
1
|
+
import {DeviceInfo} from '@luma.gl/core';
|
|
2
|
+
import {GL} from '@luma.gl/constants';
|
|
3
3
|
import {isWebGL2} from '../../context/context/webgl-checks';
|
|
4
4
|
|
|
5
5
|
/** @returns strings identifying the GPU vendor and driver. */
|
|
@@ -27,23 +27,27 @@ export function getDeviceInfo(gl: WebGLRenderingContext): DeviceInfo {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function identifyGPUVendor(vendor: string, renderer: string): 'nvidia' | 'intel' | 'apple' | 'amd' | 'unknown' {
|
|
31
|
-
if (
|
|
30
|
+
function identifyGPUVendor(vendor: string, renderer: string): 'nvidia' | 'intel' | 'apple' | 'amd' | 'software' | 'unknown' {
|
|
31
|
+
if ((/NVIDIA/i.exec(vendor)) || (/NVIDIA/i.exec(renderer))) {
|
|
32
32
|
return 'nvidia';
|
|
33
33
|
}
|
|
34
|
-
if (
|
|
34
|
+
if ((/INTEL/i.exec(vendor)) || (/INTEL/i.exec(renderer))) {
|
|
35
35
|
return 'intel';
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if ((/Apple/i.exec(vendor)) || (/Apple/i.exec(renderer))) {
|
|
38
38
|
return 'apple';
|
|
39
39
|
}
|
|
40
40
|
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
(/AMD/i.exec(vendor)) ||
|
|
42
|
+
(/AMD/i.exec(renderer)) ||
|
|
43
|
+
(/ATI/i.exec(vendor)) ||
|
|
44
|
+
(/ATI/i.exec(renderer))
|
|
45
45
|
) {
|
|
46
46
|
return 'amd';
|
|
47
47
|
}
|
|
48
|
+
if ((/SwiftShader/i.exec(vendor)) || (/SwiftShader/i.exec(renderer))) {
|
|
49
|
+
return 'software';
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
return 'unknown';
|
|
49
53
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import GL from '@luma.gl/constants';
|
|
2
|
-
import {GLDrawMode, GLPrimitive} from '../../types/webgl';
|
|
1
|
+
import {GL, GLPrimitiveTopology, GLPrimitive} from '@luma.gl/constants';
|
|
3
2
|
|
|
4
3
|
// Counts the number of complete primitives given a number of vertices and a drawMode
|
|
5
|
-
export function getPrimitiveDrawMode(drawMode:
|
|
4
|
+
export function getPrimitiveDrawMode(drawMode: GLPrimitiveTopology): GLPrimitive {
|
|
6
5
|
switch (drawMode) {
|
|
7
6
|
case GL.POINTS:
|
|
8
7
|
return GL.POINTS;
|
|
@@ -24,7 +23,7 @@ export function getPrimitiveDrawMode(drawMode: GLDrawMode): GLPrimitive {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
// Counts the number of complete "primitives" given a number of vertices and a drawMode
|
|
27
|
-
export function getPrimitiveCount(options: {drawMode:
|
|
26
|
+
export function getPrimitiveCount(options: {drawMode: GLPrimitiveTopology, vertexCount: number}): number {
|
|
28
27
|
const {drawMode, vertexCount} = options;
|
|
29
28
|
switch (drawMode) {
|
|
30
29
|
case GL.POINTS:
|
|
@@ -45,7 +44,7 @@ export function getPrimitiveCount(options: {drawMode: GLDrawMode, vertexCount: n
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
// Counts the number of vertices after splitting the vertex stream into separate "primitives"
|
|
48
|
-
export function getVertexCount(options: {drawMode:
|
|
47
|
+
export function getVertexCount(options: {drawMode: GLPrimitiveTopology, vertexCount: number}): number {
|
|
49
48
|
const {drawMode, vertexCount} = options;
|
|
50
49
|
const primitiveCount = getPrimitiveCount({drawMode, vertexCount});
|
|
51
50
|
switch (getPrimitiveDrawMode(drawMode)) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
|
|
3
|
+
// Note: This was the only dependency that made @luma.gl/webgl depend on @luma.gl/shadertools
|
|
4
|
+
// This file was coped from shadertools to avoid the dependency
|
|
5
|
+
|
|
6
|
+
/** Information extracted from shader source code */
|
|
7
|
+
export type ShaderInfo = {
|
|
8
|
+
name: string;
|
|
9
|
+
language: 'glsl' | 'wgsl';
|
|
10
|
+
version: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** Extracts information from shader source code */
|
|
14
|
+
export function getShaderInfo(source: string, defaultName?: string): ShaderInfo {
|
|
15
|
+
return {
|
|
16
|
+
name: getShaderName(source, defaultName),
|
|
17
|
+
language: 'glsl',
|
|
18
|
+
version: getShaderVersion(source)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Extracts GLSLIFY style naming of shaders: `#define SHADER_NAME ...` */
|
|
23
|
+
function getShaderName(shader: string, defaultName: string = 'unnamed'): string {
|
|
24
|
+
const SHADER_NAME_REGEXP = /#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/;
|
|
25
|
+
const match = SHADER_NAME_REGEXP.exec(shader);
|
|
26
|
+
return match ? match[1] : defaultName;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** returns GLSL shader version of given shader string */
|
|
30
|
+
function getShaderVersion(source: string): number {
|
|
31
|
+
let version = 100;
|
|
32
|
+
const words = source.match(/[^\s]+/g);
|
|
33
|
+
if (words && words.length >= 2 && words[0] === '#version') {
|
|
34
|
+
const v = parseInt(words[1], 10);
|
|
35
|
+
if (Number.isFinite(v)) {
|
|
36
|
+
version = v;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return version;
|
|
40
|
+
}
|
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
|
|
3
|
+
import type {
|
|
2
4
|
ShaderLayout,
|
|
3
|
-
|
|
5
|
+
AttributeLayout,
|
|
4
6
|
UniformBinding,
|
|
5
7
|
UniformBlockBinding,
|
|
6
|
-
ProgramBindings,
|
|
7
8
|
AttributeBinding,
|
|
8
9
|
VaryingBinding,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
AccessorObject,
|
|
11
|
+
BufferMapping,
|
|
12
|
+
VertexFormat
|
|
13
|
+
} from '@luma.gl/core';
|
|
14
|
+
import {log} from '@luma.gl/core';
|
|
15
|
+
import {GL} from '@luma.gl/constants';
|
|
13
16
|
import {isWebGL2} from '../../context/context/webgl-checks';
|
|
14
|
-
import Accessor from '../../classic/accessor'; // TODO - should NOT depend on classic API
|
|
17
|
+
import {Accessor} from '../../classic/accessor'; // TODO - should NOT depend on classic API
|
|
15
18
|
import {decodeUniformType, decodeAttributeType} from './uniforms';
|
|
16
19
|
import {getVertexFormat} from '../converters/vertex-formats';
|
|
17
20
|
import {isSamplerUniform} from './uniforms';
|
|
21
|
+
|
|
18
22
|
/**
|
|
19
23
|
* Extract metadata describing binding information for a program's shaders
|
|
20
24
|
* Note: `linkProgram()` needs to have been called
|
|
21
25
|
* (although linking does not need to have been successful).
|
|
22
26
|
*/
|
|
23
27
|
export function getShaderLayout(gl: WebGLRenderingContext, program: WebGLProgram): ShaderLayout {
|
|
24
|
-
const programBindings = getProgramBindings(gl, program);
|
|
25
|
-
|
|
26
28
|
const shaderLayout: ShaderLayout = {
|
|
27
29
|
attributes: [],
|
|
28
30
|
bindings: []
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
const attributes: AttributeBinding[] = readAttributeBindings(gl, program);
|
|
34
|
+
for (const attribute of attributes) {
|
|
35
|
+
// TODO - multicolumn attributes like a matrix4 can be up to 16 elts...
|
|
36
|
+
const size = Math.min(attribute.accessor.size, 4);
|
|
32
37
|
const format =
|
|
33
38
|
// attribute.accessor.format ||
|
|
34
|
-
getVertexFormat(attribute.accessor.type || GL.FLOAT,
|
|
39
|
+
getVertexFormat(attribute.accessor.type || GL.FLOAT, size);
|
|
35
40
|
shaderLayout.attributes.push({
|
|
36
41
|
name: attribute.name,
|
|
37
42
|
location: attribute.location,
|
|
@@ -41,8 +46,9 @@ export function getShaderLayout(gl: WebGLRenderingContext, program: WebGLProgram
|
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
// Uniform blocks
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
const uniformBlocks: UniformBlockBinding[] = readUniformBlocks(gl, program);
|
|
50
|
+
for (const uniformBlock of uniformBlocks) {
|
|
51
|
+
const uniforms = uniformBlock.uniforms.map(uniform => ({
|
|
46
52
|
name: uniform.name,
|
|
47
53
|
format: uniform.format,
|
|
48
54
|
byteOffset: uniform.byteOffset,
|
|
@@ -59,8 +65,9 @@ export function getShaderLayout(gl: WebGLRenderingContext, program: WebGLProgram
|
|
|
59
65
|
});
|
|
60
66
|
}
|
|
61
67
|
|
|
68
|
+
const uniforms: UniformBinding[] = readUniformBindings(gl, program);
|
|
62
69
|
let textureUnit = 0;
|
|
63
|
-
for (const uniform of
|
|
70
|
+
for (const uniform of uniforms) {
|
|
64
71
|
if (isSamplerUniform(uniform.type)) {
|
|
65
72
|
const {viewDimension, sampleType} = getSamplerInfo(uniform.type);
|
|
66
73
|
shaderLayout.bindings.push({
|
|
@@ -77,38 +84,95 @@ export function getShaderLayout(gl: WebGLRenderingContext, program: WebGLProgram
|
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
|
|
80
|
-
const uniforms = programBindings.uniforms?.filter((uniform) => uniform.location !== null) || [];
|
|
81
87
|
if (uniforms.length) {
|
|
82
88
|
shaderLayout.uniforms = uniforms;
|
|
83
89
|
}
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
|
|
91
|
+
// Varyings
|
|
92
|
+
const varyings: VaryingBinding[] = readVaryings(gl, program);
|
|
93
|
+
// Note - samplers are always in unform bindings, even if uniform blocks are used
|
|
94
|
+
if (varyings?.length) {
|
|
95
|
+
shaderLayout.varyings = varyings;
|
|
86
96
|
}
|
|
87
97
|
|
|
88
98
|
return shaderLayout;
|
|
89
99
|
}
|
|
90
100
|
|
|
91
101
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
102
|
+
* Merges an provided shader layout into a base shader layout
|
|
103
|
+
* In WebGL, this allows the auto generated shader layout to be overridden by the application
|
|
104
|
+
* Typically to change the format of the vertex attributes (from float32x4 to uint8x4 etc).
|
|
105
|
+
* @todo Drop this? This could also be done more clearly with bufferMapping
|
|
95
106
|
*/
|
|
96
|
-
export function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
):
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
varyings: readVaryings(gl, program)
|
|
107
|
+
export function mergeShaderLayout(
|
|
108
|
+
baseLayout: ShaderLayout,
|
|
109
|
+
overrideLayout: ShaderLayout
|
|
110
|
+
): ShaderLayout {
|
|
111
|
+
// Deep clone the base layout
|
|
112
|
+
const mergedLayout: ShaderLayout = {
|
|
113
|
+
...baseLayout,
|
|
114
|
+
attributes: baseLayout.attributes.map(attribute => ({...attribute}))
|
|
105
115
|
};
|
|
116
|
+
// Merge the attributes
|
|
117
|
+
for (const attribute of overrideLayout?.attributes || []) {
|
|
118
|
+
const baseAttribute = mergedLayout.attributes.find(attr => attr.name === attribute.name);
|
|
119
|
+
if (!baseAttribute) {
|
|
120
|
+
log.warn(`shader layout attribute ${attribute.name} not present in shader`);
|
|
121
|
+
} else {
|
|
122
|
+
baseAttribute.format = attribute.format || baseAttribute.format;
|
|
123
|
+
baseAttribute.stepMode = attribute.stepMode || baseAttribute.stepMode;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return mergedLayout;
|
|
127
|
+
}
|
|
106
128
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
129
|
+
export function mergeBufferMap(baseLayout: ShaderLayout, bufferMap: BufferMapping[]): ShaderLayout {
|
|
130
|
+
// Deep clone the base layout
|
|
131
|
+
const mergedLayout: ShaderLayout = {
|
|
132
|
+
...baseLayout,
|
|
133
|
+
attributes: baseLayout.attributes.map(attribute => ({...attribute}))
|
|
134
|
+
};
|
|
135
|
+
for (const bufferMapping of bufferMap) {
|
|
136
|
+
// Handle interleave
|
|
137
|
+
switch (bufferMapping.type) {
|
|
138
|
+
case 'interleave':
|
|
139
|
+
// Handle interleaved buffer mapping
|
|
140
|
+
for (const attributeOverride of bufferMapping.attributes) {
|
|
141
|
+
overrideShaderLayoutAttribute(mergedLayout, attributeOverride);
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
|
|
145
|
+
default:
|
|
146
|
+
// Handle simple attribute overrides
|
|
147
|
+
overrideShaderLayoutAttribute(mergedLayout, bufferMapping);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return mergedLayout;
|
|
110
151
|
}
|
|
111
152
|
|
|
153
|
+
function overrideShaderLayoutAttribute(
|
|
154
|
+
layout: ShaderLayout,
|
|
155
|
+
attributeOverride: {name: string; format?: VertexFormat}
|
|
156
|
+
): void {
|
|
157
|
+
const attribute = getAttributeFromLayout(layout, attributeOverride.name);
|
|
158
|
+
if (attribute && attributeOverride.format) {
|
|
159
|
+
attribute.format = attributeOverride.format;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function getAttributeFromLayout(
|
|
164
|
+
shaderLayout: ShaderLayout,
|
|
165
|
+
name: string
|
|
166
|
+
): AttributeLayout | null {
|
|
167
|
+
const attribute = shaderLayout.attributes.find(attr => attr.name === name);
|
|
168
|
+
if (!attribute) {
|
|
169
|
+
log.warn(`shader layout attribute "${name}" not present in shader`);
|
|
170
|
+
}
|
|
171
|
+
return attribute || null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// HELPERS
|
|
175
|
+
|
|
112
176
|
/**
|
|
113
177
|
* Extract info about all transform feedback varyings
|
|
114
178
|
*
|
|
@@ -123,7 +187,11 @@ function readAttributeBindings(
|
|
|
123
187
|
const count = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);
|
|
124
188
|
|
|
125
189
|
for (let index = 0; index < count; index++) {
|
|
126
|
-
const
|
|
190
|
+
const activeInfo = gl.getActiveAttrib(program, index);
|
|
191
|
+
if (!activeInfo) {
|
|
192
|
+
throw new Error('activeInfo');
|
|
193
|
+
}
|
|
194
|
+
const {name, type: compositeType, size} = activeInfo;
|
|
127
195
|
const location = gl.getAttribLocation(program, name);
|
|
128
196
|
// Add only user provided attributes, for built-in attributes like
|
|
129
197
|
// `gl_InstanceID` locaiton will be < 0
|
|
@@ -158,7 +226,11 @@ function readVaryings(gl: WebGLRenderingContext, program: WebGLProgram): Varying
|
|
|
158
226
|
|
|
159
227
|
const count = gl.getProgramParameter(program, GL.TRANSFORM_FEEDBACK_VARYINGS);
|
|
160
228
|
for (let location = 0; location < count; location++) {
|
|
161
|
-
const
|
|
229
|
+
const activeInfo = gl2.getTransformFeedbackVarying(program, location);
|
|
230
|
+
if (!activeInfo) {
|
|
231
|
+
throw new Error('activeInfo');
|
|
232
|
+
}
|
|
233
|
+
const {name, type: compositeType, size} = activeInfo;
|
|
162
234
|
const {glType, components} = decodeUniformType(compositeType);
|
|
163
235
|
const accessor = new Accessor({type: glType, size: size * components});
|
|
164
236
|
const varying = {location, name, accessor}; // Base values
|
|
@@ -179,7 +251,11 @@ function readUniformBindings(gl: WebGLRenderingContext, program: WebGLProgram):
|
|
|
179
251
|
|
|
180
252
|
const uniformCount = gl.getProgramParameter(program, GL.ACTIVE_UNIFORMS);
|
|
181
253
|
for (let i = 0; i < uniformCount; i++) {
|
|
182
|
-
const
|
|
254
|
+
const activeInfo = gl.getActiveUniform(program, i);
|
|
255
|
+
if (!activeInfo) {
|
|
256
|
+
throw new Error('activeInfo');
|
|
257
|
+
}
|
|
258
|
+
const {name: rawName, size, type} = activeInfo;
|
|
183
259
|
const {name, isArray} = parseUniformName(rawName);
|
|
184
260
|
let webglLocation = gl.getUniformLocation(program, name);
|
|
185
261
|
const uniformInfo = {
|
|
@@ -234,8 +310,8 @@ function readUniformBlocks(
|
|
|
234
310
|
|
|
235
311
|
const blockCount = gl2.getProgramParameter(program, GL.ACTIVE_UNIFORM_BLOCKS);
|
|
236
312
|
for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {
|
|
237
|
-
const blockInfo = {
|
|
238
|
-
name: gl2.getActiveUniformBlockName(program, blockIndex),
|
|
313
|
+
const blockInfo: UniformBlockBinding = {
|
|
314
|
+
name: gl2.getActiveUniformBlockName(program, blockIndex) || '',
|
|
239
315
|
location: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_BINDING),
|
|
240
316
|
byteLength: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_DATA_SIZE),
|
|
241
317
|
vertex: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),
|
|
@@ -244,33 +320,39 @@ function readUniformBlocks(
|
|
|
244
320
|
uniforms: [] as any[]
|
|
245
321
|
};
|
|
246
322
|
|
|
247
|
-
const uniformIndices =
|
|
323
|
+
const uniformIndices =
|
|
324
|
+
(getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) as number[]) || [];
|
|
248
325
|
|
|
249
326
|
const uniformType = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_TYPE); // Array of GLenum indicating the types of the uniforms.
|
|
250
327
|
const uniformArrayLength = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_SIZE); // Array of GLuint indicating the sizes of the uniforms.
|
|
251
|
-
const uniformBlockIndex = gl2.getActiveUniforms(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
); // Array of GLint indicating the block indices of the uniforms.
|
|
328
|
+
// const uniformBlockIndex = gl2.getActiveUniforms(
|
|
329
|
+
// program,
|
|
330
|
+
// uniformIndices,
|
|
331
|
+
// GL.UNIFORM_BLOCK_INDEX
|
|
332
|
+
// ); // Array of GLint indicating the block indices of the uniforms.
|
|
256
333
|
const uniformOffset = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_OFFSET); // Array of GLint indicating the uniform buffer offsets.
|
|
257
334
|
const uniformStride = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_ARRAY_STRIDE); // Array of GLint indicating the strides between the elements.
|
|
258
|
-
const uniformMatrixStride = gl2.getActiveUniforms(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
); // Array of GLint indicating the strides between columns of a column-major matrix or a row-major matrix.
|
|
263
|
-
const uniformRowMajor = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_IS_ROW_MAJOR);
|
|
335
|
+
// const uniformMatrixStride = gl2.getActiveUniforms(
|
|
336
|
+
// program,
|
|
337
|
+
// uniformIndices,
|
|
338
|
+
// GL.UNIFORM_MATRIX_STRIDE
|
|
339
|
+
// ); // Array of GLint indicating the strides between columns of a column-major matrix or a row-major matrix.
|
|
340
|
+
// const uniformRowMajor = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_IS_ROW_MAJOR);
|
|
264
341
|
for (let i = 0; i < blockInfo.uniformCount; ++i) {
|
|
342
|
+
const activeInfo = gl2.getActiveUniform(program, uniformIndices[i]);
|
|
343
|
+
if (!activeInfo) {
|
|
344
|
+
throw new Error('activeInfo');
|
|
345
|
+
}
|
|
346
|
+
|
|
265
347
|
blockInfo.uniforms.push({
|
|
266
|
-
name:
|
|
348
|
+
name: activeInfo.name,
|
|
267
349
|
format: decodeUniformType(uniformType[i]).format,
|
|
268
350
|
type: uniformType[i],
|
|
269
351
|
arrayLength: uniformArrayLength[i],
|
|
270
352
|
byteOffset: uniformOffset[i],
|
|
271
|
-
byteStride: uniformStride[i]
|
|
272
|
-
matrixStride: uniformStride[i],
|
|
273
|
-
rowMajor: uniformRowMajor[i]
|
|
353
|
+
byteStride: uniformStride[i]
|
|
354
|
+
// matrixStride: uniformStride[i],
|
|
355
|
+
// rowMajor: uniformRowMajor[i]
|
|
274
356
|
});
|
|
275
357
|
}
|
|
276
358
|
|
|
@@ -305,18 +387,18 @@ const SAMPLER_UNIFORMS_GL_TO_GPU: Record<
|
|
|
305
387
|
[GL.UNSIGNED_INT_SAMPLER_2D_ARRAY]: ['2d-array', 'uint']
|
|
306
388
|
};
|
|
307
389
|
|
|
308
|
-
|
|
309
|
-
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
if (sampler) {
|
|
316
|
-
|
|
317
|
-
return {viewDimension, sampleType};
|
|
390
|
+
type SamplerInfo = {
|
|
391
|
+
viewDimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
|
|
392
|
+
sampleType: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
function getSamplerInfo(type: GL): SamplerInfo {
|
|
396
|
+
const sampler = SAMPLER_UNIFORMS_GL_TO_GPU[type];
|
|
397
|
+
if (!sampler) {
|
|
398
|
+
throw new Error('sampler');
|
|
318
399
|
}
|
|
319
|
-
|
|
400
|
+
const [viewDimension, sampleType] = sampler;
|
|
401
|
+
return {viewDimension, sampleType};
|
|
320
402
|
}
|
|
321
403
|
|
|
322
404
|
// HELPERS
|
|
@@ -333,7 +415,7 @@ function parseUniformName(name: string): {name: string; length: number; isArray:
|
|
|
333
415
|
|
|
334
416
|
// if array name then clean the array brackets
|
|
335
417
|
const UNIFORM_NAME_REGEXP = /([^[]*)(\[[0-9]+\])?/;
|
|
336
|
-
const matches =
|
|
418
|
+
const matches = UNIFORM_NAME_REGEXP.exec(name);
|
|
337
419
|
if (!matches || matches.length < 2) {
|
|
338
420
|
throw new Error(`Failed to parse GLSL uniform name ${name}`);
|
|
339
421
|
}
|
|
@@ -347,11 +429,11 @@ function parseUniformName(name: string): {name: string; length: number; isArray:
|
|
|
347
429
|
|
|
348
430
|
/**
|
|
349
431
|
* TODO - verify this is a copy of above and delete
|
|
350
|
-
* import type {TextureFormat} from '@luma.gl/
|
|
432
|
+
* import type {TextureFormat} from '@luma.gl/core';
|
|
351
433
|
* Extract info about all "active" uniform blocks
|
|
352
434
|
* ("Active" just means that unused (inactive) blocks may have been optimized away during linking)
|
|
353
435
|
*
|
|
354
|
-
function getUniformBlockBindings(gl, program): Binding[] {
|
|
436
|
+
function getUniformBlockBindings(gl: WebGLRenderingContext, program): Binding[] {
|
|
355
437
|
if (!isWebGL2(gl)) {
|
|
356
438
|
return;
|
|
357
439
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// luma.gl, MIT license
|
|
2
|
-
import type {CompilerMessage} from '@luma.gl/
|
|
2
|
+
import type {CompilerMessage} from '@luma.gl/core';
|
|
3
3
|
|
|
4
4
|
const MESSAGE_TYPES = ['warning', 'error', 'info'];
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ export function parseShaderCompilerLog(errLog: string) : readonly CompilerMessag
|
|
|
16
16
|
|
|
17
17
|
for (const line of lines) {
|
|
18
18
|
if (line.length <= 1) {
|
|
19
|
-
continue;
|
|
19
|
+
continue; // eslint-disable-line no-continue
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const segments: string[] = line.split(':');
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
1
3
|
// Uniforms
|
|
2
|
-
import GL from '@luma.gl/constants';
|
|
4
|
+
import {GL} from '@luma.gl/constants';
|
|
3
5
|
|
|
4
6
|
/** Set a raw uniform (without type conversion and caching) */
|
|
5
7
|
/* eslint-disable max-len */
|
|
@@ -7,7 +9,7 @@ export function setUniform(
|
|
|
7
9
|
gl: WebGLRenderingContext,
|
|
8
10
|
location: WebGLUniformLocation,
|
|
9
11
|
type: GL,
|
|
10
|
-
value: number | Float32Array | Int32Array | Uint32Array
|
|
12
|
+
value: number | Float32Array | Int32Array | Uint32Array | boolean
|
|
11
13
|
): void {
|
|
12
14
|
const gl2 = gl as WebGL2RenderingContext;
|
|
13
15
|
|
|
@@ -35,13 +37,12 @@ export function setUniform(
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
// @ts-expect-error
|
|
39
40
|
if (value === true) {
|
|
40
41
|
value = 1;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
|
|
43
44
|
if (value === false) {
|
|
44
|
-
value =
|
|
45
|
+
value = 0;
|
|
45
46
|
}
|
|
46
47
|
const arrayValue = (typeof value === 'number') ? [value] : value;
|
|
47
48
|
|
|
@@ -60,7 +61,7 @@ export function setUniform(
|
|
|
60
61
|
case GL.BOOL: return gl.uniform1iv(location, arrayValue);
|
|
61
62
|
case GL.BOOL_VEC2: return gl.uniform2iv(location, arrayValue);
|
|
62
63
|
case GL.BOOL_VEC3: return gl.uniform3iv(location, arrayValue);
|
|
63
|
-
case GL.BOOL_VEC4: gl.uniform4iv(location, arrayValue);
|
|
64
|
+
case GL.BOOL_VEC4: return gl.uniform4iv(location, arrayValue);
|
|
64
65
|
|
|
65
66
|
// WEBGL2 - unsigned integers
|
|
66
67
|
case GL.UNSIGNED_INT: return gl2.uniform1uiv(location, arrayValue, 1);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {UniformFormat, VertexFormat} from '@luma.gl/
|
|
2
|
-
import GL from '@luma.gl/constants';
|
|
3
|
-
import {GLUniformType, GLSamplerType, GLCompositeType, GLType} from '../../types/webgl'
|
|
1
|
+
import {UniformFormat, VertexFormat} from '@luma.gl/core';
|
|
2
|
+
import {GL, GLUniformType, GLSamplerType, GLCompositeType, GLDataType} from '@luma.gl/constants';
|
|
4
3
|
|
|
5
4
|
/** Check is uniform is of sampler type */
|
|
6
5
|
export function isSamplerUniform(type: GLUniformType): boolean {
|
|
@@ -25,8 +24,11 @@ const SAMPLER_TYPES: GLSamplerType[] = [
|
|
|
25
24
|
GL.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
26
25
|
];
|
|
27
26
|
|
|
28
|
-
// Composite types table
|
|
29
|
-
const COMPOSITE_GL_TYPES: Record<
|
|
27
|
+
// Composite types table
|
|
28
|
+
const COMPOSITE_GL_TYPES: Record<
|
|
29
|
+
GLCompositeType,
|
|
30
|
+
[GLDataType, number, string, UniformFormat, VertexFormat?]
|
|
31
|
+
> = {
|
|
30
32
|
[GL.FLOAT]: [GL.FLOAT, 1, 'float', 'f32', 'float32'],
|
|
31
33
|
[GL.FLOAT_VEC2]: [GL.FLOAT, 2, 'vec2', 'vec2<f32>', 'float32x2'],
|
|
32
34
|
[GL.FLOAT_VEC3]: [GL.FLOAT, 3, 'vec3', 'vec3<f32>', 'float32x3'],
|
|
@@ -61,27 +63,35 @@ const COMPOSITE_GL_TYPES: Record<GLCompositeType, [GLType, number, string, Unifo
|
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */
|
|
64
|
-
export function decodeUniformType(
|
|
66
|
+
export function decodeUniformType(
|
|
67
|
+
uniformType: GL
|
|
68
|
+
): {format: UniformFormat; components: number; glType: GLDataType} {
|
|
65
69
|
const typeAndSize = COMPOSITE_GL_TYPES[uniformType];
|
|
66
70
|
if (!typeAndSize) {
|
|
67
|
-
|
|
71
|
+
throw new Error('uniform');
|
|
68
72
|
}
|
|
69
73
|
const [glType, components, , format] = typeAndSize;
|
|
70
74
|
return {format, components, glType};
|
|
71
75
|
}
|
|
72
76
|
|
|
73
|
-
export function decodeAttributeType(
|
|
74
|
-
|
|
77
|
+
export function decodeAttributeType(attributeType: GL): {
|
|
78
|
+
format: VertexFormat;
|
|
79
|
+
components: number;
|
|
80
|
+
glType: GLDataType;
|
|
81
|
+
} {
|
|
82
|
+
const typeAndSize = COMPOSITE_GL_TYPES[attributeType];
|
|
75
83
|
if (!typeAndSize) {
|
|
76
|
-
|
|
84
|
+
throw new Error('attribute')
|
|
77
85
|
}
|
|
78
86
|
const [glType, components, , , format] = typeAndSize;
|
|
79
87
|
return {format, components, glType};
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */
|
|
83
|
-
export function
|
|
84
|
-
|
|
91
|
+
export function decomposeCompositeGLDataType(
|
|
92
|
+
compositeGLDataType: GLCompositeType
|
|
93
|
+
): {type: GLDataType; components: number} | null {
|
|
94
|
+
const typeAndSize = COMPOSITE_GL_TYPES[compositeGLDataType];
|
|
85
95
|
if (!typeAndSize) {
|
|
86
96
|
return null;
|
|
87
97
|
}
|
|
@@ -89,7 +99,7 @@ export function decomposeCompositeGLType(compositeGLType: GLCompositeType): {typ
|
|
|
89
99
|
return {type, components};
|
|
90
100
|
}
|
|
91
101
|
|
|
92
|
-
export function
|
|
102
|
+
export function getCompositeGLDataType(type: GL, components): {glType: GLDataType; name: string} | null {
|
|
93
103
|
switch (type) {
|
|
94
104
|
case GL.BYTE:
|
|
95
105
|
case GL.UNSIGNED_BYTE:
|