@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
|
@@ -1,954 +0,0 @@
|
|
|
1
|
-
import { decodeTextureFormat } from '@luma.gl/api';
|
|
2
|
-
import GL from '@luma.gl/constants';
|
|
3
|
-
import { isWebGL2 } from '../../context/context/webgl-checks';
|
|
4
|
-
const texture_compression_bc = 'texture-compression-bc';
|
|
5
|
-
const texture_compression_astc = 'texture-compression-astc';
|
|
6
|
-
const texture_compression_etc2 = 'texture-compression-etc2';
|
|
7
|
-
const texture_compression_etc1_webgl = 'texture-compression-etc1-webgl';
|
|
8
|
-
const texture_compression_pvrtc_webgl = 'texture-compression-pvrtc-webgl';
|
|
9
|
-
const texture_compression_atc_webgl = 'texture-compression-atc-webgl';
|
|
10
|
-
const X_S3TC = 'WEBGL_compressed_texture_s3tc';
|
|
11
|
-
const X_S3TC_SRGB = 'WEBGL_compressed_texture_s3tc_srgb';
|
|
12
|
-
const X_RGTC = 'EXT_texture_compression_rgtc';
|
|
13
|
-
const X_BPTC = 'EXT_texture_compression_bptc';
|
|
14
|
-
const X_ETC2 = 'WEBGL_compressed_texture_etc';
|
|
15
|
-
const X_ASTC = 'WEBGL_compressed_texture_astc';
|
|
16
|
-
const X_ETC1 = 'WEBGL_compressed_texture_etc1';
|
|
17
|
-
const X_PVRTC = 'WEBGL_compressed_texture_pvrtc';
|
|
18
|
-
const X_ATC = 'WEBGL_compressed_texture_atc';
|
|
19
|
-
const EXT_SRGB = 'EXT_sRGB';
|
|
20
|
-
const EXT_TEXTURE_NORM16 = 'EXT_texture_norm16';
|
|
21
|
-
const EXT_FLOAT_WEBGL1 = 'WEBGL_color_buffer_float';
|
|
22
|
-
const EXT_FLOAT_RENDER_WEBGL2 = 'EXT_color_buffer_float';
|
|
23
|
-
const EXT_HALF_FLOAT_WEBGL1 = 'WEBGL_color_buffer_half_float';
|
|
24
|
-
|
|
25
|
-
const checkExtension = (gl, extension) => gl.getExtension(extension);
|
|
26
|
-
|
|
27
|
-
const checkExtensions = (gl, extensions) => extensions.every(extension => gl.getExtension(extension));
|
|
28
|
-
|
|
29
|
-
const TEXTURE_FEATURE_CHECKS = {
|
|
30
|
-
'texture-blend-float-webgl1': gl => isWebGL2(gl) ? true : checkExtension(gl, 'EXT_float_blend'),
|
|
31
|
-
'texture-formats-srgb-webgl1': gl => isWebGL2(gl) ? true : checkExtension(gl, EXT_SRGB),
|
|
32
|
-
'texture-formats-depth-webgl1': gl => isWebGL2(gl) ? true : checkExtension(gl, 'WEBGL_depth_texture'),
|
|
33
|
-
'texture-formats-float32-webgl1': gl => isWebGL2(gl) ? true : checkExtension(gl, 'OES_texture_float'),
|
|
34
|
-
'texture-formats-float16-webgl1': gl => isWebGL2(gl) ? true : checkExtension(gl, 'OES_texture_half_float'),
|
|
35
|
-
'texture-formats-norm16-webgl': gl => isWebGL2(gl) ? checkExtension(gl, EXT_TEXTURE_NORM16) : false,
|
|
36
|
-
'texture-filter-linear-float32-webgl': gl => checkExtension(gl, 'OES_texture_float_linear'),
|
|
37
|
-
'texture-filter-linear-float16-webgl': gl => checkExtension(gl, 'OES_texture_half_float_linear'),
|
|
38
|
-
'texture-filter-anisotropic-webgl': gl => checkExtension(gl, 'EXT_texture_filter_anisotropic'),
|
|
39
|
-
'texture-renderable-float32-webgl': gl => checkExtension(gl, 'EXT_color_buffer_float'),
|
|
40
|
-
'texture-renderable-float16-webgl': gl => checkExtension(gl, 'EXT_color_buffer_half_float'),
|
|
41
|
-
'texture-compression-bc': gl => checkExtensions(gl, [X_S3TC, X_S3TC_SRGB, X_RGTC, X_BPTC]),
|
|
42
|
-
'texture-compression-bc5-webgl': gl => checkExtensions(gl, [X_RGTC]),
|
|
43
|
-
'texture-compression-etc2': gl => checkExtensions(gl, [X_ETC2]),
|
|
44
|
-
'texture-compression-astc': gl => checkExtensions(gl, [X_ASTC]),
|
|
45
|
-
'texture-compression-etc1-webgl': gl => checkExtensions(gl, [X_ETC1]),
|
|
46
|
-
'texture-compression-pvrtc-webgl': gl => checkExtensions(gl, [X_PVRTC]),
|
|
47
|
-
'texture-compression-atc-webgl': gl => checkExtensions(gl, [X_ATC])
|
|
48
|
-
};
|
|
49
|
-
export function checkTextureFeature(gl, feature) {
|
|
50
|
-
var _TEXTURE_FEATURE_CHEC;
|
|
51
|
-
|
|
52
|
-
return (_TEXTURE_FEATURE_CHEC = TEXTURE_FEATURE_CHECKS[feature]) === null || _TEXTURE_FEATURE_CHEC === void 0 ? void 0 : _TEXTURE_FEATURE_CHEC.call(TEXTURE_FEATURE_CHECKS, gl);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const checkTextureFeatures = (gl, features) => features.every(feature => checkTextureFeature(gl, feature));
|
|
56
|
-
|
|
57
|
-
export function getTextureFeatures(gl) {
|
|
58
|
-
const textureFeatures = Object.keys(TEXTURE_FEATURE_CHECKS);
|
|
59
|
-
return textureFeatures.filter(feature => checkTextureFeature(gl, feature));
|
|
60
|
-
}
|
|
61
|
-
export const TEXTURE_FORMATS = {
|
|
62
|
-
'rgb8unorm-unsized': {
|
|
63
|
-
gl: GL.RGB,
|
|
64
|
-
gl1: GL.RGB,
|
|
65
|
-
b: 4,
|
|
66
|
-
c: 2,
|
|
67
|
-
bpp: 4,
|
|
68
|
-
dataFormat: GL.RGB,
|
|
69
|
-
types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_6_5]
|
|
70
|
-
},
|
|
71
|
-
'rgba8unorm-unsized': {
|
|
72
|
-
gl: GL.RGBA,
|
|
73
|
-
gl1: GL.RGBA,
|
|
74
|
-
b: 4,
|
|
75
|
-
c: 2,
|
|
76
|
-
bpp: 4,
|
|
77
|
-
dataFormat: GL.RGBA,
|
|
78
|
-
types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_4_4_4_4, GL.UNSIGNED_SHORT_5_5_5_1]
|
|
79
|
-
},
|
|
80
|
-
'r8unorm': {
|
|
81
|
-
gl: GL.R8,
|
|
82
|
-
b: 1,
|
|
83
|
-
c: 1
|
|
84
|
-
},
|
|
85
|
-
'r8snorm': {
|
|
86
|
-
gl: GL.R8_SNORM,
|
|
87
|
-
b: 1,
|
|
88
|
-
c: 1
|
|
89
|
-
},
|
|
90
|
-
'r8uint': {
|
|
91
|
-
gl: GL.R8UI,
|
|
92
|
-
b: 1,
|
|
93
|
-
c: 1
|
|
94
|
-
},
|
|
95
|
-
'r8sint': {
|
|
96
|
-
gl: GL.R8I,
|
|
97
|
-
b: 1,
|
|
98
|
-
c: 1
|
|
99
|
-
},
|
|
100
|
-
'rg8unorm': {
|
|
101
|
-
gl: GL.RG8,
|
|
102
|
-
b: 2,
|
|
103
|
-
c: 2
|
|
104
|
-
},
|
|
105
|
-
'rg8snorm': {
|
|
106
|
-
gl: GL.RG8_SNORM,
|
|
107
|
-
b: 2,
|
|
108
|
-
c: 2
|
|
109
|
-
},
|
|
110
|
-
'rg8uint': {
|
|
111
|
-
gl: GL.RG8UI,
|
|
112
|
-
b: 2,
|
|
113
|
-
c: 2
|
|
114
|
-
},
|
|
115
|
-
'rg8sint': {
|
|
116
|
-
gl: GL.RG8I,
|
|
117
|
-
b: 2,
|
|
118
|
-
c: 2
|
|
119
|
-
},
|
|
120
|
-
'r16uint': {
|
|
121
|
-
gl: GL.R16UI,
|
|
122
|
-
b: 2,
|
|
123
|
-
c: 1
|
|
124
|
-
},
|
|
125
|
-
'r16sint': {
|
|
126
|
-
gl: GL.R16I,
|
|
127
|
-
b: 2,
|
|
128
|
-
c: 1
|
|
129
|
-
},
|
|
130
|
-
'r16float': {
|
|
131
|
-
gl: GL.R16F,
|
|
132
|
-
b: 2,
|
|
133
|
-
c: 1,
|
|
134
|
-
render: 'texture-renderable-float16-webgl',
|
|
135
|
-
filter: 'texture-filter-linear-float16-webgl'
|
|
136
|
-
},
|
|
137
|
-
'r16unorm-webgl': {
|
|
138
|
-
gl: GL.R16_EXT,
|
|
139
|
-
b: 2,
|
|
140
|
-
c: 1,
|
|
141
|
-
f: 'texture-formats-norm16-webgl'
|
|
142
|
-
},
|
|
143
|
-
'r16snorm-webgl': {
|
|
144
|
-
gl: GL.R16_SNORM_EXT,
|
|
145
|
-
b: 2,
|
|
146
|
-
c: 1,
|
|
147
|
-
f: 'texture-formats-norm16-webgl'
|
|
148
|
-
},
|
|
149
|
-
'rgba4unorm-webgl': {
|
|
150
|
-
gl: GL.RGBA4,
|
|
151
|
-
b: 2,
|
|
152
|
-
c: 4,
|
|
153
|
-
wgpu: false
|
|
154
|
-
},
|
|
155
|
-
'rgb565unorm-webgl': {
|
|
156
|
-
gl: GL.RGB565,
|
|
157
|
-
b: 2,
|
|
158
|
-
c: 4,
|
|
159
|
-
wgpu: false
|
|
160
|
-
},
|
|
161
|
-
'rgb5a1unorm-webgl': {
|
|
162
|
-
gl: GL.RGB5_A1,
|
|
163
|
-
b: 2,
|
|
164
|
-
c: 4,
|
|
165
|
-
wgpu: false
|
|
166
|
-
},
|
|
167
|
-
'rbg8unorm-webgl': {
|
|
168
|
-
gl: GL.RGB8,
|
|
169
|
-
b: 3,
|
|
170
|
-
c: 3,
|
|
171
|
-
wgpu: false
|
|
172
|
-
},
|
|
173
|
-
'rbg8snorm-webgl': {
|
|
174
|
-
gl: GL.RGB8_SNORM,
|
|
175
|
-
b: 3,
|
|
176
|
-
c: 3,
|
|
177
|
-
wgpu: false
|
|
178
|
-
},
|
|
179
|
-
'rgba8unorm': {
|
|
180
|
-
gl: GL.RGBA8,
|
|
181
|
-
gl1: GL.RGBA,
|
|
182
|
-
b: 4,
|
|
183
|
-
c: 2,
|
|
184
|
-
bpp: 4
|
|
185
|
-
},
|
|
186
|
-
'rgba8unorm-srgb': {
|
|
187
|
-
gl: GL.SRGB8_ALPHA8,
|
|
188
|
-
gl1: GL.SRGB_ALPHA_EXT,
|
|
189
|
-
b: 4,
|
|
190
|
-
c: 4,
|
|
191
|
-
gl1ext: EXT_SRGB,
|
|
192
|
-
bpp: 4
|
|
193
|
-
},
|
|
194
|
-
'rgba8snorm': {
|
|
195
|
-
gl: GL.RGBA8_SNORM,
|
|
196
|
-
b: 4,
|
|
197
|
-
c: 4
|
|
198
|
-
},
|
|
199
|
-
'rgba8uint': {
|
|
200
|
-
gl: GL.RGBA8UI,
|
|
201
|
-
b: 4,
|
|
202
|
-
c: 4,
|
|
203
|
-
bpp: 4
|
|
204
|
-
},
|
|
205
|
-
'rgba8sint': {
|
|
206
|
-
gl: GL.RGBA8I,
|
|
207
|
-
b: 4,
|
|
208
|
-
c: 4,
|
|
209
|
-
bpp: 4
|
|
210
|
-
},
|
|
211
|
-
'bgra8unorm': {
|
|
212
|
-
b: 4,
|
|
213
|
-
c: 4
|
|
214
|
-
},
|
|
215
|
-
'bgra8unorm-srgb': {
|
|
216
|
-
b: 4,
|
|
217
|
-
c: 4
|
|
218
|
-
},
|
|
219
|
-
'rg16uint': {
|
|
220
|
-
gl: GL.RG16UI,
|
|
221
|
-
b: 4,
|
|
222
|
-
c: 1,
|
|
223
|
-
bpp: 4
|
|
224
|
-
},
|
|
225
|
-
'rg16sint': {
|
|
226
|
-
gl: GL.RG16I,
|
|
227
|
-
b: 4,
|
|
228
|
-
c: 2,
|
|
229
|
-
bpp: 4
|
|
230
|
-
},
|
|
231
|
-
'rg16float': {
|
|
232
|
-
gl: GL.RG16F,
|
|
233
|
-
bpp: 4,
|
|
234
|
-
b: 4,
|
|
235
|
-
c: 2,
|
|
236
|
-
render: 'texture-renderable-float16-webgl',
|
|
237
|
-
filter: 'texture-filter-linear-float16-webgl'
|
|
238
|
-
},
|
|
239
|
-
'rg16unorm-webgl': {
|
|
240
|
-
gl: GL.RG16_EXT,
|
|
241
|
-
b: 2,
|
|
242
|
-
c: 2,
|
|
243
|
-
f: 'texture-formats-norm16-webgl'
|
|
244
|
-
},
|
|
245
|
-
'rg16snorm-webgl': {
|
|
246
|
-
gl: GL.RG16_SNORM_EXT,
|
|
247
|
-
b: 2,
|
|
248
|
-
c: 2,
|
|
249
|
-
f: 'texture-formats-norm16-webgl'
|
|
250
|
-
},
|
|
251
|
-
'r32uint': {
|
|
252
|
-
gl: GL.R32UI,
|
|
253
|
-
b: 4,
|
|
254
|
-
c: 1,
|
|
255
|
-
bpp: 4
|
|
256
|
-
},
|
|
257
|
-
'r32sint': {
|
|
258
|
-
gl: GL.R32I,
|
|
259
|
-
b: 4,
|
|
260
|
-
c: 1,
|
|
261
|
-
bpp: 4
|
|
262
|
-
},
|
|
263
|
-
'r32float': {
|
|
264
|
-
gl: GL.R32F,
|
|
265
|
-
bpp: 4,
|
|
266
|
-
b: 4,
|
|
267
|
-
c: 1,
|
|
268
|
-
render: 'texture-renderable-float32-webgl',
|
|
269
|
-
filter: 'texture-filter-linear-float32-webgl'
|
|
270
|
-
},
|
|
271
|
-
'rgb9e5ufloat': {
|
|
272
|
-
gl: GL.RGB9_E5,
|
|
273
|
-
b: 4,
|
|
274
|
-
c: 3,
|
|
275
|
-
p: 1,
|
|
276
|
-
render: 'texture-renderable-float16-webgl',
|
|
277
|
-
filter: 'texture-filter-linear-float16-webgl'
|
|
278
|
-
},
|
|
279
|
-
'rg11b10ufloat': {
|
|
280
|
-
gl: GL.R11F_G11F_B10F,
|
|
281
|
-
b: 4,
|
|
282
|
-
c: 3,
|
|
283
|
-
p: 1,
|
|
284
|
-
render: 'texture-renderable-float32-webgl'
|
|
285
|
-
},
|
|
286
|
-
'rgb10a2unorm': {
|
|
287
|
-
gl: GL.RGB10_A2,
|
|
288
|
-
b: 4,
|
|
289
|
-
c: 4,
|
|
290
|
-
p: 1
|
|
291
|
-
},
|
|
292
|
-
'rgb10a2unorm-webgl': {
|
|
293
|
-
b: 4,
|
|
294
|
-
c: 4,
|
|
295
|
-
gl: GL.RGB10_A2UI,
|
|
296
|
-
p: 1,
|
|
297
|
-
wgpu: false,
|
|
298
|
-
bpp: 4
|
|
299
|
-
},
|
|
300
|
-
'rgb16unorm-webgl': {
|
|
301
|
-
gl: GL.RGB16_EXT,
|
|
302
|
-
b: 2,
|
|
303
|
-
c: 3,
|
|
304
|
-
f: 'texture-formats-norm16-webgl'
|
|
305
|
-
},
|
|
306
|
-
'rgb16snorm-webgl': {
|
|
307
|
-
gl: GL.RGB16_SNORM_EXT,
|
|
308
|
-
b: 2,
|
|
309
|
-
c: 3,
|
|
310
|
-
f: 'texture-formats-norm16-webgl'
|
|
311
|
-
},
|
|
312
|
-
'rg32uint': {
|
|
313
|
-
gl: GL.RG32UI,
|
|
314
|
-
b: 8,
|
|
315
|
-
c: 2
|
|
316
|
-
},
|
|
317
|
-
'rg32sint': {
|
|
318
|
-
gl: GL.RG32I,
|
|
319
|
-
b: 8,
|
|
320
|
-
c: 2
|
|
321
|
-
},
|
|
322
|
-
'rg32float': {
|
|
323
|
-
gl: GL.RG32F,
|
|
324
|
-
b: 8,
|
|
325
|
-
c: 2,
|
|
326
|
-
render: 'texture-renderable-float32-webgl',
|
|
327
|
-
filter: 'texture-filter-linear-float32-webgl'
|
|
328
|
-
},
|
|
329
|
-
'rgba16uint': {
|
|
330
|
-
gl: GL.RGBA16UI,
|
|
331
|
-
b: 8,
|
|
332
|
-
c: 4
|
|
333
|
-
},
|
|
334
|
-
'rgba16sint': {
|
|
335
|
-
gl: GL.RGBA16I,
|
|
336
|
-
b: 8,
|
|
337
|
-
c: 4
|
|
338
|
-
},
|
|
339
|
-
'rgba16float': {
|
|
340
|
-
gl: GL.RGBA16F,
|
|
341
|
-
gl1: GL.RGBA,
|
|
342
|
-
b: 8,
|
|
343
|
-
c: 4,
|
|
344
|
-
render: 'texture-renderable-float16-webgl',
|
|
345
|
-
filter: 'texture-filter-linear-float16-webgl'
|
|
346
|
-
},
|
|
347
|
-
'rgba16unorm-webgl': {
|
|
348
|
-
gl: GL.RGBA16_EXT,
|
|
349
|
-
b: 2,
|
|
350
|
-
c: 4,
|
|
351
|
-
f: 'texture-formats-norm16-webgl'
|
|
352
|
-
},
|
|
353
|
-
'rgba16snorm-webgl': {
|
|
354
|
-
gl: GL.RGBA16_SNORM_EXT,
|
|
355
|
-
b: 2,
|
|
356
|
-
c: 4,
|
|
357
|
-
f: 'texture-formats-norm16-webgl'
|
|
358
|
-
},
|
|
359
|
-
'rgb32float-webgl': {
|
|
360
|
-
gl: GL.RGB32F,
|
|
361
|
-
gl1: GL.RGB,
|
|
362
|
-
render: 'texture-renderable-float32-webgl',
|
|
363
|
-
filter: 'texture-filter-linear-float32-webgl',
|
|
364
|
-
gl2ext: EXT_FLOAT_RENDER_WEBGL2,
|
|
365
|
-
gl1ext: EXT_FLOAT_WEBGL1,
|
|
366
|
-
dataFormat: GL.RGB,
|
|
367
|
-
types: [GL.FLOAT]
|
|
368
|
-
},
|
|
369
|
-
'rgba32uint': {
|
|
370
|
-
gl: GL.RGBA32UI,
|
|
371
|
-
b: 16,
|
|
372
|
-
c: 4
|
|
373
|
-
},
|
|
374
|
-
'rgba32sint': {
|
|
375
|
-
gl: GL.RGBA32I,
|
|
376
|
-
b: 16,
|
|
377
|
-
c: 4
|
|
378
|
-
},
|
|
379
|
-
'rgba32float': {
|
|
380
|
-
gl: GL.RGBA32F,
|
|
381
|
-
gl1: GL.RGBA,
|
|
382
|
-
b: 16,
|
|
383
|
-
c: 4,
|
|
384
|
-
render: 'texture-renderable-float32-webgl',
|
|
385
|
-
filter: 'texture-filter-linear-float32-webgl'
|
|
386
|
-
},
|
|
387
|
-
'stencil8': {
|
|
388
|
-
gl: GL.STENCIL_INDEX8,
|
|
389
|
-
b: 1,
|
|
390
|
-
c: 1,
|
|
391
|
-
attachment: GL.STENCIL_ATTACHMENT
|
|
392
|
-
},
|
|
393
|
-
'depth16unorm': {
|
|
394
|
-
gl: GL.DEPTH_COMPONENT16,
|
|
395
|
-
gl1: GL.DEPTH_COMPONENT16,
|
|
396
|
-
b: 2,
|
|
397
|
-
c: 1,
|
|
398
|
-
attachment: GL.DEPTH_ATTACHMENT
|
|
399
|
-
},
|
|
400
|
-
'depth24plus': {
|
|
401
|
-
gl: GL.DEPTH_COMPONENT24,
|
|
402
|
-
b: 3,
|
|
403
|
-
c: 1,
|
|
404
|
-
attachment: GL.DEPTH_ATTACHMENT
|
|
405
|
-
},
|
|
406
|
-
'depth32float': {
|
|
407
|
-
gl: GL.DEPTH_COMPONENT32F,
|
|
408
|
-
b: 4,
|
|
409
|
-
c: 1,
|
|
410
|
-
attachment: GL.DEPTH_ATTACHMENT
|
|
411
|
-
},
|
|
412
|
-
'depth24plus-stencil8': {
|
|
413
|
-
b: 4,
|
|
414
|
-
gl: GL.UNSIGNED_INT_24_8,
|
|
415
|
-
gl1: GL.DEPTH_STENCIL,
|
|
416
|
-
c: 2,
|
|
417
|
-
p: 1,
|
|
418
|
-
attachment: GL.DEPTH_STENCIL_ATTACHMENT
|
|
419
|
-
},
|
|
420
|
-
'depth24unorm-stencil8': {
|
|
421
|
-
gl: GL.DEPTH24_STENCIL8,
|
|
422
|
-
b: 4,
|
|
423
|
-
c: 2,
|
|
424
|
-
p: 1,
|
|
425
|
-
attachment: GL.DEPTH_STENCIL_ATTACHMENT
|
|
426
|
-
},
|
|
427
|
-
"depth32float-stencil8": {
|
|
428
|
-
gl: GL.DEPTH32F_STENCIL8,
|
|
429
|
-
b: 5,
|
|
430
|
-
c: 2,
|
|
431
|
-
p: 1,
|
|
432
|
-
attachment: GL.DEPTH_STENCIL_ATTACHMENT
|
|
433
|
-
},
|
|
434
|
-
'bc1-rgb-unorm-webgl': {
|
|
435
|
-
gl: GL.COMPRESSED_RGB_S3TC_DXT1_EXT,
|
|
436
|
-
x: X_S3TC,
|
|
437
|
-
f: texture_compression_bc
|
|
438
|
-
},
|
|
439
|
-
'bc1-rgb-unorm-srgb-webgl': {
|
|
440
|
-
gl: GL.COMPRESSED_SRGB_S3TC_DXT1_EXT,
|
|
441
|
-
x: X_S3TC_SRGB,
|
|
442
|
-
f: texture_compression_bc
|
|
443
|
-
},
|
|
444
|
-
'bc1-rgba-unorm': {
|
|
445
|
-
gl: GL.COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
|
446
|
-
x: X_S3TC,
|
|
447
|
-
f: texture_compression_bc
|
|
448
|
-
},
|
|
449
|
-
'bc1-rgba-unorm-srgb': {
|
|
450
|
-
gl: GL.COMPRESSED_SRGB_S3TC_DXT1_EXT,
|
|
451
|
-
x: X_S3TC_SRGB,
|
|
452
|
-
f: texture_compression_bc
|
|
453
|
-
},
|
|
454
|
-
'bc2-rgba-unorm': {
|
|
455
|
-
gl: GL.COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
|
456
|
-
x: X_S3TC,
|
|
457
|
-
f: texture_compression_bc
|
|
458
|
-
},
|
|
459
|
-
'bc2-rgba-unorm-srgb': {
|
|
460
|
-
gl: GL.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
|
|
461
|
-
x: X_S3TC_SRGB,
|
|
462
|
-
f: texture_compression_bc
|
|
463
|
-
},
|
|
464
|
-
'bc3-rgba-unorm': {
|
|
465
|
-
gl: GL.COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
|
466
|
-
x: X_S3TC,
|
|
467
|
-
f: texture_compression_bc
|
|
468
|
-
},
|
|
469
|
-
'bc3-rgba-unorm-srgb': {
|
|
470
|
-
gl: GL.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
|
|
471
|
-
x: X_S3TC_SRGB,
|
|
472
|
-
f: texture_compression_bc
|
|
473
|
-
},
|
|
474
|
-
'bc4-r-unorm': {
|
|
475
|
-
gl: GL.COMPRESSED_RED_RGTC1_EXT,
|
|
476
|
-
x: X_RGTC,
|
|
477
|
-
f: texture_compression_bc
|
|
478
|
-
},
|
|
479
|
-
'bc4-r-snorm': {
|
|
480
|
-
gl: GL.COMPRESSED_SIGNED_RED_RGTC1_EXT,
|
|
481
|
-
x: X_RGTC,
|
|
482
|
-
f: texture_compression_bc
|
|
483
|
-
},
|
|
484
|
-
'bc5-rg-unorm': {
|
|
485
|
-
gl: GL.COMPRESSED_RED_GREEN_RGTC2_EXT,
|
|
486
|
-
x: X_RGTC,
|
|
487
|
-
f: texture_compression_bc
|
|
488
|
-
},
|
|
489
|
-
'bc5-rg-snorm': {
|
|
490
|
-
gl: GL.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
|
|
491
|
-
x: X_RGTC,
|
|
492
|
-
f: texture_compression_bc
|
|
493
|
-
},
|
|
494
|
-
'bc6h-rgb-ufloat': {
|
|
495
|
-
gl: GL.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
|
|
496
|
-
x: X_BPTC,
|
|
497
|
-
f: texture_compression_bc
|
|
498
|
-
},
|
|
499
|
-
'bc6h-rgb-float': {
|
|
500
|
-
gl: GL.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
|
|
501
|
-
x: X_BPTC,
|
|
502
|
-
f: texture_compression_bc
|
|
503
|
-
},
|
|
504
|
-
'bc7-rgba-unorm': {
|
|
505
|
-
gl: GL.COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
|
506
|
-
x: X_BPTC,
|
|
507
|
-
f: texture_compression_bc
|
|
508
|
-
},
|
|
509
|
-
'bc7-rgba-unorm-srgb': {
|
|
510
|
-
gl: GL.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
|
|
511
|
-
x: X_BPTC,
|
|
512
|
-
f: texture_compression_bc
|
|
513
|
-
},
|
|
514
|
-
'etc2-rgb8unorm': {
|
|
515
|
-
gl: GL.COMPRESSED_RGB8_ETC2,
|
|
516
|
-
f: texture_compression_etc2
|
|
517
|
-
},
|
|
518
|
-
'etc2-rgb8unorm-srgb': {
|
|
519
|
-
gl: GL.COMPRESSED_SRGB8_ETC2,
|
|
520
|
-
f: texture_compression_etc2
|
|
521
|
-
},
|
|
522
|
-
'etc2-rgb8a1unorm': {
|
|
523
|
-
gl: GL.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
|
|
524
|
-
f: texture_compression_etc2
|
|
525
|
-
},
|
|
526
|
-
'etc2-rgb8a1unorm-srgb': {
|
|
527
|
-
gl: GL.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
|
|
528
|
-
f: texture_compression_etc2
|
|
529
|
-
},
|
|
530
|
-
'etc2-rgba8unorm': {
|
|
531
|
-
gl: GL.COMPRESSED_RGBA8_ETC2_EAC,
|
|
532
|
-
f: texture_compression_etc2
|
|
533
|
-
},
|
|
534
|
-
'etc2-rgba8unorm-srgb': {
|
|
535
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
|
|
536
|
-
f: texture_compression_etc2
|
|
537
|
-
},
|
|
538
|
-
'eac-r11unorm': {
|
|
539
|
-
gl: GL.COMPRESSED_R11_EAC,
|
|
540
|
-
f: texture_compression_etc2
|
|
541
|
-
},
|
|
542
|
-
'eac-r11snorm': {
|
|
543
|
-
gl: GL.COMPRESSED_SIGNED_R11_EAC,
|
|
544
|
-
f: texture_compression_etc2
|
|
545
|
-
},
|
|
546
|
-
'eac-rg11unorm': {
|
|
547
|
-
gl: GL.COMPRESSED_RG11_EAC,
|
|
548
|
-
f: texture_compression_etc2
|
|
549
|
-
},
|
|
550
|
-
'eac-rg11snorm': {
|
|
551
|
-
gl: GL.COMPRESSED_SIGNED_RG11_EAC,
|
|
552
|
-
f: texture_compression_etc2
|
|
553
|
-
},
|
|
554
|
-
'astc-4x4-unorm': {
|
|
555
|
-
gl: GL.COMPRESSED_RGBA_ASTC_4x4_KHR,
|
|
556
|
-
f: texture_compression_astc
|
|
557
|
-
},
|
|
558
|
-
'astc-4x4-unorm-srgb': {
|
|
559
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
|
|
560
|
-
f: texture_compression_astc
|
|
561
|
-
},
|
|
562
|
-
'astc-5x4-unorm': {
|
|
563
|
-
gl: GL.COMPRESSED_RGBA_ASTC_5x4_KHR,
|
|
564
|
-
f: texture_compression_astc
|
|
565
|
-
},
|
|
566
|
-
'astc-5x4-unorm-srgb': {
|
|
567
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
|
|
568
|
-
f: texture_compression_astc
|
|
569
|
-
},
|
|
570
|
-
'astc-5x5-unorm': {
|
|
571
|
-
gl: GL.COMPRESSED_RGBA_ASTC_5x5_KHR,
|
|
572
|
-
f: texture_compression_astc
|
|
573
|
-
},
|
|
574
|
-
'astc-5x5-unorm-srgb': {
|
|
575
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
|
|
576
|
-
f: texture_compression_astc
|
|
577
|
-
},
|
|
578
|
-
'astc-6x5-unorm': {
|
|
579
|
-
gl: GL.COMPRESSED_RGBA_ASTC_6x5_KHR,
|
|
580
|
-
f: texture_compression_astc
|
|
581
|
-
},
|
|
582
|
-
'astc-6x5-unorm-srgb': {
|
|
583
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
|
|
584
|
-
f: texture_compression_astc
|
|
585
|
-
},
|
|
586
|
-
'astc-6x6-unorm': {
|
|
587
|
-
gl: GL.COMPRESSED_RGBA_ASTC_6x6_KHR,
|
|
588
|
-
f: texture_compression_astc
|
|
589
|
-
},
|
|
590
|
-
'astc-6x6-unorm-srgb': {
|
|
591
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
|
|
592
|
-
f: texture_compression_astc
|
|
593
|
-
},
|
|
594
|
-
'astc-8x5-unorm': {
|
|
595
|
-
gl: GL.COMPRESSED_RGBA_ASTC_8x5_KHR,
|
|
596
|
-
f: texture_compression_astc
|
|
597
|
-
},
|
|
598
|
-
'astc-8x5-unorm-srgb': {
|
|
599
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
|
|
600
|
-
f: texture_compression_astc
|
|
601
|
-
},
|
|
602
|
-
'astc-8x6-unorm': {
|
|
603
|
-
gl: GL.COMPRESSED_RGBA_ASTC_8x6_KHR,
|
|
604
|
-
f: texture_compression_astc
|
|
605
|
-
},
|
|
606
|
-
'astc-8x6-unorm-srgb': {
|
|
607
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
|
|
608
|
-
f: texture_compression_astc
|
|
609
|
-
},
|
|
610
|
-
'astc-8x8-unorm': {
|
|
611
|
-
gl: GL.COMPRESSED_RGBA_ASTC_8x8_KHR,
|
|
612
|
-
f: texture_compression_astc
|
|
613
|
-
},
|
|
614
|
-
'astc-8x8-unorm-srgb': {
|
|
615
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
|
|
616
|
-
f: texture_compression_astc
|
|
617
|
-
},
|
|
618
|
-
'astc-10x5-unorm': {
|
|
619
|
-
gl: GL.COMPRESSED_RGBA_ASTC_10x10_KHR,
|
|
620
|
-
f: texture_compression_astc
|
|
621
|
-
},
|
|
622
|
-
'astc-10x5-unorm-srgb': {
|
|
623
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
|
|
624
|
-
f: texture_compression_astc
|
|
625
|
-
},
|
|
626
|
-
'astc-10x6-unorm': {
|
|
627
|
-
gl: GL.COMPRESSED_RGBA_ASTC_10x6_KHR,
|
|
628
|
-
f: texture_compression_astc
|
|
629
|
-
},
|
|
630
|
-
'astc-10x6-unorm-srgb': {
|
|
631
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
|
|
632
|
-
f: texture_compression_astc
|
|
633
|
-
},
|
|
634
|
-
'astc-10x8-unorm': {
|
|
635
|
-
gl: GL.COMPRESSED_RGBA_ASTC_10x8_KHR,
|
|
636
|
-
f: texture_compression_astc
|
|
637
|
-
},
|
|
638
|
-
'astc-10x8-unorm-srgb': {
|
|
639
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
|
|
640
|
-
f: texture_compression_astc
|
|
641
|
-
},
|
|
642
|
-
'astc-10x10-unorm': {
|
|
643
|
-
gl: GL.COMPRESSED_RGBA_ASTC_10x10_KHR,
|
|
644
|
-
f: texture_compression_astc
|
|
645
|
-
},
|
|
646
|
-
'astc-10x10-unorm-srgb': {
|
|
647
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
|
|
648
|
-
f: texture_compression_astc
|
|
649
|
-
},
|
|
650
|
-
'astc-12x10-unorm': {
|
|
651
|
-
gl: GL.COMPRESSED_RGBA_ASTC_12x10_KHR,
|
|
652
|
-
f: texture_compression_astc
|
|
653
|
-
},
|
|
654
|
-
'astc-12x10-unorm-srgb': {
|
|
655
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
|
|
656
|
-
f: texture_compression_astc
|
|
657
|
-
},
|
|
658
|
-
'astc-12x12-unorm': {
|
|
659
|
-
gl: GL.COMPRESSED_RGBA_ASTC_12x12_KHR,
|
|
660
|
-
f: texture_compression_astc
|
|
661
|
-
},
|
|
662
|
-
'astc-12x12-unorm-srgb': {
|
|
663
|
-
gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
|
|
664
|
-
f: texture_compression_astc
|
|
665
|
-
},
|
|
666
|
-
'pvrtc-rgb4unorm-webgl': {
|
|
667
|
-
gl: GL.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
|
|
668
|
-
f: texture_compression_pvrtc_webgl
|
|
669
|
-
},
|
|
670
|
-
'pvrtc-rgba4unorm-webgl': {
|
|
671
|
-
gl: GL.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
|
|
672
|
-
f: texture_compression_pvrtc_webgl
|
|
673
|
-
},
|
|
674
|
-
'pvrtc-rbg2unorm-webgl': {
|
|
675
|
-
gl: GL.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
|
|
676
|
-
f: texture_compression_pvrtc_webgl
|
|
677
|
-
},
|
|
678
|
-
'pvrtc-rgba2unorm-webgl': {
|
|
679
|
-
gl: GL.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
|
|
680
|
-
f: texture_compression_pvrtc_webgl
|
|
681
|
-
},
|
|
682
|
-
'etc1-rbg-unorm-webgl': {
|
|
683
|
-
gl: GL.COMPRESSED_RGB_ETC1_WEBGL,
|
|
684
|
-
f: texture_compression_etc1_webgl
|
|
685
|
-
},
|
|
686
|
-
'atc-rgb-unorm-webgl': {
|
|
687
|
-
gl: GL.COMPRESSED_RGB_ATC_WEBGL,
|
|
688
|
-
f: texture_compression_atc_webgl
|
|
689
|
-
},
|
|
690
|
-
'atc-rgba-unorm-webgl': {
|
|
691
|
-
gl: GL.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
|
|
692
|
-
f: texture_compression_atc_webgl
|
|
693
|
-
},
|
|
694
|
-
'atc-rgbai-unorm-webgl': {
|
|
695
|
-
gl: GL.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,
|
|
696
|
-
f: texture_compression_atc_webgl
|
|
697
|
-
}
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
function getTextureFormat(format) {
|
|
701
|
-
if (typeof format === 'string') {
|
|
702
|
-
return format;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
const entry = Object.entries(TEXTURE_FORMATS).find(([, entry]) => entry.gl === format || entry.gl1 === format);
|
|
706
|
-
|
|
707
|
-
if (!entry) {
|
|
708
|
-
throw new Error("Unknown texture format ".concat(format));
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
return entry[0];
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
export function isTextureFormatSupported(gl, formatOrGL) {
|
|
715
|
-
const format = getTextureFormat(formatOrGL);
|
|
716
|
-
const info = TEXTURE_FORMATS[format];
|
|
717
|
-
|
|
718
|
-
if (!info) {
|
|
719
|
-
return false;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
if (isWebGL2(gl) ? info.gl === undefined : info.gl1 === undefined) {
|
|
723
|
-
return false;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
const extension = info.x || (isWebGL2(gl) ? info.gl2ext || info.gl1ext : info.gl1ext);
|
|
727
|
-
|
|
728
|
-
if (extension) {
|
|
729
|
-
return Boolean(gl.getExtension(extension));
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
return true;
|
|
733
|
-
}
|
|
734
|
-
export function getTextureFormatSupport(gl, formatOrGL) {
|
|
735
|
-
const format = getTextureFormat(formatOrGL);
|
|
736
|
-
const info = TEXTURE_FORMATS[format];
|
|
737
|
-
|
|
738
|
-
if (!info) {
|
|
739
|
-
return {
|
|
740
|
-
supported: false
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
let decoded;
|
|
745
|
-
|
|
746
|
-
try {
|
|
747
|
-
decoded = decodeTextureFormat(format);
|
|
748
|
-
} catch {}
|
|
749
|
-
|
|
750
|
-
let supported = isWebGL2(gl) ? info.gl === undefined : info.gl1 === undefined;
|
|
751
|
-
supported = supported && checkTextureFeatures(gl, [info.f]);
|
|
752
|
-
const filterable = info.filter ? checkTextureFeatures(gl, [info.filter]) : decoded && !decoded.signed;
|
|
753
|
-
const renderable = info.filter ? checkTextureFeatures(gl, [info.render]) : decoded && !decoded.signed;
|
|
754
|
-
return {
|
|
755
|
-
supported,
|
|
756
|
-
renderable: supported && checkTextureFeatures(gl, [info.render]),
|
|
757
|
-
filterable: supported && checkTextureFeatures(gl, [info.filter]),
|
|
758
|
-
blendable: false,
|
|
759
|
-
storable: false
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
export function isTextureFormatFilterable(gl, formatOrGL) {
|
|
763
|
-
const format = getTextureFormat(formatOrGL);
|
|
764
|
-
|
|
765
|
-
if (!isTextureFormatSupported(gl, format)) {
|
|
766
|
-
return false;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
try {
|
|
770
|
-
const decoded = decodeTextureFormat(format);
|
|
771
|
-
|
|
772
|
-
if (decoded.signed) {
|
|
773
|
-
return false;
|
|
774
|
-
}
|
|
775
|
-
} catch {
|
|
776
|
-
return false;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
if (format.endsWith('32float')) {
|
|
780
|
-
return Boolean(gl.getExtension('OES_texture_float_linear'));
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
if (format.endsWith('16float')) {
|
|
784
|
-
return Boolean(gl.getExtension('OES_texture_half_float_linear'));
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
return true;
|
|
788
|
-
}
|
|
789
|
-
export function isTextureFormatRenderable(gl, formatOrGL) {
|
|
790
|
-
const format = getTextureFormat(formatOrGL);
|
|
791
|
-
|
|
792
|
-
if (!isTextureFormatSupported(gl, format)) {
|
|
793
|
-
return false;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
if (typeof format === 'number') {
|
|
797
|
-
return false;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
return true;
|
|
801
|
-
}
|
|
802
|
-
export function getWebGLTextureFormat(gl, formatOrGL) {
|
|
803
|
-
const format = getTextureFormat(formatOrGL);
|
|
804
|
-
const formatInfo = TEXTURE_FORMATS[format];
|
|
805
|
-
const webglFormat = isWebGL2(gl) ? formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.gl : formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.gl1;
|
|
806
|
-
|
|
807
|
-
if (typeof format === 'number') {
|
|
808
|
-
return webglFormat || format;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
if (webglFormat === undefined) {
|
|
812
|
-
throw new Error("Unsupported texture format ".concat(format));
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
return webglFormat;
|
|
816
|
-
}
|
|
817
|
-
export function getWebGLTextureParameters(gl, formatOrGL) {
|
|
818
|
-
const format = getTextureFormat(formatOrGL);
|
|
819
|
-
const webglFormat = getWebGLTextureFormat(gl, format);
|
|
820
|
-
const decoded = decodeTextureFormat(format);
|
|
821
|
-
return {
|
|
822
|
-
format: webglFormat,
|
|
823
|
-
dataFormat: getWebGLPixelDataFormat(decoded.format, decoded.integer, decoded.normalized, webglFormat),
|
|
824
|
-
type: getWebGLDataType(decoded.dataType),
|
|
825
|
-
compressed: decoded.compressed
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
export function getWebGLDepthStencilAttachment(formatOrGL) {
|
|
829
|
-
const format = getTextureFormat(formatOrGL);
|
|
830
|
-
|
|
831
|
-
if (typeof format === 'number') {
|
|
832
|
-
throw new Error('unsupported depth stencil format');
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
const info = TEXTURE_FORMATS[format];
|
|
836
|
-
const attachment = info.attachment;
|
|
837
|
-
|
|
838
|
-
if (!attachment) {
|
|
839
|
-
throw new Error('not a depth stencil format');
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
return attachment;
|
|
843
|
-
}
|
|
844
|
-
export function _checkFloat32ColorAttachment(gl, internalFormat = gl.RGBA, srcFormat = GL.RGBA, srcType = GL.UNSIGNED_BYTE) {
|
|
845
|
-
let texture;
|
|
846
|
-
let framebuffer;
|
|
847
|
-
|
|
848
|
-
try {
|
|
849
|
-
texture = gl.createTexture();
|
|
850
|
-
gl.bindTexture(GL.TEXTURE_2D, texture);
|
|
851
|
-
const level = 0;
|
|
852
|
-
const width = 1;
|
|
853
|
-
const height = 1;
|
|
854
|
-
const border = 0;
|
|
855
|
-
const pixel = new Uint8Array([0, 0, 255, 255]);
|
|
856
|
-
gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, srcFormat, srcType, pixel);
|
|
857
|
-
framebuffer = gl.createFramebuffer();
|
|
858
|
-
gl.bindFramebuffer(GL.FRAMEBUFFER, framebuffer);
|
|
859
|
-
gl.framebufferTexture2D(GL.FRAMEBUFFER, GL.COLOR_ATTACHMENT0, GL.TEXTURE_2D, texture, 0);
|
|
860
|
-
const status = gl.checkFramebufferStatus(GL.FRAMEBUFFER) === GL.FRAMEBUFFER_COMPLETE;
|
|
861
|
-
gl.bindTexture(GL.TEXTURE_2D, null);
|
|
862
|
-
return status;
|
|
863
|
-
} finally {
|
|
864
|
-
gl.deleteTexture(texture);
|
|
865
|
-
gl.deleteFramebuffer(framebuffer);
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
const DATA_FORMAT_CHANNELS = {
|
|
869
|
-
[GL.RED]: 1,
|
|
870
|
-
[GL.RED_INTEGER]: 1,
|
|
871
|
-
[GL.RG]: 2,
|
|
872
|
-
[GL.RG_INTEGER]: 2,
|
|
873
|
-
[GL.RGB]: 3,
|
|
874
|
-
[GL.RGB_INTEGER]: 3,
|
|
875
|
-
[GL.RGBA]: 4,
|
|
876
|
-
[GL.RGBA_INTEGER]: 4,
|
|
877
|
-
[GL.DEPTH_COMPONENT]: 1,
|
|
878
|
-
[GL.DEPTH_STENCIL]: 1,
|
|
879
|
-
[GL.ALPHA]: 1,
|
|
880
|
-
[GL.LUMINANCE]: 1,
|
|
881
|
-
[GL.LUMINANCE_ALPHA]: 2
|
|
882
|
-
};
|
|
883
|
-
const TYPE_SIZES = {
|
|
884
|
-
[GL.FLOAT]: 4,
|
|
885
|
-
[GL.UNSIGNED_INT]: 4,
|
|
886
|
-
[GL.INT]: 4,
|
|
887
|
-
[GL.UNSIGNED_SHORT]: 2,
|
|
888
|
-
[GL.SHORT]: 2,
|
|
889
|
-
[GL.HALF_FLOAT]: 2,
|
|
890
|
-
[GL.BYTE]: 1,
|
|
891
|
-
[GL.UNSIGNED_BYTE]: 1
|
|
892
|
-
};
|
|
893
|
-
export function getTextureFormatBytesPerPixel(gl, formatOrGL) {
|
|
894
|
-
const format = getTextureFormat(formatOrGL);
|
|
895
|
-
const params = getWebGLTextureParameters(gl, format);
|
|
896
|
-
const channels = DATA_FORMAT_CHANNELS[params.dataFormat] || 4;
|
|
897
|
-
const channelSize = TYPE_SIZES[params.type] || 1;
|
|
898
|
-
return channels * channelSize;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
function getWebGLPixelDataFormat(dataFormat, integer, normalized, format) {
|
|
902
|
-
if (format === GL.RGBA || format === GL.RGB) {
|
|
903
|
-
return format;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
switch (dataFormat) {
|
|
907
|
-
case 'r':
|
|
908
|
-
return integer && !normalized ? GL.RED_INTEGER : GL.RED;
|
|
909
|
-
|
|
910
|
-
case 'rg':
|
|
911
|
-
return integer && !normalized ? GL.RG_INTEGER : GL.RG;
|
|
912
|
-
|
|
913
|
-
case 'rgb':
|
|
914
|
-
return integer && !normalized ? GL.RGB_INTEGER : GL.RGB;
|
|
915
|
-
|
|
916
|
-
case 'rgba':
|
|
917
|
-
return integer && !normalized ? GL.RGBA_INTEGER : GL.RGBA;
|
|
918
|
-
|
|
919
|
-
default:
|
|
920
|
-
return GL.RGBA;
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
export function getWebGLDataType(dataType) {
|
|
925
|
-
switch (dataType) {
|
|
926
|
-
case 'uint8':
|
|
927
|
-
return GL.UNSIGNED_BYTE;
|
|
928
|
-
|
|
929
|
-
case 'sint8':
|
|
930
|
-
return GL.BYTE;
|
|
931
|
-
|
|
932
|
-
case 'uint16':
|
|
933
|
-
return GL.UNSIGNED_SHORT;
|
|
934
|
-
|
|
935
|
-
case 'sint16':
|
|
936
|
-
return GL.SHORT;
|
|
937
|
-
|
|
938
|
-
case 'uint32':
|
|
939
|
-
return GL.UNSIGNED_INT;
|
|
940
|
-
|
|
941
|
-
case 'sint32':
|
|
942
|
-
return GL.INT;
|
|
943
|
-
|
|
944
|
-
case 'float16':
|
|
945
|
-
return GL.HALF_FLOAT;
|
|
946
|
-
|
|
947
|
-
case 'float32':
|
|
948
|
-
return GL.FLOAT;
|
|
949
|
-
|
|
950
|
-
default:
|
|
951
|
-
return GL.UNSIGNED_BYTE;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
//# sourceMappingURL=texture-formats.js.map
|