@luma.gl/webgl 9.0.0-alpha.46 → 9.0.0-alpha.48
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 +34 -0
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +73 -40
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +60 -61
- package/dist/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/adapter/converters/shader-formats.js +12 -13
- package/dist/adapter/converters/shader-formats.js.map +1 -1
- package/dist/adapter/converters/texture-formats.js +179 -180
- package/dist/adapter/converters/texture-formats.js.map +1 -1
- package/dist/adapter/converters/vertex-formats.js +20 -21
- package/dist/adapter/converters/vertex-formats.js.map +1 -1
- package/dist/adapter/device-helpers/device-features.js +2 -2
- package/dist/adapter/device-helpers/device-features.js.map +1 -1
- package/dist/adapter/device-helpers/device-limits.js +53 -54
- package/dist/adapter/device-helpers/device-limits.js.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
- package/dist/adapter/device-helpers/get-device-info.js +23 -12
- package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
- package/dist/adapter/helpers/decode-webgl-types.js +31 -32
- package/dist/adapter/helpers/decode-webgl-types.js.map +1 -1
- package/dist/adapter/helpers/get-shader-layout.js +29 -30
- package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
- package/dist/adapter/helpers/parse-shader-compiler-log.js +16 -4
- package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +40 -41
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js +38 -39
- package/dist/adapter/helpers/webgl-topology-utils.js.map +1 -1
- package/dist/adapter/objects/webgl-renderbuffer.js +5 -6
- package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +14 -15
- package/dist/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +25 -26
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +22 -23
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +2 -3
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +7 -8
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +2 -3
- package/dist/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +3 -4
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +27 -28
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.d.ts +5 -11
- package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js +16 -13
- package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.d.ts +2 -2
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +5 -6
- package/dist/adapter/resources/webgl-vertex-array.js.map +1 -1
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/classic/accessor.js +4 -5
- package/dist/classic/accessor.js.map +1 -1
- package/dist/classic/copy-and-blit.js +16 -17
- package/dist/classic/copy-and-blit.js.map +1 -1
- package/dist/classic/format-utils.js +14 -15
- package/dist/classic/format-utils.js.map +1 -1
- package/dist/classic/typed-array-utils.d.ts +2 -0
- package/dist/classic/typed-array-utils.d.ts.map +1 -1
- package/dist/classic/typed-array-utils.js +18 -19
- package/dist/classic/typed-array-utils.js.map +1 -1
- package/dist/context/debug/webgl-developer-tools.js +0 -1
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +256 -257
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/context/polyfill/get-parameter-polyfill.js +34 -35
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
- package/dist/context/polyfill/polyfill-table.js +9 -10
- package/dist/context/polyfill/polyfill-table.js.map +1 -1
- package/dist/context/polyfill/polyfill-vertex-array-object.js +17 -17
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
- package/dist/dist.dev.js +987 -2700
- package/dist/index.cjs +390 -267
- package/dist.min.js +39 -28
- package/package.json +5 -5
- package/src/adapter/converters/device-parameters.ts +40 -25
- package/src/adapter/device-helpers/get-device-info.ts +36 -8
- package/src/adapter/helpers/parse-shader-compiler-log.ts +21 -7
- package/src/adapter/resources/webgl-transform-feedback.ts +13 -16
- package/src/adapter/resources/webgl-vertex-array.ts +4 -3
- package/src/adapter/webgl-device.ts +3 -2
- package/src/classic/typed-array-utils.ts +2 -0
|
@@ -1,99 +1,98 @@
|
|
|
1
|
-
import { GL } from '@luma.gl/constants';
|
|
2
1
|
import { isWebGL2 } from "../context/webgl-checks.js";
|
|
3
2
|
export const GL_PARAMETER_DEFAULTS = {
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
3
|
+
[3042]: false,
|
|
4
|
+
[32773]: new Float32Array([0, 0, 0, 0]),
|
|
5
|
+
[32777]: 32774,
|
|
6
|
+
[34877]: 32774,
|
|
7
|
+
[32969]: 1,
|
|
8
|
+
[32968]: 0,
|
|
9
|
+
[32971]: 1,
|
|
10
|
+
[32970]: 0,
|
|
11
|
+
[3106]: new Float32Array([0, 0, 0, 0]),
|
|
12
|
+
[3107]: [true, true, true, true],
|
|
13
|
+
[2884]: false,
|
|
14
|
+
[2885]: 1029,
|
|
15
|
+
[2929]: false,
|
|
16
|
+
[2931]: 1,
|
|
17
|
+
[2932]: 513,
|
|
18
|
+
[2928]: new Float32Array([0, 1]),
|
|
19
|
+
[2930]: true,
|
|
20
|
+
[3024]: true,
|
|
21
|
+
[35725]: null,
|
|
22
|
+
[36006]: null,
|
|
23
|
+
[36007]: null,
|
|
24
|
+
[34229]: null,
|
|
25
|
+
[34964]: null,
|
|
26
|
+
[2886]: 2305,
|
|
27
|
+
[33170]: 4352,
|
|
28
|
+
[2849]: 1,
|
|
29
|
+
[32823]: false,
|
|
30
|
+
[32824]: 0,
|
|
31
|
+
[10752]: 0,
|
|
32
|
+
[32926]: false,
|
|
33
|
+
[32928]: false,
|
|
34
|
+
[32938]: 1.0,
|
|
35
|
+
[32939]: false,
|
|
36
|
+
[3089]: false,
|
|
37
|
+
[3088]: new Int32Array([0, 0, 1024, 1024]),
|
|
38
|
+
[2960]: false,
|
|
39
|
+
[2961]: 0,
|
|
40
|
+
[2968]: 0xffffffff,
|
|
41
|
+
[36005]: 0xffffffff,
|
|
42
|
+
[2962]: 519,
|
|
43
|
+
[2967]: 0,
|
|
44
|
+
[2963]: 0xffffffff,
|
|
45
|
+
[34816]: 519,
|
|
46
|
+
[36003]: 0,
|
|
47
|
+
[36004]: 0xffffffff,
|
|
48
|
+
[2964]: 7680,
|
|
49
|
+
[2965]: 7680,
|
|
50
|
+
[2966]: 7680,
|
|
51
|
+
[34817]: 7680,
|
|
52
|
+
[34818]: 7680,
|
|
53
|
+
[34819]: 7680,
|
|
54
|
+
[2978]: [0, 0, 1024, 1024],
|
|
55
|
+
[3333]: 4,
|
|
56
|
+
[3317]: 4,
|
|
57
|
+
[37440]: false,
|
|
58
|
+
[37441]: false,
|
|
59
|
+
[37443]: 37444,
|
|
60
|
+
[36389]: null,
|
|
61
|
+
[36662]: null,
|
|
62
|
+
[36663]: null,
|
|
63
|
+
[35053]: null,
|
|
64
|
+
[35055]: null,
|
|
65
|
+
[35723]: 4352,
|
|
66
|
+
[36010]: null,
|
|
67
|
+
[35977]: false,
|
|
68
|
+
[3330]: 0,
|
|
69
|
+
[3332]: 0,
|
|
70
|
+
[3331]: 0,
|
|
71
|
+
[3314]: 0,
|
|
72
|
+
[32878]: 0,
|
|
73
|
+
[3316]: 0,
|
|
74
|
+
[3315]: 0,
|
|
75
|
+
[32877]: 0
|
|
77
76
|
};
|
|
78
77
|
const enable = (gl, value, key) => value ? gl.enable(key) : gl.disable(key);
|
|
79
78
|
const hint = (gl, value, key) => gl.hint(key, value);
|
|
80
79
|
const pixelStorei = (gl, value, key) => gl.pixelStorei(key, value);
|
|
81
80
|
const bindFramebuffer = (gl, value, key) => {
|
|
82
81
|
let target;
|
|
83
|
-
if (key ===
|
|
84
|
-
target = isWebGL2(gl) ?
|
|
82
|
+
if (key === 36006) {
|
|
83
|
+
target = isWebGL2(gl) ? 36009 : 36160;
|
|
85
84
|
} else {
|
|
86
|
-
target =
|
|
85
|
+
target = 36008;
|
|
87
86
|
}
|
|
88
87
|
return gl.bindFramebuffer(target, value);
|
|
89
88
|
};
|
|
90
89
|
const bindBuffer = (gl, value, key) => {
|
|
91
90
|
const bindingMap = {
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
[
|
|
95
|
-
[
|
|
96
|
-
[
|
|
91
|
+
[34964]: 34962,
|
|
92
|
+
[36662]: 36662,
|
|
93
|
+
[36663]: 36663,
|
|
94
|
+
[35053]: 35051,
|
|
95
|
+
[35055]: 35052
|
|
97
96
|
};
|
|
98
97
|
const glTarget = bindingMap[key];
|
|
99
98
|
gl.bindBuffer(glTarget, value);
|
|
@@ -102,87 +101,87 @@ function isArray(array) {
|
|
|
102
101
|
return Array.isArray(array) || ArrayBuffer.isView(array) && !(array instanceof DataView);
|
|
103
102
|
}
|
|
104
103
|
export const GL_PARAMETER_SETTERS = {
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
[
|
|
108
|
-
[
|
|
109
|
-
[
|
|
110
|
-
[
|
|
111
|
-
[
|
|
112
|
-
[
|
|
113
|
-
[
|
|
114
|
-
[
|
|
115
|
-
[
|
|
116
|
-
[
|
|
117
|
-
[
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
[
|
|
126
|
-
[
|
|
104
|
+
[3042]: enable,
|
|
105
|
+
[32773]: (gl, value) => gl.blendColor(...value),
|
|
106
|
+
[32777]: 'blendEquation',
|
|
107
|
+
[34877]: 'blendEquation',
|
|
108
|
+
[32969]: 'blendFunc',
|
|
109
|
+
[32968]: 'blendFunc',
|
|
110
|
+
[32971]: 'blendFunc',
|
|
111
|
+
[32970]: 'blendFunc',
|
|
112
|
+
[3106]: (gl, value) => gl.clearColor(...value),
|
|
113
|
+
[3107]: (gl, value) => gl.colorMask(...value),
|
|
114
|
+
[2884]: enable,
|
|
115
|
+
[2885]: (gl, value) => gl.cullFace(value),
|
|
116
|
+
[2929]: enable,
|
|
117
|
+
[2931]: (gl, value) => gl.clearDepth(value),
|
|
118
|
+
[2932]: (gl, value) => gl.depthFunc(value),
|
|
119
|
+
[2928]: (gl, value) => gl.depthRange(...value),
|
|
120
|
+
[2930]: (gl, value) => gl.depthMask(value),
|
|
121
|
+
[3024]: enable,
|
|
122
|
+
[35723]: hint,
|
|
123
|
+
[35725]: (gl, value) => gl.useProgram(value),
|
|
124
|
+
[36007]: (gl, value) => gl.bindRenderbuffer(36161, value),
|
|
125
|
+
[36389]: (gl, value) => {
|
|
127
126
|
var _bindTransformFeedbac, _ref;
|
|
128
|
-
return (_bindTransformFeedbac = (_ref = gl).bindTransformFeedback) === null || _bindTransformFeedbac === void 0 ? void 0 : _bindTransformFeedbac.call(_ref,
|
|
127
|
+
return (_bindTransformFeedbac = (_ref = gl).bindTransformFeedback) === null || _bindTransformFeedbac === void 0 ? void 0 : _bindTransformFeedbac.call(_ref, 36386, value);
|
|
129
128
|
},
|
|
130
|
-
[
|
|
131
|
-
[
|
|
132
|
-
[
|
|
133
|
-
[
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
[
|
|
137
|
-
[
|
|
138
|
-
[
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
142
|
-
[
|
|
143
|
-
[
|
|
144
|
-
[
|
|
145
|
-
[
|
|
146
|
-
[
|
|
147
|
-
[
|
|
148
|
-
[
|
|
149
|
-
[
|
|
150
|
-
[
|
|
151
|
-
[
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
[
|
|
156
|
-
[
|
|
157
|
-
[
|
|
158
|
-
[
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
[
|
|
164
|
-
[
|
|
165
|
-
[
|
|
166
|
-
[
|
|
167
|
-
[
|
|
168
|
-
[
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
176
|
-
[
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[
|
|
180
|
-
[
|
|
129
|
+
[34229]: (gl, value) => gl.bindVertexArray(value),
|
|
130
|
+
[36006]: bindFramebuffer,
|
|
131
|
+
[36010]: bindFramebuffer,
|
|
132
|
+
[34964]: bindBuffer,
|
|
133
|
+
[36662]: bindBuffer,
|
|
134
|
+
[36663]: bindBuffer,
|
|
135
|
+
[35053]: bindBuffer,
|
|
136
|
+
[35055]: bindBuffer,
|
|
137
|
+
[2886]: (gl, value) => gl.frontFace(value),
|
|
138
|
+
[33170]: hint,
|
|
139
|
+
[2849]: (gl, value) => gl.lineWidth(value),
|
|
140
|
+
[32823]: enable,
|
|
141
|
+
[32824]: 'polygonOffset',
|
|
142
|
+
[10752]: 'polygonOffset',
|
|
143
|
+
[35977]: enable,
|
|
144
|
+
[32926]: enable,
|
|
145
|
+
[32928]: enable,
|
|
146
|
+
[32938]: 'sampleCoverage',
|
|
147
|
+
[32939]: 'sampleCoverage',
|
|
148
|
+
[3089]: enable,
|
|
149
|
+
[3088]: (gl, value) => gl.scissor(...value),
|
|
150
|
+
[2960]: enable,
|
|
151
|
+
[2961]: (gl, value) => gl.clearStencil(value),
|
|
152
|
+
[2968]: (gl, value) => gl.stencilMaskSeparate(1028, value),
|
|
153
|
+
[36005]: (gl, value) => gl.stencilMaskSeparate(1029, value),
|
|
154
|
+
[2962]: 'stencilFuncFront',
|
|
155
|
+
[2967]: 'stencilFuncFront',
|
|
156
|
+
[2963]: 'stencilFuncFront',
|
|
157
|
+
[34816]: 'stencilFuncBack',
|
|
158
|
+
[36003]: 'stencilFuncBack',
|
|
159
|
+
[36004]: 'stencilFuncBack',
|
|
160
|
+
[2964]: 'stencilOpFront',
|
|
161
|
+
[2965]: 'stencilOpFront',
|
|
162
|
+
[2966]: 'stencilOpFront',
|
|
163
|
+
[34817]: 'stencilOpBack',
|
|
164
|
+
[34818]: 'stencilOpBack',
|
|
165
|
+
[34819]: 'stencilOpBack',
|
|
166
|
+
[2978]: (gl, value) => gl.viewport(...value),
|
|
167
|
+
[3333]: pixelStorei,
|
|
168
|
+
[3317]: pixelStorei,
|
|
169
|
+
[37440]: pixelStorei,
|
|
170
|
+
[37441]: pixelStorei,
|
|
171
|
+
[37443]: pixelStorei,
|
|
172
|
+
[3330]: pixelStorei,
|
|
173
|
+
[3332]: pixelStorei,
|
|
174
|
+
[3331]: pixelStorei,
|
|
175
|
+
[3314]: pixelStorei,
|
|
176
|
+
[32878]: pixelStorei,
|
|
177
|
+
[3316]: pixelStorei,
|
|
178
|
+
[3315]: pixelStorei,
|
|
179
|
+
[32877]: pixelStorei,
|
|
181
180
|
framebuffer: (gl, framebuffer) => {
|
|
182
181
|
const handle = framebuffer && 'handle' in framebuffer ? framebuffer.handle : framebuffer;
|
|
183
|
-
return gl.bindFramebuffer(
|
|
182
|
+
return gl.bindFramebuffer(36160, handle);
|
|
184
183
|
},
|
|
185
|
-
blend: (gl, value) => value ? gl.enable(
|
|
184
|
+
blend: (gl, value) => value ? gl.enable(3042) : gl.disable(3042),
|
|
186
185
|
blendColor: (gl, value) => gl.blendColor(...value),
|
|
187
186
|
blendEquation: (gl, args) => {
|
|
188
187
|
const separateModes = typeof args === 'number' ? [args, args] : args;
|
|
@@ -196,42 +195,42 @@ export const GL_PARAMETER_SETTERS = {
|
|
|
196
195
|
clearDepth: (gl, value) => gl.clearDepth(value),
|
|
197
196
|
clearStencil: (gl, value) => gl.clearStencil(value),
|
|
198
197
|
colorMask: (gl, value) => gl.colorMask(...value),
|
|
199
|
-
cull: (gl, value) => value ? gl.enable(
|
|
198
|
+
cull: (gl, value) => value ? gl.enable(2884) : gl.disable(2884),
|
|
200
199
|
cullFace: (gl, value) => gl.cullFace(value),
|
|
201
|
-
depthTest: (gl, value) => value ? gl.enable(
|
|
200
|
+
depthTest: (gl, value) => value ? gl.enable(2929) : gl.disable(2929),
|
|
202
201
|
depthFunc: (gl, value) => gl.depthFunc(value),
|
|
203
202
|
depthMask: (gl, value) => gl.depthMask(value),
|
|
204
203
|
depthRange: (gl, value) => gl.depthRange(...value),
|
|
205
|
-
dither: (gl, value) => value ? gl.enable(
|
|
204
|
+
dither: (gl, value) => value ? gl.enable(3024) : gl.disable(3024),
|
|
206
205
|
derivativeHint: (gl, value) => {
|
|
207
|
-
gl.hint(
|
|
206
|
+
gl.hint(35723, value);
|
|
208
207
|
},
|
|
209
208
|
frontFace: (gl, value) => gl.frontFace(value),
|
|
210
|
-
mipmapHint: (gl, value) => gl.hint(
|
|
209
|
+
mipmapHint: (gl, value) => gl.hint(33170, value),
|
|
211
210
|
lineWidth: (gl, value) => gl.lineWidth(value),
|
|
212
|
-
polygonOffsetFill: (gl, value) => value ? gl.enable(
|
|
211
|
+
polygonOffsetFill: (gl, value) => value ? gl.enable(32823) : gl.disable(32823),
|
|
213
212
|
polygonOffset: (gl, value) => gl.polygonOffset(...value),
|
|
214
213
|
sampleCoverage: (gl, value) => gl.sampleCoverage(...value),
|
|
215
|
-
scissorTest: (gl, value) => value ? gl.enable(
|
|
214
|
+
scissorTest: (gl, value) => value ? gl.enable(3089) : gl.disable(3089),
|
|
216
215
|
scissor: (gl, value) => gl.scissor(...value),
|
|
217
|
-
stencilTest: (gl, value) => value ? gl.enable(
|
|
216
|
+
stencilTest: (gl, value) => value ? gl.enable(2960) : gl.disable(2960),
|
|
218
217
|
stencilMask: (gl, value) => {
|
|
219
218
|
value = isArray(value) ? value : [value, value];
|
|
220
219
|
const [mask, backMask] = value;
|
|
221
|
-
gl.stencilMaskSeparate(
|
|
222
|
-
gl.stencilMaskSeparate(
|
|
220
|
+
gl.stencilMaskSeparate(1028, mask);
|
|
221
|
+
gl.stencilMaskSeparate(1029, backMask);
|
|
223
222
|
},
|
|
224
223
|
stencilFunc: (gl, args) => {
|
|
225
224
|
args = isArray(args) && args.length === 3 ? [...args, ...args] : args;
|
|
226
225
|
const [func, ref, mask, backFunc, backRef, backMask] = args;
|
|
227
|
-
gl.stencilFuncSeparate(
|
|
228
|
-
gl.stencilFuncSeparate(
|
|
226
|
+
gl.stencilFuncSeparate(1028, func, ref, mask);
|
|
227
|
+
gl.stencilFuncSeparate(1029, backFunc, backRef, backMask);
|
|
229
228
|
},
|
|
230
229
|
stencilOp: (gl, args) => {
|
|
231
230
|
args = isArray(args) && args.length === 3 ? [...args, ...args] : args;
|
|
232
231
|
const [sfail, dpfail, dppass, backSfail, backDpfail, backDppass] = args;
|
|
233
|
-
gl.stencilOpSeparate(
|
|
234
|
-
gl.stencilOpSeparate(
|
|
232
|
+
gl.stencilOpSeparate(1028, sfail, dpfail, dppass);
|
|
233
|
+
gl.stencilOpSeparate(1029, backSfail, backDpfail, backDppass);
|
|
235
234
|
},
|
|
236
235
|
viewport: (gl, value) => gl.viewport(...value)
|
|
237
236
|
};
|
|
@@ -239,14 +238,14 @@ function getValue(glEnum, values, cache) {
|
|
|
239
238
|
return values[glEnum] !== undefined ? values[glEnum] : cache[glEnum];
|
|
240
239
|
}
|
|
241
240
|
export const GL_COMPOSITE_PARAMETER_SETTERS = {
|
|
242
|
-
blendEquation: (gl, values, cache) => gl.blendEquationSeparate(getValue(
|
|
243
|
-
blendFunc: (gl, values, cache) => gl.blendFuncSeparate(getValue(
|
|
244
|
-
polygonOffset: (gl, values, cache) => gl.polygonOffset(getValue(
|
|
245
|
-
sampleCoverage: (gl, values, cache) => gl.sampleCoverage(getValue(
|
|
246
|
-
stencilFuncFront: (gl, values, cache) => gl.stencilFuncSeparate(
|
|
247
|
-
stencilFuncBack: (gl, values, cache) => gl.stencilFuncSeparate(
|
|
248
|
-
stencilOpFront: (gl, values, cache) => gl.stencilOpSeparate(
|
|
249
|
-
stencilOpBack: (gl, values, cache) => gl.stencilOpSeparate(
|
|
241
|
+
blendEquation: (gl, values, cache) => gl.blendEquationSeparate(getValue(32777, values, cache), getValue(34877, values, cache)),
|
|
242
|
+
blendFunc: (gl, values, cache) => gl.blendFuncSeparate(getValue(32969, values, cache), getValue(32968, values, cache), getValue(32971, values, cache), getValue(32970, values, cache)),
|
|
243
|
+
polygonOffset: (gl, values, cache) => gl.polygonOffset(getValue(32824, values, cache), getValue(10752, values, cache)),
|
|
244
|
+
sampleCoverage: (gl, values, cache) => gl.sampleCoverage(getValue(32938, values, cache), getValue(32939, values, cache)),
|
|
245
|
+
stencilFuncFront: (gl, values, cache) => gl.stencilFuncSeparate(1028, getValue(2962, values, cache), getValue(2967, values, cache), getValue(2963, values, cache)),
|
|
246
|
+
stencilFuncBack: (gl, values, cache) => gl.stencilFuncSeparate(1029, getValue(34816, values, cache), getValue(36003, values, cache), getValue(36004, values, cache)),
|
|
247
|
+
stencilOpFront: (gl, values, cache) => gl.stencilOpSeparate(1028, getValue(2964, values, cache), getValue(2965, values, cache), getValue(2966, values, cache)),
|
|
248
|
+
stencilOpBack: (gl, values, cache) => gl.stencilOpSeparate(1029, getValue(34817, values, cache), getValue(34818, values, cache), getValue(34819, values, cache))
|
|
250
249
|
};
|
|
251
250
|
export const GL_HOOKED_SETTERS = {
|
|
252
251
|
enable: (update, capability) => update({
|
|
@@ -262,31 +261,31 @@ export const GL_HOOKED_SETTERS = {
|
|
|
262
261
|
[pname]: hint
|
|
263
262
|
}),
|
|
264
263
|
useProgram: (update, value) => update({
|
|
265
|
-
[
|
|
264
|
+
[35725]: value
|
|
266
265
|
}),
|
|
267
266
|
bindRenderbuffer: (update, target, value) => update({
|
|
268
|
-
[
|
|
267
|
+
[36007]: value
|
|
269
268
|
}),
|
|
270
269
|
bindTransformFeedback: (update, target, value) => update({
|
|
271
|
-
[
|
|
270
|
+
[36389]: value
|
|
272
271
|
}),
|
|
273
272
|
bindVertexArray: (update, value) => update({
|
|
274
|
-
[
|
|
273
|
+
[34229]: value
|
|
275
274
|
}),
|
|
276
275
|
bindFramebuffer: (update, target, framebuffer) => {
|
|
277
276
|
switch (target) {
|
|
278
|
-
case
|
|
277
|
+
case 36160:
|
|
279
278
|
return update({
|
|
280
|
-
[
|
|
281
|
-
[
|
|
279
|
+
[36006]: framebuffer,
|
|
280
|
+
[36010]: framebuffer
|
|
282
281
|
});
|
|
283
|
-
case
|
|
282
|
+
case 36009:
|
|
284
283
|
return update({
|
|
285
|
-
[
|
|
284
|
+
[36006]: framebuffer
|
|
286
285
|
});
|
|
287
|
-
case
|
|
286
|
+
case 36008:
|
|
288
287
|
return update({
|
|
289
|
-
[
|
|
288
|
+
[36010]: framebuffer
|
|
290
289
|
});
|
|
291
290
|
default:
|
|
292
291
|
return null;
|
|
@@ -294,11 +293,11 @@ export const GL_HOOKED_SETTERS = {
|
|
|
294
293
|
},
|
|
295
294
|
bindBuffer: (update, target, buffer) => {
|
|
296
295
|
const pname = {
|
|
297
|
-
[
|
|
298
|
-
[
|
|
299
|
-
[
|
|
300
|
-
[
|
|
301
|
-
[
|
|
296
|
+
[34962]: [34964],
|
|
297
|
+
[36662]: [36662],
|
|
298
|
+
[36663]: [36663],
|
|
299
|
+
[35051]: [35053],
|
|
300
|
+
[35052]: [35055]
|
|
302
301
|
}[target];
|
|
303
302
|
if (pname) {
|
|
304
303
|
return update({
|
|
@@ -310,118 +309,118 @@ export const GL_HOOKED_SETTERS = {
|
|
|
310
309
|
};
|
|
311
310
|
},
|
|
312
311
|
blendColor: (update, r, g, b, a) => update({
|
|
313
|
-
[
|
|
312
|
+
[32773]: new Float32Array([r, g, b, a])
|
|
314
313
|
}),
|
|
315
314
|
blendEquation: (update, mode) => update({
|
|
316
|
-
[
|
|
317
|
-
[
|
|
315
|
+
[32777]: mode,
|
|
316
|
+
[34877]: mode
|
|
318
317
|
}),
|
|
319
318
|
blendEquationSeparate: (update, modeRGB, modeAlpha) => update({
|
|
320
|
-
[
|
|
321
|
-
[
|
|
319
|
+
[32777]: modeRGB,
|
|
320
|
+
[34877]: modeAlpha
|
|
322
321
|
}),
|
|
323
322
|
blendFunc: (update, src, dst) => update({
|
|
324
|
-
[
|
|
325
|
-
[
|
|
326
|
-
[
|
|
327
|
-
[
|
|
323
|
+
[32969]: src,
|
|
324
|
+
[32968]: dst,
|
|
325
|
+
[32971]: src,
|
|
326
|
+
[32970]: dst
|
|
328
327
|
}),
|
|
329
328
|
blendFuncSeparate: (update, srcRGB, dstRGB, srcAlpha, dstAlpha) => update({
|
|
330
|
-
[
|
|
331
|
-
[
|
|
332
|
-
[
|
|
333
|
-
[
|
|
329
|
+
[32969]: srcRGB,
|
|
330
|
+
[32968]: dstRGB,
|
|
331
|
+
[32971]: srcAlpha,
|
|
332
|
+
[32970]: dstAlpha
|
|
334
333
|
}),
|
|
335
334
|
clearColor: (update, r, g, b, a) => update({
|
|
336
|
-
[
|
|
335
|
+
[3106]: new Float32Array([r, g, b, a])
|
|
337
336
|
}),
|
|
338
337
|
clearDepth: (update, depth) => update({
|
|
339
|
-
[
|
|
338
|
+
[2931]: depth
|
|
340
339
|
}),
|
|
341
340
|
clearStencil: (update, s) => update({
|
|
342
|
-
[
|
|
341
|
+
[2961]: s
|
|
343
342
|
}),
|
|
344
343
|
colorMask: (update, r, g, b, a) => update({
|
|
345
|
-
[
|
|
344
|
+
[3107]: [r, g, b, a]
|
|
346
345
|
}),
|
|
347
346
|
cullFace: (update, mode) => update({
|
|
348
|
-
[
|
|
347
|
+
[2885]: mode
|
|
349
348
|
}),
|
|
350
349
|
depthFunc: (update, func) => update({
|
|
351
|
-
[
|
|
350
|
+
[2932]: func
|
|
352
351
|
}),
|
|
353
352
|
depthRange: (update, zNear, zFar) => update({
|
|
354
|
-
[
|
|
353
|
+
[2928]: new Float32Array([zNear, zFar])
|
|
355
354
|
}),
|
|
356
355
|
depthMask: (update, mask) => update({
|
|
357
|
-
[
|
|
356
|
+
[2930]: mask
|
|
358
357
|
}),
|
|
359
358
|
frontFace: (update, face) => update({
|
|
360
|
-
[
|
|
359
|
+
[2886]: face
|
|
361
360
|
}),
|
|
362
361
|
lineWidth: (update, width) => update({
|
|
363
|
-
[
|
|
362
|
+
[2849]: width
|
|
364
363
|
}),
|
|
365
364
|
polygonOffset: (update, factor, units) => update({
|
|
366
|
-
[
|
|
367
|
-
[
|
|
365
|
+
[32824]: factor,
|
|
366
|
+
[10752]: units
|
|
368
367
|
}),
|
|
369
368
|
sampleCoverage: (update, value, invert) => update({
|
|
370
|
-
[
|
|
371
|
-
[
|
|
369
|
+
[32938]: value,
|
|
370
|
+
[32939]: invert
|
|
372
371
|
}),
|
|
373
372
|
scissor: (update, x, y, width, height) => update({
|
|
374
|
-
[
|
|
373
|
+
[3088]: new Int32Array([x, y, width, height])
|
|
375
374
|
}),
|
|
376
375
|
stencilMask: (update, mask) => update({
|
|
377
|
-
[
|
|
378
|
-
[
|
|
376
|
+
[2968]: mask,
|
|
377
|
+
[36005]: mask
|
|
379
378
|
}),
|
|
380
379
|
stencilMaskSeparate: (update, face, mask) => update({
|
|
381
|
-
[face ===
|
|
380
|
+
[face === 1028 ? 2968 : 36005]: mask
|
|
382
381
|
}),
|
|
383
382
|
stencilFunc: (update, func, ref, mask) => update({
|
|
384
|
-
[
|
|
385
|
-
[
|
|
386
|
-
[
|
|
387
|
-
[
|
|
388
|
-
[
|
|
389
|
-
[
|
|
383
|
+
[2962]: func,
|
|
384
|
+
[2967]: ref,
|
|
385
|
+
[2963]: mask,
|
|
386
|
+
[34816]: func,
|
|
387
|
+
[36003]: ref,
|
|
388
|
+
[36004]: mask
|
|
390
389
|
}),
|
|
391
390
|
stencilFuncSeparate: (update, face, func, ref, mask) => update({
|
|
392
|
-
[face ===
|
|
393
|
-
[face ===
|
|
394
|
-
[face ===
|
|
391
|
+
[face === 1028 ? 2962 : 34816]: func,
|
|
392
|
+
[face === 1028 ? 2967 : 36003]: ref,
|
|
393
|
+
[face === 1028 ? 2963 : 36004]: mask
|
|
395
394
|
}),
|
|
396
395
|
stencilOp: (update, fail, zfail, zpass) => update({
|
|
397
|
-
[
|
|
398
|
-
[
|
|
399
|
-
[
|
|
400
|
-
[
|
|
401
|
-
[
|
|
402
|
-
[
|
|
396
|
+
[2964]: fail,
|
|
397
|
+
[2965]: zfail,
|
|
398
|
+
[2966]: zpass,
|
|
399
|
+
[34817]: fail,
|
|
400
|
+
[34818]: zfail,
|
|
401
|
+
[34819]: zpass
|
|
403
402
|
}),
|
|
404
403
|
stencilOpSeparate: (update, face, fail, zfail, zpass) => update({
|
|
405
|
-
[face ===
|
|
406
|
-
[face ===
|
|
407
|
-
[face ===
|
|
404
|
+
[face === 1028 ? 2964 : 34817]: fail,
|
|
405
|
+
[face === 1028 ? 2965 : 34818]: zfail,
|
|
406
|
+
[face === 1028 ? 2966 : 34819]: zpass
|
|
408
407
|
}),
|
|
409
408
|
viewport: (update, x, y, width, height) => update({
|
|
410
|
-
[
|
|
409
|
+
[2978]: [x, y, width, height]
|
|
411
410
|
})
|
|
412
411
|
};
|
|
413
412
|
const isEnabled = (gl, key) => gl.isEnabled(key);
|
|
414
413
|
export const GL_PARAMETER_GETTERS = {
|
|
415
|
-
[
|
|
416
|
-
[
|
|
417
|
-
[
|
|
418
|
-
[
|
|
419
|
-
[
|
|
420
|
-
[
|
|
421
|
-
[
|
|
422
|
-
[
|
|
423
|
-
[
|
|
424
|
-
[
|
|
414
|
+
[3042]: isEnabled,
|
|
415
|
+
[2884]: isEnabled,
|
|
416
|
+
[2929]: isEnabled,
|
|
417
|
+
[3024]: isEnabled,
|
|
418
|
+
[32823]: isEnabled,
|
|
419
|
+
[32926]: isEnabled,
|
|
420
|
+
[32928]: isEnabled,
|
|
421
|
+
[3089]: isEnabled,
|
|
422
|
+
[2960]: isEnabled,
|
|
423
|
+
[35977]: isEnabled
|
|
425
424
|
};
|
|
426
|
-
export const NON_CACHE_PARAMETERS = new Set([
|
|
425
|
+
export const NON_CACHE_PARAMETERS = new Set([34016, 36388, 36387, 35983, 35368, 34965, 35739, 35738, 3074, 34853, 34854, 34855, 34856, 34857, 34858, 34859, 34860, 34861, 34862, 34863, 34864, 34865, 34866, 34867, 34868, 35097, 32873, 35869, 32874, 34068]);
|
|
427
426
|
//# sourceMappingURL=webgl-parameter-tables.js.map
|