@luma.gl/webgl 9.0.0-beta.4 → 9.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/converters/device-parameters.js +240 -158
- package/dist/adapter/converters/sampler-parameters.d.ts +0 -4
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +73 -68
- package/dist/adapter/converters/shader-formats.js +33 -46
- package/dist/adapter/converters/texture-formats.d.ts +9 -18
- package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
- package/dist/adapter/converters/texture-formats.js +454 -871
- package/dist/adapter/converters/vertex-formats.js +52 -61
- package/dist/adapter/device-helpers/device-features.d.ts +2 -5
- package/dist/adapter/device-helpers/device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +56 -87
- package/dist/adapter/device-helpers/device-limits.d.ts +2 -4
- package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +88 -83
- 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 +79 -63
- package/dist/adapter/device-helpers/webgl-device-features.d.ts +6 -0
- package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-features.js +52 -0
- package/dist/adapter/device-helpers/webgl-device-info.d.ts +4 -0
- package/dist/adapter/device-helpers/webgl-device-info.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-info.js +87 -0
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts +50 -0
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -0
- package/dist/adapter/device-helpers/webgl-device-limits.js +92 -0
- package/dist/adapter/helpers/decode-webgl-types.js +87 -76
- package/dist/adapter/helpers/get-shader-layout.d.ts +1 -1
- package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +261 -226
- package/dist/adapter/helpers/parse-shader-compiler-log.js +46 -37
- package/dist/adapter/helpers/set-uniform.d.ts +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +67 -82
- package/dist/adapter/helpers/webgl-topology-utils.js +77 -93
- package/dist/adapter/objects/constants-to-keys.d.ts +1 -1
- package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
- package/dist/adapter/objects/constants-to-keys.js +18 -12
- package/dist/adapter/objects/webgl-renderbuffer.js +76 -80
- package/dist/adapter/objects/webgl-resource.d.ts +1 -1
- package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
- package/dist/adapter/objects/webgl-resource.js +204 -154
- package/dist/adapter/resources/webgl-buffer.d.ts +2 -3
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +160 -119
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +268 -171
- package/dist/adapter/resources/webgl-command-encoder.js +32 -40
- package/dist/adapter/resources/webgl-external-texture.js +92 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts +2 -2
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +167 -139
- package/dist/adapter/resources/webgl-render-pass.js +121 -95
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +11 -1
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +378 -228
- package/dist/adapter/resources/webgl-sampler.d.ts +0 -2
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +43 -34
- package/dist/adapter/resources/webgl-shader.d.ts +10 -1
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +106 -45
- package/dist/adapter/resources/webgl-texture.d.ts +2 -6
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +614 -699
- package/dist/adapter/resources/webgl-transform-feedback.d.ts +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js +143 -145
- package/dist/adapter/resources/webgl-vertex-array.d.ts +1 -1
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +229 -158
- package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgl-canvas-context.js +58 -37
- package/dist/adapter/webgl-device.d.ts +7 -15
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +440 -381
- package/dist/classic/accessor.js +132 -102
- package/dist/classic/clear.d.ts +2 -2
- package/dist/classic/clear.d.ts.map +1 -1
- package/dist/classic/clear.js +73 -73
- package/dist/classic/copy-and-blit.d.ts.map +1 -1
- package/dist/classic/copy-and-blit.js +176 -177
- package/dist/classic/format-utils.d.ts +2 -2
- package/dist/classic/format-utils.js +38 -32
- package/dist/classic/typed-array-utils.js +95 -81
- package/dist/context/{polyfill → context}/context-data.d.ts +2 -1
- package/dist/context/context/context-data.d.ts.map +1 -0
- package/dist/context/context/context-data.js +33 -0
- package/dist/context/context/create-browser-context.d.ts +1 -6
- package/dist/context/context/create-browser-context.d.ts.map +1 -1
- package/dist/context/context/create-browser-context.js +62 -49
- package/dist/context/debug/spector.js +54 -50
- package/dist/context/debug/webgl-developer-tools.d.ts +1 -2
- package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +102 -76
- package/dist/context/parameters/unified-parameter-api.d.ts +3 -3
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.js +95 -46
- package/dist/context/parameters/webgl-parameter-tables.d.ts +110 -99
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +456 -404
- package/dist/context/state-tracker/deep-array-equal.js +18 -14
- package/dist/context/state-tracker/track-context-state.d.ts +4 -4
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
- package/dist/context/state-tracker/track-context-state.js +190 -126
- package/dist/context/state-tracker/with-parameters.d.ts +1 -1
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
- package/dist/context/state-tracker/with-parameters.js +45 -29
- package/dist/dist.dev.js +2568 -3786
- package/dist/index.cjs +1346 -2464
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -26
- package/dist/types.js +2 -1
- package/dist.min.js +9 -42
- package/package.json +11 -15
- package/src/adapter/converters/device-parameters.ts +0 -1
- package/src/adapter/converters/sampler-parameters.ts +0 -17
- package/src/adapter/converters/texture-formats.ts +86 -154
- package/src/adapter/device-helpers/webgl-device-features.ts +69 -0
- package/src/adapter/device-helpers/{get-device-info.ts → webgl-device-info.ts} +3 -4
- package/src/adapter/device-helpers/{device-limits.ts → webgl-device-limits.ts} +25 -23
- package/src/adapter/helpers/get-shader-layout.ts +17 -28
- package/src/adapter/helpers/set-uniform.ts +1 -3
- package/src/adapter/objects/constants-to-keys.ts +1 -1
- package/src/adapter/objects/webgl-renderbuffer.ts +4 -4
- package/src/adapter/objects/webgl-resource.ts +3 -18
- package/src/adapter/resources/webgl-buffer.ts +6 -11
- package/src/adapter/resources/webgl-command-buffer.ts +20 -30
- package/src/adapter/resources/webgl-external-texture.ts +2 -3
- package/src/adapter/resources/webgl-framebuffer.ts +4 -5
- package/src/adapter/resources/webgl-render-pass.ts +7 -7
- package/src/adapter/resources/webgl-render-pipeline.ts +106 -31
- package/src/adapter/resources/webgl-sampler.ts +5 -9
- package/src/adapter/resources/webgl-shader.ts +57 -10
- package/src/adapter/resources/webgl-texture.ts +29 -103
- package/src/adapter/resources/webgl-transform-feedback.ts +14 -15
- package/src/adapter/resources/webgl-vertex-array.ts +16 -18
- package/src/adapter/webgl-canvas-context.ts +1 -7
- package/src/adapter/webgl-device.ts +18 -67
- package/src/classic/clear.ts +13 -14
- package/src/classic/copy-and-blit.ts +1 -2
- package/src/context/context/context-data.ts +44 -0
- package/src/context/context/create-browser-context.ts +7 -32
- package/src/context/debug/webgl-developer-tools.ts +6 -8
- package/src/context/parameters/unified-parameter-api.ts +3 -3
- package/src/context/parameters/webgl-parameter-tables.ts +66 -75
- package/src/context/state-tracker/track-context-state.ts +18 -17
- package/src/context/state-tracker/with-parameters.ts +1 -1
- package/src/index.ts +2 -17
- package/dist/adapter/converters/device-parameters.js.map +0 -1
- package/dist/adapter/converters/sampler-parameters.js.map +0 -1
- package/dist/adapter/converters/shader-formats.js.map +0 -1
- package/dist/adapter/converters/texture-formats.js.map +0 -1
- package/dist/adapter/converters/vertex-formats.js.map +0 -1
- package/dist/adapter/device-helpers/device-features.js.map +0 -1
- package/dist/adapter/device-helpers/device-limits.js.map +0 -1
- package/dist/adapter/device-helpers/get-device-info.js.map +0 -1
- package/dist/adapter/device-helpers/is-old-ie.d.ts +0 -2
- package/dist/adapter/device-helpers/is-old-ie.d.ts.map +0 -1
- package/dist/adapter/device-helpers/is-old-ie.js +0 -9
- package/dist/adapter/device-helpers/is-old-ie.js.map +0 -1
- package/dist/adapter/helpers/decode-webgl-types.js.map +0 -1
- package/dist/adapter/helpers/get-shader-layout.js.map +0 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
- package/dist/adapter/helpers/set-uniform.js.map +0 -1
- package/dist/adapter/helpers/webgl-topology-utils.js.map +0 -1
- package/dist/adapter/objects/constants-to-keys.js.map +0 -1
- package/dist/adapter/objects/webgl-renderbuffer.js.map +0 -1
- package/dist/adapter/objects/webgl-resource.js.map +0 -1
- package/dist/adapter/resources/webgl-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-buffer.js.map +0 -1
- package/dist/adapter/resources/webgl-command-encoder.js.map +0 -1
- package/dist/adapter/resources/webgl-external-texture.js.map +0 -1
- package/dist/adapter/resources/webgl-framebuffer.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pass.js.map +0 -1
- package/dist/adapter/resources/webgl-render-pipeline.js.map +0 -1
- package/dist/adapter/resources/webgl-sampler.js.map +0 -1
- package/dist/adapter/resources/webgl-shader.js.map +0 -1
- package/dist/adapter/resources/webgl-texture.js.map +0 -1
- package/dist/adapter/resources/webgl-transform-feedback.js.map +0 -1
- package/dist/adapter/resources/webgl-vertex-array.js.map +0 -1
- package/dist/adapter/webgl-canvas-context.js.map +0 -1
- package/dist/adapter/webgl-device.js.map +0 -1
- package/dist/classic/accessor.js.map +0 -1
- package/dist/classic/clear.js.map +0 -1
- package/dist/classic/copy-and-blit.js.map +0 -1
- package/dist/classic/format-utils.js.map +0 -1
- package/dist/classic/typed-array-utils.js.map +0 -1
- package/dist/context/context/create-browser-context.js.map +0 -1
- package/dist/context/context/create-headless-context.d.ts +0 -9
- package/dist/context/context/create-headless-context.d.ts.map +0 -1
- package/dist/context/context/create-headless-context.js +0 -42
- package/dist/context/context/create-headless-context.js.map +0 -1
- package/dist/context/context/webgl-checks.d.ts +0 -13
- package/dist/context/context/webgl-checks.d.ts.map +0 -1
- package/dist/context/context/webgl-checks.js +0 -31
- package/dist/context/context/webgl-checks.js.map +0 -1
- package/dist/context/debug/spector.js.map +0 -1
- package/dist/context/debug/webgl-developer-tools.js.map +0 -1
- package/dist/context/parameters/unified-parameter-api.js.map +0 -1
- package/dist/context/parameters/webgl-parameter-tables.js.map +0 -1
- package/dist/context/polyfill/context-data.d.ts.map +0 -1
- package/dist/context/polyfill/context-data.js +0 -12
- package/dist/context/polyfill/context-data.js.map +0 -1
- package/dist/context/polyfill/get-parameter-polyfill.d.ts +0 -2
- package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +0 -1
- package/dist/context/polyfill/get-parameter-polyfill.js +0 -85
- package/dist/context/polyfill/get-parameter-polyfill.js.map +0 -1
- package/dist/context/polyfill/polyfill-context.d.ts +0 -5
- package/dist/context/polyfill/polyfill-context.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-context.js +0 -87
- package/dist/context/polyfill/polyfill-context.js.map +0 -1
- package/dist/context/polyfill/polyfill-table.d.ts +0 -48
- package/dist/context/polyfill/polyfill-table.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-table.js +0 -137
- package/dist/context/polyfill/polyfill-table.js.map +0 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts +0 -2
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +0 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +0 -265
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
- package/dist/context/state-tracker/deep-array-equal.js.map +0 -1
- package/dist/context/state-tracker/track-context-state.js.map +0 -1
- package/dist/context/state-tracker/with-parameters.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/src/adapter/device-helpers/device-features.ts +0 -161
- package/src/adapter/device-helpers/is-old-ie.ts +0 -14
- package/src/context/context/create-headless-context.ts +0 -51
- package/src/context/context/webgl-checks.ts +0 -51
- package/src/context/polyfill/context-data.ts +0 -30
- package/src/context/polyfill/get-parameter-polyfill.ts +0 -122
- package/src/context/polyfill/polyfill-context.ts +0 -104
- package/src/context/polyfill/polyfill-table.ts +0 -167
- package/src/context/polyfill/polyfill-vertex-array-object.ts +0 -365
|
@@ -1,917 +1,500 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
1
3
|
import { decodeTextureFormat } from '@luma.gl/core';
|
|
2
|
-
import {
|
|
3
|
-
import { getGLFromVertexType } from
|
|
4
|
+
import { GL } from '@luma.gl/constants';
|
|
5
|
+
import { getGLFromVertexType } from './vertex-formats';
|
|
6
|
+
/* eslint-disable camelcase */
|
|
7
|
+
// TEXTURE FEATURES
|
|
8
|
+
// Define local device feature strings to optimize minification
|
|
4
9
|
const texture_compression_bc = 'texture-compression-bc';
|
|
5
10
|
const texture_compression_astc = 'texture-compression-astc';
|
|
6
11
|
const texture_compression_etc2 = 'texture-compression-etc2';
|
|
7
12
|
const texture_compression_etc1_webgl = 'texture-compression-etc1-webgl';
|
|
8
13
|
const texture_compression_pvrtc_webgl = 'texture-compression-pvrtc-webgl';
|
|
9
14
|
const texture_compression_atc_webgl = 'texture-compression-atc-webgl';
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
+
// const float32_renderable_webgl: DeviceFeature = 'float32-renderable-webgl';
|
|
16
|
+
// const float16_renderable_webgl: DeviceFeature = 'float16-renderable-webgl';
|
|
17
|
+
// Define local webgl extension strings to optimize minification
|
|
18
|
+
const X_S3TC = 'WEBGL_compressed_texture_s3tc'; // BC1, BC2, BC3
|
|
19
|
+
const X_S3TC_SRGB = 'WEBGL_compressed_texture_s3tc_srgb'; // BC1, BC2, BC3
|
|
20
|
+
const X_RGTC = 'EXT_texture_compression_rgtc'; // BC4, BC5
|
|
21
|
+
const X_BPTC = 'EXT_texture_compression_bptc'; // BC6, BC7
|
|
22
|
+
const X_ETC2 = 'WEBGL_compressed_texture_etc'; // Renamed from 'WEBGL_compressed_texture_es3'
|
|
15
23
|
const X_ASTC = 'WEBGL_compressed_texture_astc';
|
|
16
24
|
const X_ETC1 = 'WEBGL_compressed_texture_etc1';
|
|
17
25
|
const X_PVRTC = 'WEBGL_compressed_texture_pvrtc';
|
|
18
26
|
const X_ATC = 'WEBGL_compressed_texture_atc';
|
|
19
|
-
|
|
27
|
+
// Define local webgl extension strings to optimize minification
|
|
20
28
|
const EXT_TEXTURE_NORM16 = 'EXT_texture_norm16';
|
|
21
|
-
const EXT_FLOAT_WEBGL1 = 'WEBGL_color_buffer_float';
|
|
22
29
|
const EXT_FLOAT_RENDER_WEBGL2 = 'EXT_color_buffer_float';
|
|
23
|
-
const
|
|
24
|
-
const
|
|
30
|
+
// const EXT_HALF_FLOAT_WEBGL1 = 'EXT_color_buffer_half_float';
|
|
31
|
+
// const DEPTH = 'WEBGL_depth_texture';
|
|
32
|
+
// WebGL1-only extensions
|
|
33
|
+
// const EXT_SRGB = 'EXT_sRGB'; // https://developer.mozilla.org/en-US/docs/Web/API/EXT_sRGB
|
|
34
|
+
// prettier-ignore
|
|
25
35
|
const TEXTURE_FEATURE_CHECKS = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'texture-compression-atc-webgl': gl => checkExtensions(gl, [X_ATC])
|
|
36
|
+
'float32-renderable-webgl': ['EXT_color_buffer_float'], // [false, 'EXT_color_buffer_float'],
|
|
37
|
+
'float16-renderable-webgl': ['EXT_color_buffer_half_float'],
|
|
38
|
+
'norm16-renderable-webgl': [EXT_TEXTURE_NORM16],
|
|
39
|
+
'float32-filterable-linear-webgl': ['OES_texture_float_linear'],
|
|
40
|
+
'float16-filterable-linear-webgl': ['OES_texture_half_float_linear'],
|
|
41
|
+
'texture-filterable-anisotropic-webgl': ['EXT_texture_filter_anisotropic'],
|
|
42
|
+
'texture-blend-float-webgl': ['EXT_float_blend'],
|
|
43
|
+
'texture-compression-bc': [X_S3TC, X_S3TC_SRGB, X_RGTC, X_BPTC],
|
|
44
|
+
// 'texture-compression-bc3-srgb-webgl': [X_S3TC_SRGB],
|
|
45
|
+
// 'texture-compression-bc3-webgl': [X_S3TC],
|
|
46
|
+
'texture-compression-bc5-webgl': [X_RGTC],
|
|
47
|
+
'texture-compression-bc7-webgl': [X_BPTC],
|
|
48
|
+
'texture-compression-etc2': [X_ETC2],
|
|
49
|
+
'texture-compression-astc': [X_ASTC],
|
|
50
|
+
'texture-compression-etc1-webgl': [X_ETC1],
|
|
51
|
+
'texture-compression-pvrtc-webgl': [X_PVRTC],
|
|
52
|
+
'texture-compression-atc-webgl': [X_ATC]
|
|
44
53
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
function checkTextureFeature(gl, feature) {
|
|
55
|
+
const extensions = TEXTURE_FEATURE_CHECKS[feature] || [];
|
|
56
|
+
return extensions.every(extension => gl.getExtension(extension));
|
|
48
57
|
}
|
|
49
|
-
|
|
58
|
+
function checkTextureFeatures(gl, features) {
|
|
59
|
+
return features.every(feature => checkTextureFeature(gl, feature));
|
|
60
|
+
}
|
|
61
|
+
/** Return a list of texture feature strings (for Device.features). Mainly compressed texture support */
|
|
50
62
|
export function getTextureFeatures(gl) {
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
const textureFeatures = Object.keys(TEXTURE_FEATURE_CHECKS);
|
|
64
|
+
return textureFeatures.filter(feature => checkTextureFeature(gl, feature));
|
|
53
65
|
}
|
|
66
|
+
// TABLES
|
|
67
|
+
/**
|
|
68
|
+
* Texture format data -
|
|
69
|
+
* Exported but can change without notice
|
|
70
|
+
*/
|
|
71
|
+
// prettier-ignore
|
|
54
72
|
export const TEXTURE_FORMATS = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
b: 4,
|
|
59
|
-
|
|
60
|
-
bpp: 4,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
gl:
|
|
66
|
-
|
|
67
|
-
b:
|
|
68
|
-
c:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
gl:
|
|
75
|
-
b: 1,
|
|
76
|
-
c: 1,
|
|
77
|
-
renderbuffer: true
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
gl:
|
|
81
|
-
b:
|
|
82
|
-
c:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
gl:
|
|
86
|
-
|
|
87
|
-
c:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
gl:
|
|
92
|
-
|
|
93
|
-
c:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
b: 2,
|
|
99
|
-
c: 2,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
gl:
|
|
104
|
-
|
|
105
|
-
c:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
gl:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
gl:
|
|
115
|
-
b: 2,
|
|
116
|
-
c:
|
|
117
|
-
renderbuffer: true
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
gl:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
gl:
|
|
127
|
-
b:
|
|
128
|
-
|
|
129
|
-
renderbuffer: true
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
gl:
|
|
133
|
-
|
|
134
|
-
c: 1,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
gl:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
x:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
gl:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
x:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
gl:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
gl:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
gl:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
gl:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
gl:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
gl:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
gl:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
gl:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
},
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
},
|
|
300
|
-
'rgb10a2unorm': {
|
|
301
|
-
gl: 32857,
|
|
302
|
-
b: 4,
|
|
303
|
-
c: 4,
|
|
304
|
-
p: 1,
|
|
305
|
-
renderbuffer: true
|
|
306
|
-
},
|
|
307
|
-
'rgb10a2unorm-webgl': {
|
|
308
|
-
b: 4,
|
|
309
|
-
c: 4,
|
|
310
|
-
gl: 36975,
|
|
311
|
-
p: 1,
|
|
312
|
-
wgpu: false,
|
|
313
|
-
bpp: 4,
|
|
314
|
-
renderbuffer: true
|
|
315
|
-
},
|
|
316
|
-
'rgb16unorm-webgl': {
|
|
317
|
-
gl: 32852,
|
|
318
|
-
b: 2,
|
|
319
|
-
c: 3,
|
|
320
|
-
f: 'texture-formats-norm16-webgl',
|
|
321
|
-
x: EXT_TEXTURE_NORM16
|
|
322
|
-
},
|
|
323
|
-
'rgb16snorm-webgl': {
|
|
324
|
-
gl: 36762,
|
|
325
|
-
b: 2,
|
|
326
|
-
c: 3,
|
|
327
|
-
f: 'texture-formats-norm16-webgl',
|
|
328
|
-
x: EXT_TEXTURE_NORM16
|
|
329
|
-
},
|
|
330
|
-
'rg32uint': {
|
|
331
|
-
gl: 33340,
|
|
332
|
-
b: 8,
|
|
333
|
-
c: 2,
|
|
334
|
-
renderbuffer: true
|
|
335
|
-
},
|
|
336
|
-
'rg32sint': {
|
|
337
|
-
gl: 33339,
|
|
338
|
-
b: 8,
|
|
339
|
-
c: 2,
|
|
340
|
-
renderbuffer: true
|
|
341
|
-
},
|
|
342
|
-
'rg32float': {
|
|
343
|
-
gl: 33328,
|
|
344
|
-
b: 8,
|
|
345
|
-
c: 2,
|
|
346
|
-
render: 'texture-renderable-float32-webgl',
|
|
347
|
-
filter: 'texture-filter-linear-float32-webgl',
|
|
348
|
-
renderbuffer: true
|
|
349
|
-
},
|
|
350
|
-
'rgba16uint': {
|
|
351
|
-
gl: 36214,
|
|
352
|
-
b: 8,
|
|
353
|
-
c: 4,
|
|
354
|
-
renderbuffer: true
|
|
355
|
-
},
|
|
356
|
-
'rgba16sint': {
|
|
357
|
-
gl: 36232,
|
|
358
|
-
b: 8,
|
|
359
|
-
c: 4,
|
|
360
|
-
renderbuffer: true
|
|
361
|
-
},
|
|
362
|
-
'rgba16float': {
|
|
363
|
-
gl: 34842,
|
|
364
|
-
gl1: 6408,
|
|
365
|
-
b: 8,
|
|
366
|
-
c: 4,
|
|
367
|
-
render: 'texture-renderable-float16-webgl',
|
|
368
|
-
filter: 'texture-filter-linear-float16-webgl'
|
|
369
|
-
},
|
|
370
|
-
'rgba16unorm-webgl': {
|
|
371
|
-
gl: 32859,
|
|
372
|
-
b: 2,
|
|
373
|
-
c: 4,
|
|
374
|
-
f: 'texture-formats-norm16-webgl',
|
|
375
|
-
renderbuffer: true,
|
|
376
|
-
x: EXT_TEXTURE_NORM16
|
|
377
|
-
},
|
|
378
|
-
'rgba16snorm-webgl': {
|
|
379
|
-
gl: 36763,
|
|
380
|
-
b: 2,
|
|
381
|
-
c: 4,
|
|
382
|
-
f: 'texture-formats-norm16-webgl',
|
|
383
|
-
x: EXT_TEXTURE_NORM16
|
|
384
|
-
},
|
|
385
|
-
'rgb32float-webgl': {
|
|
386
|
-
gl: 34837,
|
|
387
|
-
gl1: 6407,
|
|
388
|
-
render: 'texture-renderable-float32-webgl',
|
|
389
|
-
filter: 'texture-filter-linear-float32-webgl',
|
|
390
|
-
gl2ext: EXT_FLOAT_RENDER_WEBGL2,
|
|
391
|
-
gl1ext: EXT_FLOAT_WEBGL1,
|
|
392
|
-
dataFormat: 6407,
|
|
393
|
-
types: [5126]
|
|
394
|
-
},
|
|
395
|
-
'rgba32uint': {
|
|
396
|
-
gl: 36208,
|
|
397
|
-
b: 16,
|
|
398
|
-
c: 4,
|
|
399
|
-
renderbuffer: true
|
|
400
|
-
},
|
|
401
|
-
'rgba32sint': {
|
|
402
|
-
gl: 36226,
|
|
403
|
-
b: 16,
|
|
404
|
-
c: 4,
|
|
405
|
-
renderbuffer: true
|
|
406
|
-
},
|
|
407
|
-
'rgba32float': {
|
|
408
|
-
gl: 34836,
|
|
409
|
-
b: 16,
|
|
410
|
-
c: 4,
|
|
411
|
-
render: 'texture-renderable-float32-webgl',
|
|
412
|
-
filter: 'texture-filter-linear-float32-webgl',
|
|
413
|
-
renderbuffer: true
|
|
414
|
-
},
|
|
415
|
-
'stencil8': {
|
|
416
|
-
gl: 36168,
|
|
417
|
-
gl1: 36168,
|
|
418
|
-
b: 1,
|
|
419
|
-
c: 1,
|
|
420
|
-
attachment: 36128,
|
|
421
|
-
renderbuffer: true
|
|
422
|
-
},
|
|
423
|
-
'depth16unorm': {
|
|
424
|
-
gl: 33189,
|
|
425
|
-
gl1: 33189,
|
|
426
|
-
b: 2,
|
|
427
|
-
c: 1,
|
|
428
|
-
attachment: 36096,
|
|
429
|
-
renderbuffer: true
|
|
430
|
-
},
|
|
431
|
-
'depth24plus': {
|
|
432
|
-
gl: 33190,
|
|
433
|
-
b: 3,
|
|
434
|
-
c: 1,
|
|
435
|
-
attachment: 36096
|
|
436
|
-
},
|
|
437
|
-
'depth32float': {
|
|
438
|
-
gl: 36012,
|
|
439
|
-
b: 4,
|
|
440
|
-
c: 1,
|
|
441
|
-
attachment: 36096,
|
|
442
|
-
renderbuffer: true
|
|
443
|
-
},
|
|
444
|
-
'depth24plus-stencil8': {
|
|
445
|
-
gl: 34041,
|
|
446
|
-
gl1: 34041,
|
|
447
|
-
b: 4,
|
|
448
|
-
c: 2,
|
|
449
|
-
p: 1,
|
|
450
|
-
attachment: 33306,
|
|
451
|
-
renderbuffer: true,
|
|
452
|
-
depthTexture: true
|
|
453
|
-
},
|
|
454
|
-
'depth24unorm-stencil8': {
|
|
455
|
-
gl: 35056,
|
|
456
|
-
b: 4,
|
|
457
|
-
c: 2,
|
|
458
|
-
p: 1,
|
|
459
|
-
attachment: 33306,
|
|
460
|
-
renderbuffer: true
|
|
461
|
-
},
|
|
462
|
-
'depth32float-stencil8': {
|
|
463
|
-
gl: 36013,
|
|
464
|
-
b: 5,
|
|
465
|
-
c: 2,
|
|
466
|
-
p: 1,
|
|
467
|
-
attachment: 33306,
|
|
468
|
-
renderbuffer: true
|
|
469
|
-
},
|
|
470
|
-
'bc1-rgb-unorm-webgl': {
|
|
471
|
-
gl: 33776,
|
|
472
|
-
x: X_S3TC,
|
|
473
|
-
f: texture_compression_bc
|
|
474
|
-
},
|
|
475
|
-
'bc1-rgb-unorm-srgb-webgl': {
|
|
476
|
-
gl: 35916,
|
|
477
|
-
x: X_S3TC_SRGB,
|
|
478
|
-
f: texture_compression_bc
|
|
479
|
-
},
|
|
480
|
-
'bc1-rgba-unorm': {
|
|
481
|
-
gl: 33777,
|
|
482
|
-
x: X_S3TC,
|
|
483
|
-
f: texture_compression_bc
|
|
484
|
-
},
|
|
485
|
-
'bc1-rgba-unorm-srgb': {
|
|
486
|
-
gl: 35916,
|
|
487
|
-
x: X_S3TC_SRGB,
|
|
488
|
-
f: texture_compression_bc
|
|
489
|
-
},
|
|
490
|
-
'bc2-rgba-unorm': {
|
|
491
|
-
gl: 33778,
|
|
492
|
-
x: X_S3TC,
|
|
493
|
-
f: texture_compression_bc
|
|
494
|
-
},
|
|
495
|
-
'bc2-rgba-unorm-srgb': {
|
|
496
|
-
gl: 35918,
|
|
497
|
-
x: X_S3TC_SRGB,
|
|
498
|
-
f: texture_compression_bc
|
|
499
|
-
},
|
|
500
|
-
'bc3-rgba-unorm': {
|
|
501
|
-
gl: 33779,
|
|
502
|
-
x: X_S3TC,
|
|
503
|
-
f: texture_compression_bc
|
|
504
|
-
},
|
|
505
|
-
'bc3-rgba-unorm-srgb': {
|
|
506
|
-
gl: 35919,
|
|
507
|
-
x: X_S3TC_SRGB,
|
|
508
|
-
f: texture_compression_bc
|
|
509
|
-
},
|
|
510
|
-
'bc4-r-unorm': {
|
|
511
|
-
gl: 36283,
|
|
512
|
-
x: X_RGTC,
|
|
513
|
-
f: texture_compression_bc
|
|
514
|
-
},
|
|
515
|
-
'bc4-r-snorm': {
|
|
516
|
-
gl: 36284,
|
|
517
|
-
x: X_RGTC,
|
|
518
|
-
f: texture_compression_bc
|
|
519
|
-
},
|
|
520
|
-
'bc5-rg-unorm': {
|
|
521
|
-
gl: 36285,
|
|
522
|
-
x: X_RGTC,
|
|
523
|
-
f: texture_compression_bc
|
|
524
|
-
},
|
|
525
|
-
'bc5-rg-snorm': {
|
|
526
|
-
gl: 36286,
|
|
527
|
-
x: X_RGTC,
|
|
528
|
-
f: texture_compression_bc
|
|
529
|
-
},
|
|
530
|
-
'bc6h-rgb-ufloat': {
|
|
531
|
-
gl: 36495,
|
|
532
|
-
x: X_BPTC,
|
|
533
|
-
f: texture_compression_bc
|
|
534
|
-
},
|
|
535
|
-
'bc6h-rgb-float': {
|
|
536
|
-
gl: 36494,
|
|
537
|
-
x: X_BPTC,
|
|
538
|
-
f: texture_compression_bc
|
|
539
|
-
},
|
|
540
|
-
'bc7-rgba-unorm': {
|
|
541
|
-
gl: 36492,
|
|
542
|
-
x: X_BPTC,
|
|
543
|
-
f: texture_compression_bc
|
|
544
|
-
},
|
|
545
|
-
'bc7-rgba-unorm-srgb': {
|
|
546
|
-
gl: 36493,
|
|
547
|
-
x: X_BPTC,
|
|
548
|
-
f: texture_compression_bc
|
|
549
|
-
},
|
|
550
|
-
'etc2-rgb8unorm': {
|
|
551
|
-
gl: 37492,
|
|
552
|
-
f: texture_compression_etc2
|
|
553
|
-
},
|
|
554
|
-
'etc2-rgb8unorm-srgb': {
|
|
555
|
-
gl: 37494,
|
|
556
|
-
f: texture_compression_etc2
|
|
557
|
-
},
|
|
558
|
-
'etc2-rgb8a1unorm': {
|
|
559
|
-
gl: 37496,
|
|
560
|
-
f: texture_compression_etc2
|
|
561
|
-
},
|
|
562
|
-
'etc2-rgb8a1unorm-srgb': {
|
|
563
|
-
gl: 37497,
|
|
564
|
-
f: texture_compression_etc2
|
|
565
|
-
},
|
|
566
|
-
'etc2-rgba8unorm': {
|
|
567
|
-
gl: 37493,
|
|
568
|
-
f: texture_compression_etc2
|
|
569
|
-
},
|
|
570
|
-
'etc2-rgba8unorm-srgb': {
|
|
571
|
-
gl: 37495,
|
|
572
|
-
f: texture_compression_etc2
|
|
573
|
-
},
|
|
574
|
-
'eac-r11unorm': {
|
|
575
|
-
gl: 37488,
|
|
576
|
-
f: texture_compression_etc2
|
|
577
|
-
},
|
|
578
|
-
'eac-r11snorm': {
|
|
579
|
-
gl: 37489,
|
|
580
|
-
f: texture_compression_etc2
|
|
581
|
-
},
|
|
582
|
-
'eac-rg11unorm': {
|
|
583
|
-
gl: 37490,
|
|
584
|
-
f: texture_compression_etc2
|
|
585
|
-
},
|
|
586
|
-
'eac-rg11snorm': {
|
|
587
|
-
gl: 37491,
|
|
588
|
-
f: texture_compression_etc2
|
|
589
|
-
},
|
|
590
|
-
'astc-4x4-unorm': {
|
|
591
|
-
gl: 37808,
|
|
592
|
-
f: texture_compression_astc
|
|
593
|
-
},
|
|
594
|
-
'astc-4x4-unorm-srgb': {
|
|
595
|
-
gl: 37840,
|
|
596
|
-
f: texture_compression_astc
|
|
597
|
-
},
|
|
598
|
-
'astc-5x4-unorm': {
|
|
599
|
-
gl: 37809,
|
|
600
|
-
f: texture_compression_astc
|
|
601
|
-
},
|
|
602
|
-
'astc-5x4-unorm-srgb': {
|
|
603
|
-
gl: 37841,
|
|
604
|
-
f: texture_compression_astc
|
|
605
|
-
},
|
|
606
|
-
'astc-5x5-unorm': {
|
|
607
|
-
gl: 37810,
|
|
608
|
-
f: texture_compression_astc
|
|
609
|
-
},
|
|
610
|
-
'astc-5x5-unorm-srgb': {
|
|
611
|
-
gl: 37842,
|
|
612
|
-
f: texture_compression_astc
|
|
613
|
-
},
|
|
614
|
-
'astc-6x5-unorm': {
|
|
615
|
-
gl: 37811,
|
|
616
|
-
f: texture_compression_astc
|
|
617
|
-
},
|
|
618
|
-
'astc-6x5-unorm-srgb': {
|
|
619
|
-
gl: 37843,
|
|
620
|
-
f: texture_compression_astc
|
|
621
|
-
},
|
|
622
|
-
'astc-6x6-unorm': {
|
|
623
|
-
gl: 37812,
|
|
624
|
-
f: texture_compression_astc
|
|
625
|
-
},
|
|
626
|
-
'astc-6x6-unorm-srgb': {
|
|
627
|
-
gl: 37844,
|
|
628
|
-
f: texture_compression_astc
|
|
629
|
-
},
|
|
630
|
-
'astc-8x5-unorm': {
|
|
631
|
-
gl: 37813,
|
|
632
|
-
f: texture_compression_astc
|
|
633
|
-
},
|
|
634
|
-
'astc-8x5-unorm-srgb': {
|
|
635
|
-
gl: 37845,
|
|
636
|
-
f: texture_compression_astc
|
|
637
|
-
},
|
|
638
|
-
'astc-8x6-unorm': {
|
|
639
|
-
gl: 37814,
|
|
640
|
-
f: texture_compression_astc
|
|
641
|
-
},
|
|
642
|
-
'astc-8x6-unorm-srgb': {
|
|
643
|
-
gl: 37846,
|
|
644
|
-
f: texture_compression_astc
|
|
645
|
-
},
|
|
646
|
-
'astc-8x8-unorm': {
|
|
647
|
-
gl: 37815,
|
|
648
|
-
f: texture_compression_astc
|
|
649
|
-
},
|
|
650
|
-
'astc-8x8-unorm-srgb': {
|
|
651
|
-
gl: 37847,
|
|
652
|
-
f: texture_compression_astc
|
|
653
|
-
},
|
|
654
|
-
'astc-10x5-unorm': {
|
|
655
|
-
gl: 37819,
|
|
656
|
-
f: texture_compression_astc
|
|
657
|
-
},
|
|
658
|
-
'astc-10x5-unorm-srgb': {
|
|
659
|
-
gl: 37851,
|
|
660
|
-
f: texture_compression_astc
|
|
661
|
-
},
|
|
662
|
-
'astc-10x6-unorm': {
|
|
663
|
-
gl: 37817,
|
|
664
|
-
f: texture_compression_astc
|
|
665
|
-
},
|
|
666
|
-
'astc-10x6-unorm-srgb': {
|
|
667
|
-
gl: 37849,
|
|
668
|
-
f: texture_compression_astc
|
|
669
|
-
},
|
|
670
|
-
'astc-10x8-unorm': {
|
|
671
|
-
gl: 37818,
|
|
672
|
-
f: texture_compression_astc
|
|
673
|
-
},
|
|
674
|
-
'astc-10x8-unorm-srgb': {
|
|
675
|
-
gl: 37850,
|
|
676
|
-
f: texture_compression_astc
|
|
677
|
-
},
|
|
678
|
-
'astc-10x10-unorm': {
|
|
679
|
-
gl: 37819,
|
|
680
|
-
f: texture_compression_astc
|
|
681
|
-
},
|
|
682
|
-
'astc-10x10-unorm-srgb': {
|
|
683
|
-
gl: 37851,
|
|
684
|
-
f: texture_compression_astc
|
|
685
|
-
},
|
|
686
|
-
'astc-12x10-unorm': {
|
|
687
|
-
gl: 37820,
|
|
688
|
-
f: texture_compression_astc
|
|
689
|
-
},
|
|
690
|
-
'astc-12x10-unorm-srgb': {
|
|
691
|
-
gl: 37852,
|
|
692
|
-
f: texture_compression_astc
|
|
693
|
-
},
|
|
694
|
-
'astc-12x12-unorm': {
|
|
695
|
-
gl: 37821,
|
|
696
|
-
f: texture_compression_astc
|
|
697
|
-
},
|
|
698
|
-
'astc-12x12-unorm-srgb': {
|
|
699
|
-
gl: 37853,
|
|
700
|
-
f: texture_compression_astc
|
|
701
|
-
},
|
|
702
|
-
'pvrtc-rgb4unorm-webgl': {
|
|
703
|
-
gl: 35840,
|
|
704
|
-
f: texture_compression_pvrtc_webgl
|
|
705
|
-
},
|
|
706
|
-
'pvrtc-rgba4unorm-webgl': {
|
|
707
|
-
gl: 35842,
|
|
708
|
-
f: texture_compression_pvrtc_webgl
|
|
709
|
-
},
|
|
710
|
-
'pvrtc-rbg2unorm-webgl': {
|
|
711
|
-
gl: 35841,
|
|
712
|
-
f: texture_compression_pvrtc_webgl
|
|
713
|
-
},
|
|
714
|
-
'pvrtc-rgba2unorm-webgl': {
|
|
715
|
-
gl: 35843,
|
|
716
|
-
f: texture_compression_pvrtc_webgl
|
|
717
|
-
},
|
|
718
|
-
'etc1-rbg-unorm-webgl': {
|
|
719
|
-
gl: 36196,
|
|
720
|
-
f: texture_compression_etc1_webgl
|
|
721
|
-
},
|
|
722
|
-
'atc-rgb-unorm-webgl': {
|
|
723
|
-
gl: 35986,
|
|
724
|
-
f: texture_compression_atc_webgl
|
|
725
|
-
},
|
|
726
|
-
'atc-rgba-unorm-webgl': {
|
|
727
|
-
gl: 35986,
|
|
728
|
-
f: texture_compression_atc_webgl
|
|
729
|
-
},
|
|
730
|
-
'atc-rgbai-unorm-webgl': {
|
|
731
|
-
gl: 34798,
|
|
732
|
-
f: texture_compression_atc_webgl
|
|
733
|
-
}
|
|
73
|
+
// Unsized formats that leave the precision up to the driver.
|
|
74
|
+
// TODO - Fix bpp constants
|
|
75
|
+
// 'r8unorm-unsized': {gl: GL.LUMINANCE, b: 4, c: 2, bpp: 4},
|
|
76
|
+
'rgb8unorm-unsized': { gl: GL.RGB, b: 4, c: 2, bpp: 4,
|
|
77
|
+
dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_6_5] },
|
|
78
|
+
'rgba8unorm-unsized': { gl: GL.RGBA, b: 4, c: 2, bpp: 4,
|
|
79
|
+
dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_4_4_4_4, GL.UNSIGNED_SHORT_5_5_5_1] },
|
|
80
|
+
// 'rgb8unorm-srgb-unsized': {gl: GL.SRGB_EXT, b: 4, c: 2, bpp: 4, gl1Ext: SRGB},
|
|
81
|
+
// 'rgba8unorm-srgb-unsized': {gl: GL.SRGB_ALPHA_EXT, b: 4, c: 2, bpp: 4, gl1Ext: SRGB},
|
|
82
|
+
// 8-bit formats
|
|
83
|
+
'r8unorm': { gl: GL.R8, b: 1, c: 1, renderbuffer: true },
|
|
84
|
+
'r8snorm': { gl: GL.R8_SNORM, b: 1, c: 1 },
|
|
85
|
+
'r8uint': { gl: GL.R8UI, b: 1, c: 1, renderbuffer: true },
|
|
86
|
+
'r8sint': { gl: GL.R8I, b: 1, c: 1, renderbuffer: true },
|
|
87
|
+
// 16-bit formats
|
|
88
|
+
'rg8unorm': { gl: GL.RG8, b: 2, c: 2, renderbuffer: true },
|
|
89
|
+
'rg8snorm': { gl: GL.RG8_SNORM, b: 2, c: 2 },
|
|
90
|
+
'rg8uint': { gl: GL.RG8UI, b: 2, c: 2, renderbuffer: true },
|
|
91
|
+
'rg8sint': { gl: GL.RG8I, b: 2, c: 2, renderbuffer: true },
|
|
92
|
+
'r16uint': { gl: GL.R16UI, b: 2, c: 1, renderbuffer: true },
|
|
93
|
+
'r16sint': { gl: GL.R16I, b: 2, c: 1, renderbuffer: true },
|
|
94
|
+
'r16float': { gl: GL.R16F, b: 2, c: 1, render: 'float16-renderable-webgl', filter: 'float16-filterable-linear-webgl', renderbuffer: true },
|
|
95
|
+
'r16unorm-webgl': { gl: GL.R16_EXT, b: 2, c: 1, f: 'norm16-renderable-webgl', renderbuffer: true, x: EXT_TEXTURE_NORM16 },
|
|
96
|
+
'r16snorm-webgl': { gl: GL.R16_SNORM_EXT, b: 2, c: 1, f: 'norm16-renderable-webgl', x: EXT_TEXTURE_NORM16 },
|
|
97
|
+
// Packed 16-bit formats
|
|
98
|
+
'rgba4unorm-webgl': { gl: GL.RGBA4, b: 2, c: 4, wgpu: false, renderbuffer: true },
|
|
99
|
+
'rgb565unorm-webgl': { gl: GL.RGB565, b: 2, c: 4, wgpu: false, renderbuffer: true },
|
|
100
|
+
'rgb5a1unorm-webgl': { gl: GL.RGB5_A1, b: 2, c: 4, wgpu: false, renderbuffer: true },
|
|
101
|
+
// 24-bit formats
|
|
102
|
+
'rgb8unorm-webgl': { gl: GL.RGB8, b: 3, c: 3, wgpu: false },
|
|
103
|
+
'rgb8snorm-webgl': { gl: GL.RGB8_SNORM, b: 3, c: 3, wgpu: false },
|
|
104
|
+
// 32-bit formats
|
|
105
|
+
'rgba8unorm': { gl: GL.RGBA8, b: 4, c: 2, bpp: 4 },
|
|
106
|
+
'rgba8unorm-srgb': { gl: GL.SRGB8_ALPHA8, b: 4, c: 4, bpp: 4 },
|
|
107
|
+
'rgba8snorm': { gl: GL.RGBA8_SNORM, b: 4, c: 4 },
|
|
108
|
+
'rgba8uint': { gl: GL.RGBA8UI, b: 4, c: 4, bpp: 4 },
|
|
109
|
+
'rgba8sint': { gl: GL.RGBA8I, b: 4, c: 4, bpp: 4 },
|
|
110
|
+
// reverse colors, webgpu only
|
|
111
|
+
'bgra8unorm': { b: 4, c: 4 },
|
|
112
|
+
'bgra8unorm-srgb': { b: 4, c: 4 },
|
|
113
|
+
'rg16uint': { gl: GL.RG16UI, b: 4, c: 1, bpp: 4 },
|
|
114
|
+
'rg16sint': { gl: GL.RG16I, b: 4, c: 2, bpp: 4 },
|
|
115
|
+
// When using a WebGL 2 context and the EXT_color_buffer_float WebGL2 extension
|
|
116
|
+
'rg16float': { gl: GL.RG16F, bpp: 4, b: 4, c: 2, render: 'float16-renderable-webgl', filter: 'float16-filterable-linear-webgl', renderbuffer: true },
|
|
117
|
+
'rg16unorm-webgl': { gl: GL.RG16_EXT, b: 2, c: 2, f: 'norm16-renderable-webgl', x: EXT_TEXTURE_NORM16 },
|
|
118
|
+
'rg16snorm-webgl': { gl: GL.RG16_SNORM_EXT, b: 2, c: 2, f: 'norm16-renderable-webgl', x: EXT_TEXTURE_NORM16 },
|
|
119
|
+
'r32uint': { gl: GL.R32UI, b: 4, c: 1, bpp: 4, renderbuffer: true },
|
|
120
|
+
'r32sint': { gl: GL.R32I, b: 4, c: 1, bpp: 4, renderbuffer: true },
|
|
121
|
+
'r32float': { gl: GL.R32F, bpp: 4, b: 4, c: 1, render: 'float32-renderable-webgl', filter: 'float32-filterable-linear-webgl' },
|
|
122
|
+
// Packed 32-bit formats
|
|
123
|
+
'rgb9e5ufloat': { gl: GL.RGB9_E5, b: 4, c: 3, p: 1, render: 'float16-renderable-webgl', filter: 'float16-filterable-linear-webgl' },
|
|
124
|
+
'rg11b10ufloat': { gl: GL.R11F_G11F_B10F, b: 4, c: 3, p: 1, render: 'float32-renderable-webgl', renderbuffer: true },
|
|
125
|
+
'rgb10a2unorm': { gl: GL.RGB10_A2, b: 4, c: 4, p: 1, renderbuffer: true },
|
|
126
|
+
'rgb10a2unorm-webgl': { b: 4, c: 4, gl: GL.RGB10_A2UI, p: 1, wgpu: false, bpp: 4, renderbuffer: true },
|
|
127
|
+
// 48-bit formats
|
|
128
|
+
'rgb16unorm-webgl': { gl: GL.RGB16_EXT, b: 2, c: 3, f: 'norm16-renderable-webgl', x: EXT_TEXTURE_NORM16 },
|
|
129
|
+
'rgb16snorm-webgl': { gl: GL.RGB16_SNORM_EXT, b: 2, c: 3, f: 'norm16-renderable-webgl', x: EXT_TEXTURE_NORM16 },
|
|
130
|
+
// 64-bit formats
|
|
131
|
+
'rg32uint': { gl: GL.RG32UI, b: 8, c: 2, renderbuffer: true },
|
|
132
|
+
'rg32sint': { gl: GL.RG32I, b: 8, c: 2, renderbuffer: true },
|
|
133
|
+
'rg32float': { gl: GL.RG32F, b: 8, c: 2, render: 'float32-renderable-webgl', filter: 'float32-filterable-linear-webgl', renderbuffer: true },
|
|
134
|
+
'rgba16uint': { gl: GL.RGBA16UI, b: 8, c: 4, renderbuffer: true },
|
|
135
|
+
'rgba16sint': { gl: GL.RGBA16I, b: 8, c: 4, renderbuffer: true },
|
|
136
|
+
'rgba16float': { gl: GL.RGBA16F, b: 8, c: 4, render: 'float16-renderable-webgl', filter: 'float16-filterable-linear-webgl' },
|
|
137
|
+
'rgba16unorm-webgl': { gl: GL.RGBA16_EXT, b: 2, c: 4, f: 'norm16-renderable-webgl', renderbuffer: true, x: EXT_TEXTURE_NORM16 },
|
|
138
|
+
'rgba16snorm-webgl': { gl: GL.RGBA16_SNORM_EXT, b: 2, c: 4, f: 'norm16-renderable-webgl', x: EXT_TEXTURE_NORM16 },
|
|
139
|
+
// 96-bit formats (deprecated!)
|
|
140
|
+
'rgb32float-webgl': { gl: GL.RGB32F, render: 'float32-renderable-webgl', filter: 'float32-filterable-linear-webgl',
|
|
141
|
+
gl2ext: EXT_FLOAT_RENDER_WEBGL2, dataFormat: GL.RGB, types: [GL.FLOAT] },
|
|
142
|
+
// 128-bit formats
|
|
143
|
+
'rgba32uint': { gl: GL.RGBA32UI, b: 16, c: 4, renderbuffer: true },
|
|
144
|
+
'rgba32sint': { gl: GL.RGBA32I, b: 16, c: 4, renderbuffer: true },
|
|
145
|
+
'rgba32float': { gl: GL.RGBA32F, b: 16, c: 4, render: 'float32-renderable-webgl', filter: 'float32-filterable-linear-webgl', renderbuffer: true },
|
|
146
|
+
// Depth and stencil formats
|
|
147
|
+
'stencil8': { gl: GL.STENCIL_INDEX8, b: 1, c: 1, attachment: GL.STENCIL_ATTACHMENT, renderbuffer: true }, // 8 stencil bits
|
|
148
|
+
'depth16unorm': { gl: GL.DEPTH_COMPONENT16, b: 2, c: 1, attachment: GL.DEPTH_ATTACHMENT, renderbuffer: true }, // 16 depth bits
|
|
149
|
+
'depth24plus': { gl: GL.DEPTH_COMPONENT24, b: 3, c: 1, attachment: GL.DEPTH_ATTACHMENT },
|
|
150
|
+
'depth32float': { gl: GL.DEPTH_COMPONENT32F, b: 4, c: 1, attachment: GL.DEPTH_ATTACHMENT, renderbuffer: true },
|
|
151
|
+
// The depth component of the "depth24plus" and "depth24plus-stencil8" formats may be implemented as either a 24-bit depth value or a "depth32float" value.
|
|
152
|
+
'depth24plus-stencil8': { gl: GL.DEPTH_STENCIL, b: 4, c: 2, p: 1, attachment: GL.DEPTH_STENCIL_ATTACHMENT, renderbuffer: true, depthTexture: true },
|
|
153
|
+
// "depth24unorm-stencil8" feature
|
|
154
|
+
'depth24unorm-stencil8': { gl: GL.DEPTH24_STENCIL8, b: 4, c: 2, p: 1, attachment: GL.DEPTH_STENCIL_ATTACHMENT, renderbuffer: true },
|
|
155
|
+
// "depth32float-stencil8" feature
|
|
156
|
+
'depth32float-stencil8': { gl: GL.DEPTH32F_STENCIL8, b: 5, c: 2, p: 1, attachment: GL.DEPTH_STENCIL_ATTACHMENT, renderbuffer: true },
|
|
157
|
+
// BC compressed formats: check device.features.has("texture-compression-bc");
|
|
158
|
+
'bc1-rgb-unorm-webgl': { gl: GL.COMPRESSED_RGB_S3TC_DXT1_EXT, x: X_S3TC, f: texture_compression_bc },
|
|
159
|
+
'bc1-rgb-unorm-srgb-webgl': { gl: GL.COMPRESSED_SRGB_S3TC_DXT1_EXT, x: X_S3TC_SRGB, f: texture_compression_bc },
|
|
160
|
+
'bc1-rgba-unorm': { gl: GL.COMPRESSED_RGBA_S3TC_DXT1_EXT, x: X_S3TC, f: texture_compression_bc },
|
|
161
|
+
'bc1-rgba-unorm-srgb': { gl: GL.COMPRESSED_SRGB_S3TC_DXT1_EXT, x: X_S3TC_SRGB, f: texture_compression_bc },
|
|
162
|
+
'bc2-rgba-unorm': { gl: GL.COMPRESSED_RGBA_S3TC_DXT3_EXT, x: X_S3TC, f: texture_compression_bc },
|
|
163
|
+
'bc2-rgba-unorm-srgb': { gl: GL.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, x: X_S3TC_SRGB, f: texture_compression_bc },
|
|
164
|
+
'bc3-rgba-unorm': { gl: GL.COMPRESSED_RGBA_S3TC_DXT5_EXT, x: X_S3TC, f: texture_compression_bc },
|
|
165
|
+
'bc3-rgba-unorm-srgb': { gl: GL.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, x: X_S3TC_SRGB, f: texture_compression_bc },
|
|
166
|
+
'bc4-r-unorm': { gl: GL.COMPRESSED_RED_RGTC1_EXT, x: X_RGTC, f: texture_compression_bc },
|
|
167
|
+
'bc4-r-snorm': { gl: GL.COMPRESSED_SIGNED_RED_RGTC1_EXT, x: X_RGTC, f: texture_compression_bc },
|
|
168
|
+
'bc5-rg-unorm': { gl: GL.COMPRESSED_RED_GREEN_RGTC2_EXT, x: X_RGTC, f: texture_compression_bc },
|
|
169
|
+
'bc5-rg-snorm': { gl: GL.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT, x: X_RGTC, f: texture_compression_bc },
|
|
170
|
+
'bc6h-rgb-ufloat': { gl: GL.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, x: X_BPTC, f: texture_compression_bc },
|
|
171
|
+
'bc6h-rgb-float': { gl: GL.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, x: X_BPTC, f: texture_compression_bc },
|
|
172
|
+
'bc7-rgba-unorm': { gl: GL.COMPRESSED_RGBA_BPTC_UNORM_EXT, x: X_BPTC, f: texture_compression_bc },
|
|
173
|
+
'bc7-rgba-unorm-srgb': { gl: GL.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, x: X_BPTC, f: texture_compression_bc },
|
|
174
|
+
// WEBGL_compressed_texture_etc: device.features.has("texture-compression-etc2")
|
|
175
|
+
// Note: Supposedly guaranteed availability compressed formats in WebGL2, but through CPU decompression
|
|
176
|
+
'etc2-rgb8unorm': { gl: GL.COMPRESSED_RGB8_ETC2, f: texture_compression_etc2 },
|
|
177
|
+
'etc2-rgb8unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ETC2, f: texture_compression_etc2 },
|
|
178
|
+
'etc2-rgb8a1unorm': { gl: GL.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, f: texture_compression_etc2 },
|
|
179
|
+
'etc2-rgb8a1unorm-srgb': { gl: GL.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, f: texture_compression_etc2 },
|
|
180
|
+
'etc2-rgba8unorm': { gl: GL.COMPRESSED_RGBA8_ETC2_EAC, f: texture_compression_etc2 },
|
|
181
|
+
'etc2-rgba8unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, f: texture_compression_etc2 },
|
|
182
|
+
'eac-r11unorm': { gl: GL.COMPRESSED_R11_EAC, f: texture_compression_etc2 },
|
|
183
|
+
'eac-r11snorm': { gl: GL.COMPRESSED_SIGNED_R11_EAC, f: texture_compression_etc2 },
|
|
184
|
+
'eac-rg11unorm': { gl: GL.COMPRESSED_RG11_EAC, f: texture_compression_etc2 },
|
|
185
|
+
'eac-rg11snorm': { gl: GL.COMPRESSED_SIGNED_RG11_EAC, f: texture_compression_etc2 },
|
|
186
|
+
// X_ASTC compressed formats: device.features.has("texture-compression-astc")
|
|
187
|
+
'astc-4x4-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_4x4_KHR, f: texture_compression_astc },
|
|
188
|
+
'astc-4x4-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, f: texture_compression_astc },
|
|
189
|
+
'astc-5x4-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_5x4_KHR, f: texture_compression_astc },
|
|
190
|
+
'astc-5x4-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, f: texture_compression_astc },
|
|
191
|
+
'astc-5x5-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_5x5_KHR, f: texture_compression_astc },
|
|
192
|
+
'astc-5x5-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, f: texture_compression_astc },
|
|
193
|
+
'astc-6x5-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_6x5_KHR, f: texture_compression_astc },
|
|
194
|
+
'astc-6x5-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, f: texture_compression_astc },
|
|
195
|
+
'astc-6x6-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_6x6_KHR, f: texture_compression_astc },
|
|
196
|
+
'astc-6x6-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, f: texture_compression_astc },
|
|
197
|
+
'astc-8x5-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_8x5_KHR, f: texture_compression_astc },
|
|
198
|
+
'astc-8x5-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, f: texture_compression_astc },
|
|
199
|
+
'astc-8x6-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_8x6_KHR, f: texture_compression_astc },
|
|
200
|
+
'astc-8x6-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, f: texture_compression_astc },
|
|
201
|
+
'astc-8x8-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_8x8_KHR, f: texture_compression_astc },
|
|
202
|
+
'astc-8x8-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, f: texture_compression_astc },
|
|
203
|
+
'astc-10x5-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_10x10_KHR, f: texture_compression_astc },
|
|
204
|
+
'astc-10x5-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, f: texture_compression_astc },
|
|
205
|
+
'astc-10x6-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_10x6_KHR, f: texture_compression_astc },
|
|
206
|
+
'astc-10x6-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, f: texture_compression_astc },
|
|
207
|
+
'astc-10x8-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_10x8_KHR, f: texture_compression_astc },
|
|
208
|
+
'astc-10x8-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, f: texture_compression_astc },
|
|
209
|
+
'astc-10x10-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_10x10_KHR, f: texture_compression_astc },
|
|
210
|
+
'astc-10x10-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, f: texture_compression_astc },
|
|
211
|
+
'astc-12x10-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_12x10_KHR, f: texture_compression_astc },
|
|
212
|
+
'astc-12x10-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, f: texture_compression_astc },
|
|
213
|
+
'astc-12x12-unorm': { gl: GL.COMPRESSED_RGBA_ASTC_12x12_KHR, f: texture_compression_astc },
|
|
214
|
+
'astc-12x12-unorm-srgb': { gl: GL.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, f: texture_compression_astc },
|
|
215
|
+
// WEBGL_compressed_texture_pvrtc
|
|
216
|
+
'pvrtc-rgb4unorm-webgl': { gl: GL.COMPRESSED_RGB_PVRTC_4BPPV1_IMG, f: texture_compression_pvrtc_webgl },
|
|
217
|
+
'pvrtc-rgba4unorm-webgl': { gl: GL.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, f: texture_compression_pvrtc_webgl },
|
|
218
|
+
'pvrtc-rbg2unorm-webgl': { gl: GL.COMPRESSED_RGB_PVRTC_2BPPV1_IMG, f: texture_compression_pvrtc_webgl },
|
|
219
|
+
'pvrtc-rgba2unorm-webgl': { gl: GL.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, f: texture_compression_pvrtc_webgl },
|
|
220
|
+
// WEBGL_compressed_texture_etc1
|
|
221
|
+
'etc1-rbg-unorm-webgl': { gl: GL.COMPRESSED_RGB_ETC1_WEBGL, f: texture_compression_etc1_webgl },
|
|
222
|
+
// WEBGL_compressed_texture_atc
|
|
223
|
+
'atc-rgb-unorm-webgl': { gl: GL.COMPRESSED_RGB_ATC_WEBGL, f: texture_compression_atc_webgl },
|
|
224
|
+
'atc-rgba-unorm-webgl': { gl: GL.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL, f: texture_compression_atc_webgl },
|
|
225
|
+
'atc-rgbai-unorm-webgl': { gl: GL.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL, f: texture_compression_atc_webgl }
|
|
226
|
+
};
|
|
227
|
+
/** Legal combinations for internalFormat, format and type *
|
|
228
|
+
// [GL.DEPTH_COMPONENT]: {types: [GL.UNSIGNED_SHORT, GL.UNSIGNED_INT, GL.UNSIGNED_INT_24_8]},
|
|
229
|
+
// [GL.DEPTH_STENCIL]: ,
|
|
230
|
+
// Sized texture format
|
|
231
|
+
// R
|
|
232
|
+
[GL.R8]: {dataFormat: GL.RED, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
233
|
+
[GL.R16F]: {dataFormat: GL.RED, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},
|
|
234
|
+
[GL.R8UI]: {dataFormat: GL.RED_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
235
|
+
// // RG
|
|
236
|
+
[GL.RG8]: {dataFormat: GL.RG, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
237
|
+
[GL.RG16F]: {dataFormat: GL.RG, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},
|
|
238
|
+
[GL.RG8UI]: {dataFormat: GL.RG_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
239
|
+
// // RGB
|
|
240
|
+
[GL.RGB8]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
241
|
+
[GL.SRGB8]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
242
|
+
[GL.RGB16F]: {dataFormat: GL.RGB, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},
|
|
243
|
+
[GL.RGB8UI]: {dataFormat: GL.RGB_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
244
|
+
// // RGBA
|
|
245
|
+
|
|
246
|
+
[GL.RGB565]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_6_5], gl2: true},
|
|
247
|
+
[GL.R11F_G11F_B10F]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_INT_10F_11F_11F_REV, GL.HALF_FLOAT, GL.FLOAT], gl2: true},
|
|
248
|
+
[GL.RGB9_E5]: {dataFormat: GL.RGB, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},
|
|
249
|
+
[GL.RGBA8]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE], gl2: true},
|
|
250
|
+
[GL.SRGB8_ALPHA8]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE], gl2: true, gl1ext: EXT_SRGB},
|
|
251
|
+
[GL.RGB5_A1]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_5_5_1], gl2: true},
|
|
252
|
+
[GL.RGBA4]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_4_4_4_4], gl2: true},
|
|
253
|
+
[GL.RGBA16F]: {dataFormat: GL.RGBA, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},
|
|
254
|
+
[GL.RGBA8UI]: {dataFormat: GL.RGBA_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true}
|
|
255
|
+
*/
|
|
256
|
+
/* This table is now baked into the above table
|
|
257
|
+
type RenderbufferFormat = {
|
|
258
|
+
bpp: number;
|
|
259
|
+
gl2?: boolean;
|
|
260
|
+
ext?: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const RENDERBUFFER_FORMATS: Record<string, RenderbufferFormat> = {
|
|
264
|
+
[GL.DEPTH_COMPONENT16]: {bpp: 2}, // 16 depth bits.
|
|
265
|
+
// TODO - Not clear which webgpu value to map this to.
|
|
266
|
+
// [GL.DEPTH_COMPONENT24]: {gl2: true, bpp: 3},
|
|
267
|
+
[GL.DEPTH_COMPONENT32F]: {gl2: true, bpp: 4},
|
|
268
|
+
|
|
269
|
+
[GL.STENCIL_INDEX8]: {bpp: 1}, // 8 stencil bits.
|
|
270
|
+
|
|
271
|
+
[GL.DEPTH_STENCIL]: {bpp: 4},
|
|
272
|
+
[GL.DEPTH24_STENCIL8]: {gl2: true, bpp: 4},
|
|
273
|
+
[GL.DEPTH32F_STENCIL8]: {gl2: true, bpp: 5},
|
|
274
|
+
|
|
275
|
+
// When using a WebGL 1 context, color renderbuffer formats are limited
|
|
276
|
+
[GL.RGBA4]: {gl2: true, bpp: 2},
|
|
277
|
+
[GL.RGB565]: {gl2: true, bpp: 2},
|
|
278
|
+
[GL.RGB5_A1]: {gl2: true, bpp: 2},
|
|
279
|
+
|
|
280
|
+
// When using a WebGL 2 context, the following values are available additionally:
|
|
281
|
+
[GL.R8]: {gl2: true, bpp: 1},
|
|
282
|
+
[GL.R8UI]: {gl2: true, bpp: 1},
|
|
283
|
+
[GL.R8I]: {gl2: true, bpp: 1},
|
|
284
|
+
[GL.R16UI]: {gl2: true, bpp: 2},
|
|
285
|
+
[GL.R16I]: {gl2: true, bpp: 2},
|
|
286
|
+
[GL.R32UI]: {gl2: true, bpp: 4},
|
|
287
|
+
[GL.R32I]: {gl2: true, bpp: 4},
|
|
288
|
+
[GL.RG8]: {gl2: true, bpp: 2},
|
|
289
|
+
[GL.RG8UI]: {gl2: true, bpp: 2},
|
|
290
|
+
[GL.RG8I]: {gl2: true, bpp: 2},
|
|
291
|
+
[GL.RG16UI]: {gl2: true, bpp: 4},
|
|
292
|
+
[GL.RG16I]: {gl2: true, bpp: 4},
|
|
293
|
+
[GL.RG32UI]: {gl2: true, bpp: 8},
|
|
294
|
+
[GL.RG32I]: {gl2: true, bpp: 8},
|
|
295
|
+
[GL.RGB8]: {gl2: true, bpp: 3},
|
|
296
|
+
[GL.RGBA8]: {gl2: true, bpp: 4},
|
|
297
|
+
// [GL.SRGB8_ALPHA8]: {gl2: true, gl1: SRGB}, // When using the EXT_sRGB WebGL1 extension
|
|
298
|
+
[GL.RGB10_A2]: {gl2: true, bpp: 4},
|
|
299
|
+
[GL.RGBA8UI]: {gl2: true, bpp: 4},
|
|
300
|
+
[GL.RGBA8I]: {gl2: true, bpp: 4},
|
|
301
|
+
[GL.RGB10_A2UI]: {gl2: true, bpp: 4},
|
|
302
|
+
[GL.RGBA16UI]: {gl2: true, bpp: 8},
|
|
303
|
+
[GL.RGBA16I]: {gl2: true, bpp: 8},
|
|
304
|
+
[GL.RGBA32I]: {gl2: true, bpp: 16},
|
|
305
|
+
[GL.RGBA32UI]: {gl2: true, bpp: 16},
|
|
306
|
+
|
|
307
|
+
// When using a WebGL 2 context and the EXT_color_buffer_float WebGL2 extension
|
|
308
|
+
[GL.R16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 2},
|
|
309
|
+
[GL.RG16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4},
|
|
310
|
+
[GL.RGBA16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 8},
|
|
311
|
+
[GL.R32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4},
|
|
312
|
+
[GL.RG32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 8},
|
|
313
|
+
// TODO - can't get WEBGL_color_buffer_float to work on renderbuffers
|
|
314
|
+
[GL.RGBA32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 16},
|
|
315
|
+
// [GL.RGBA32F]: {ext: EXT_FLOAT_WEBGL2, gl1: EXT_FLOAT_WEBGL1},
|
|
316
|
+
[GL.R11F_G11F_B10F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4}
|
|
734
317
|
};
|
|
318
|
+
*/
|
|
319
|
+
/** @deprecated should be removed */
|
|
735
320
|
const DATA_FORMAT_CHANNELS = {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
321
|
+
[GL.RED]: 1,
|
|
322
|
+
[GL.RED_INTEGER]: 1,
|
|
323
|
+
[GL.RG]: 2,
|
|
324
|
+
[GL.RG_INTEGER]: 2,
|
|
325
|
+
[GL.RGB]: 3,
|
|
326
|
+
[GL.RGB_INTEGER]: 3,
|
|
327
|
+
[GL.RGBA]: 4,
|
|
328
|
+
[GL.RGBA_INTEGER]: 4,
|
|
329
|
+
[GL.DEPTH_COMPONENT]: 1,
|
|
330
|
+
[GL.DEPTH_STENCIL]: 1,
|
|
331
|
+
[GL.ALPHA]: 1,
|
|
332
|
+
[GL.LUMINANCE]: 1,
|
|
333
|
+
[GL.LUMINANCE_ALPHA]: 2
|
|
749
334
|
};
|
|
335
|
+
/** @deprecated should be removed */
|
|
750
336
|
const TYPE_SIZES = {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
337
|
+
[GL.FLOAT]: 4,
|
|
338
|
+
[GL.UNSIGNED_INT]: 4,
|
|
339
|
+
[GL.INT]: 4,
|
|
340
|
+
[GL.UNSIGNED_SHORT]: 2,
|
|
341
|
+
[GL.SHORT]: 2,
|
|
342
|
+
[GL.HALF_FLOAT]: 2,
|
|
343
|
+
[GL.BYTE]: 1,
|
|
344
|
+
[GL.UNSIGNED_BYTE]: 1
|
|
759
345
|
};
|
|
346
|
+
// FUNCTIONS
|
|
347
|
+
/** Checks if a texture format is supported */
|
|
760
348
|
export function isTextureFormatSupported(gl, formatOrGL) {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
349
|
+
const format = convertGLToTextureFormat(formatOrGL);
|
|
350
|
+
const info = TEXTURE_FORMATS[format];
|
|
351
|
+
if (!info) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
// Check that we have a GL constant
|
|
355
|
+
if (info.gl === undefined) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
// Check extensions
|
|
359
|
+
const extension = info.x || info.gl2ext;
|
|
360
|
+
if (extension) {
|
|
361
|
+
return Boolean(gl.getExtension(extension));
|
|
362
|
+
}
|
|
363
|
+
return true;
|
|
774
364
|
}
|
|
775
365
|
export function isRenderbufferFormatSupported(gl, format) {
|
|
776
|
-
|
|
777
|
-
|
|
366
|
+
// Note: Order is important since the function call initializes extensions.
|
|
367
|
+
return isTextureFormatSupported(gl, format) && TEXTURE_FORMATS[format]?.renderbuffer;
|
|
778
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Map WebGL texture formats (GL constants) to WebGPU-style TextureFormat strings
|
|
371
|
+
*/
|
|
779
372
|
export function convertGLToTextureFormat(format) {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
throw new Error(`Unknown texture format ${format}`);
|
|
789
|
-
}
|
|
790
|
-
return entry[0];
|
|
373
|
+
if (typeof format === 'string') {
|
|
374
|
+
return format;
|
|
375
|
+
}
|
|
376
|
+
const entry = Object.entries(TEXTURE_FORMATS).find(([, entry]) => entry.gl === format);
|
|
377
|
+
if (!entry) {
|
|
378
|
+
throw new Error(`Unknown texture format ${format}`);
|
|
379
|
+
}
|
|
380
|
+
return entry[0];
|
|
791
381
|
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
382
|
+
/**
|
|
383
|
+
* Map WebGPU style texture format strings to GL constants
|
|
384
|
+
*/
|
|
385
|
+
export function convertTextureFormatToGL(format) {
|
|
386
|
+
const formatInfo = TEXTURE_FORMATS[format];
|
|
387
|
+
const webglFormat = formatInfo?.gl;
|
|
388
|
+
if (webglFormat === undefined) {
|
|
389
|
+
throw new Error(`Unsupported texture format ${format}`);
|
|
390
|
+
}
|
|
391
|
+
return webglFormat;
|
|
799
392
|
}
|
|
393
|
+
/** Checks if a texture format is supported */
|
|
800
394
|
export function getTextureFormatSupport(gl, formatOrGL) {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
395
|
+
const format = convertGLToTextureFormat(formatOrGL);
|
|
396
|
+
const info = TEXTURE_FORMATS[format];
|
|
397
|
+
if (!info) {
|
|
398
|
+
return { supported: false };
|
|
399
|
+
}
|
|
400
|
+
// let decoded;
|
|
401
|
+
// try {
|
|
402
|
+
// decoded = decodeTextureFormat(format);
|
|
403
|
+
// } catch {}
|
|
404
|
+
// Support Check that we have a GL constant
|
|
405
|
+
let supported = info.gl === undefined;
|
|
406
|
+
supported = supported && checkTextureFeatures(gl, [info.f]);
|
|
407
|
+
// Filtering
|
|
408
|
+
// const filterable = info.filter
|
|
409
|
+
// ? checkTextureFeatures(gl, [info.filter])
|
|
410
|
+
// : decoded && !decoded.signed;
|
|
411
|
+
// const renderable = info.filter
|
|
412
|
+
// ? checkTextureFeatures(gl, [info.render])
|
|
413
|
+
// : decoded && !decoded.signed;
|
|
804
414
|
return {
|
|
805
|
-
|
|
415
|
+
supported,
|
|
416
|
+
renderable: supported && checkTextureFeatures(gl, [info.render]),
|
|
417
|
+
filterable: supported && checkTextureFeatures(gl, [info.filter]),
|
|
418
|
+
blendable: false, // tod,
|
|
419
|
+
storable: false
|
|
806
420
|
};
|
|
807
|
-
}
|
|
808
|
-
let supported = isWebGL2(gl) ? info.gl === undefined : info.gl1 === undefined;
|
|
809
|
-
supported = supported && checkTextureFeatures(gl, [info.f]);
|
|
810
|
-
return {
|
|
811
|
-
supported,
|
|
812
|
-
renderable: supported && checkTextureFeatures(gl, [info.render]),
|
|
813
|
-
filterable: supported && checkTextureFeatures(gl, [info.filter]),
|
|
814
|
-
blendable: false,
|
|
815
|
-
storable: false
|
|
816
|
-
};
|
|
817
421
|
}
|
|
422
|
+
/** Checks whether linear filtering (interpolated sampling) is available for floating point textures */
|
|
818
423
|
export function isTextureFormatFilterable(gl, formatOrGL) {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
424
|
+
const format = convertGLToTextureFormat(formatOrGL);
|
|
425
|
+
if (!isTextureFormatSupported(gl, format)) {
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
try {
|
|
429
|
+
const decoded = decodeTextureFormat(format);
|
|
430
|
+
if (decoded.signed) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
827
433
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
434
|
+
catch {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
if (format.endsWith('32float')) {
|
|
438
|
+
return Boolean(gl.getExtension('OES_texture_float_linear'));
|
|
439
|
+
}
|
|
440
|
+
if (format.endsWith('16float')) {
|
|
441
|
+
return Boolean(gl.getExtension('OES_texture_half_float_linear'));
|
|
442
|
+
}
|
|
443
|
+
return true;
|
|
838
444
|
}
|
|
839
445
|
export function isTextureFormatRenderable(gl, formatOrGL) {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
446
|
+
const format = convertGLToTextureFormat(formatOrGL);
|
|
447
|
+
if (!isTextureFormatSupported(gl, format)) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
if (typeof format === 'number') {
|
|
451
|
+
return false; // isTextureFormatFilterableWebGL(gl, format);
|
|
452
|
+
}
|
|
453
|
+
// TODO depends on device...
|
|
454
|
+
return true;
|
|
848
455
|
}
|
|
849
|
-
export function getWebGLTextureParameters(formatOrGL
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
456
|
+
export function getWebGLTextureParameters(formatOrGL) {
|
|
457
|
+
const format = convertGLToTextureFormat(formatOrGL);
|
|
458
|
+
const webglFormat = convertTextureFormatToGL(format);
|
|
459
|
+
const decoded = decodeTextureFormat(format);
|
|
460
|
+
return {
|
|
461
|
+
format: webglFormat,
|
|
462
|
+
dataFormat: getWebGLPixelDataFormat(decoded.format, decoded.integer, decoded.normalized, webglFormat),
|
|
463
|
+
// depth formats don't have a type
|
|
464
|
+
type: decoded.dataType ? getGLFromVertexType(decoded.dataType) : GL.UNSIGNED_BYTE,
|
|
465
|
+
// @ts-expect-error
|
|
466
|
+
compressed: decoded.compressed
|
|
467
|
+
};
|
|
859
468
|
}
|
|
860
469
|
export function getDepthStencilAttachmentWebGL(format) {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
}
|
|
867
|
-
export function _checkFloat32ColorAttachment(gl) {
|
|
868
|
-
let internalFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6408;
|
|
869
|
-
let srcFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6408;
|
|
870
|
-
let srcType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5121;
|
|
871
|
-
let texture = null;
|
|
872
|
-
let framebuffer = null;
|
|
873
|
-
try {
|
|
874
|
-
texture = gl.createTexture();
|
|
875
|
-
gl.bindTexture(3553, texture);
|
|
876
|
-
const level = 0;
|
|
877
|
-
const width = 1;
|
|
878
|
-
const height = 1;
|
|
879
|
-
const border = 0;
|
|
880
|
-
const pixel = new Uint8Array([0, 0, 255, 255]);
|
|
881
|
-
gl.texImage2D(3553, level, internalFormat, width, height, border, srcFormat, srcType, pixel);
|
|
882
|
-
framebuffer = gl.createFramebuffer();
|
|
883
|
-
gl.bindFramebuffer(36160, framebuffer);
|
|
884
|
-
gl.framebufferTexture2D(36160, 36064, 3553, texture, 0);
|
|
885
|
-
const status = gl.checkFramebufferStatus(36160) === 36053;
|
|
886
|
-
gl.bindTexture(3553, null);
|
|
887
|
-
return status;
|
|
888
|
-
} finally {
|
|
889
|
-
gl.deleteTexture(texture);
|
|
890
|
-
gl.deleteFramebuffer(framebuffer);
|
|
891
|
-
}
|
|
470
|
+
const info = TEXTURE_FORMATS[format];
|
|
471
|
+
if (!info?.attachment) {
|
|
472
|
+
throw new Error(`${format} is not a depth stencil format`);
|
|
473
|
+
}
|
|
474
|
+
return info.attachment;
|
|
892
475
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
476
|
+
/** TODO - VERY roundabout legacy way of calculating bytes per pixel */
|
|
477
|
+
export function getTextureFormatBytesPerPixel(formatOrGL) {
|
|
478
|
+
// TODO remove webgl1 support
|
|
479
|
+
const format = convertGLToTextureFormat(formatOrGL);
|
|
480
|
+
const params = getWebGLTextureParameters(format);
|
|
481
|
+
// NOTE(Tarek): Default to RGBA bytes
|
|
482
|
+
const channels = DATA_FORMAT_CHANNELS[params.dataFormat] || 4;
|
|
483
|
+
const channelSize = TYPE_SIZES[params.type] || 1;
|
|
484
|
+
return channels * channelSize;
|
|
899
485
|
}
|
|
486
|
+
// DATA TYPE HELPERS
|
|
900
487
|
function getWebGLPixelDataFormat(dataFormat, integer, normalized, format) {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
default:
|
|
914
|
-
return 6408;
|
|
915
|
-
}
|
|
488
|
+
// WebGL1 formats use same internalFormat
|
|
489
|
+
if (format === GL.RGBA || format === GL.RGB) {
|
|
490
|
+
return format;
|
|
491
|
+
}
|
|
492
|
+
// prettier-ignore
|
|
493
|
+
switch (dataFormat) {
|
|
494
|
+
case 'r': return integer && !normalized ? GL.RED_INTEGER : GL.RED;
|
|
495
|
+
case 'rg': return integer && !normalized ? GL.RG_INTEGER : GL.RG;
|
|
496
|
+
case 'rgb': return integer && !normalized ? GL.RGB_INTEGER : GL.RGB;
|
|
497
|
+
case 'rgba': return integer && !normalized ? GL.RGBA_INTEGER : GL.RGBA;
|
|
498
|
+
default: return GL.RGBA;
|
|
499
|
+
}
|
|
916
500
|
}
|
|
917
|
-
//# sourceMappingURL=texture-formats.js.map
|