@gjsify/webgl 0.3.12 → 0.3.14
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/lib/esm/conformance/attribs.spec.js +312 -293
- package/lib/esm/conformance/buffers.spec.js +217 -200
- package/lib/esm/conformance/context.spec.js +295 -295
- package/lib/esm/conformance/programs.spec.js +458 -445
- package/lib/esm/conformance/rendering-basic.spec.js +134 -128
- package/lib/esm/conformance/rendering.spec.js +502 -400
- package/lib/esm/conformance/setup.js +42 -31
- package/lib/esm/conformance/state.spec.js +360 -343
- package/lib/esm/conformance/textures.spec.js +330 -338
- package/lib/esm/conformance/uniforms.spec.js +465 -309
- package/lib/esm/conformance-test.js +24 -22
- package/lib/esm/extensions/ext-blend-minmax.js +16 -16
- package/lib/esm/extensions/ext-color-buffer-float.js +10 -11
- package/lib/esm/extensions/ext-color-buffer-half-float.js +10 -11
- package/lib/esm/extensions/ext-texture-filter-anisotropic.js +16 -16
- package/lib/esm/extensions/oes-element-index-unit.js +11 -12
- package/lib/esm/extensions/oes-standard-derivatives.js +15 -15
- package/lib/esm/extensions/oes-texture-float-linear.js +11 -12
- package/lib/esm/extensions/oes-texture-float.js +11 -12
- package/lib/esm/extensions/oes-texture-half-float.js +17 -17
- package/lib/esm/extensions/stackgl-destroy-context.js +10 -10
- package/lib/esm/extensions/stackgl-resize-drawing-buffer.js +10 -10
- package/lib/esm/html-canvas-element.js +64 -64
- package/lib/esm/index.js +29 -26
- package/lib/esm/linkable.js +49 -49
- package/lib/esm/test-utils.js +158 -107
- package/lib/esm/test.js +8 -4
- package/lib/esm/types/index.js +5 -5
- package/lib/esm/utils.js +164 -187
- package/lib/esm/webgl-active-info.js +10 -9
- package/lib/esm/webgl-bridge.js +162 -147
- package/lib/esm/webgl-buffer.js +17 -15
- package/lib/esm/webgl-context-attributes.js +23 -22
- package/lib/esm/webgl-context-base.js +3039 -3351
- package/lib/esm/webgl-drawing-buffer-wrapper.js +10 -9
- package/lib/esm/webgl-framebuffer.js +108 -106
- package/lib/esm/webgl-program.js +25 -23
- package/lib/esm/webgl-query.js +15 -13
- package/lib/esm/webgl-renderbuffer.js +23 -21
- package/lib/esm/webgl-rendering-context.js +173 -187
- package/lib/esm/webgl-sampler.js +15 -13
- package/lib/esm/webgl-shader-precision-format.js +10 -9
- package/lib/esm/webgl-shader.js +23 -21
- package/lib/esm/webgl-sync.js +15 -13
- package/lib/esm/webgl-texture-unit.js +12 -11
- package/lib/esm/webgl-texture.js +21 -19
- package/lib/esm/webgl-transform-feedback.js +15 -13
- package/lib/esm/webgl-uniform-location.js +14 -13
- package/lib/esm/webgl-vertex-array-object.js +20 -18
- package/lib/esm/webgl-vertex-attribute.js +149 -145
- package/lib/esm/webgl1.spec.js +1039 -650
- package/lib/esm/webgl2-rendering-context.js +1210 -1273
- package/lib/esm/webgl2.spec.js +1284 -1252
- package/package.json +9 -9
- package/lib/esm/@types/glsl-tokenizer/index.d.js +0 -0
|
@@ -1,189 +1,175 @@
|
|
|
1
|
-
import Gwebgl from "@girs/gwebgl-0.1";
|
|
2
|
-
import { WebGLContextBase } from "./webgl-context-base.js";
|
|
3
1
|
import { Uint8ArrayToVariant, vertexCount } from "./utils.js";
|
|
4
|
-
import { WebGLContextBase
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
if (reducedCount > 0) {
|
|
175
|
-
if (this._vertexObjectState._attribs[0]._isPointer) {
|
|
176
|
-
return this._native.drawElements(mode, reducedCount, type, ioffset);
|
|
177
|
-
} else {
|
|
178
|
-
this._beginAttrib0Hack();
|
|
179
|
-
this._native._drawElementsInstanced(mode, reducedCount, type, ioffset, 1);
|
|
180
|
-
this._endAttrib0Hack();
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
export {
|
|
187
|
-
WebGLContextBase2 as WebGLContextBase,
|
|
188
|
-
WebGLRenderingContext
|
|
2
|
+
import { WebGLContextBase } from "./webgl-context-base.js";
|
|
3
|
+
import Gwebgl from "@girs/gwebgl-0.1";
|
|
4
|
+
|
|
5
|
+
//#region src/ts/webgl-rendering-context.ts
|
|
6
|
+
var WebGLRenderingContext = class extends WebGLContextBase {
|
|
7
|
+
get _gl() {
|
|
8
|
+
return this._native;
|
|
9
|
+
}
|
|
10
|
+
constructor(canvas, options = {}) {
|
|
11
|
+
super(canvas, options);
|
|
12
|
+
this._attrib0Buffer = null;
|
|
13
|
+
this._native = new Gwebgl.WebGLRenderingContext({});
|
|
14
|
+
this._init();
|
|
15
|
+
const attrib0Buffer = this.createBuffer();
|
|
16
|
+
this._attrib0Buffer = attrib0Buffer;
|
|
17
|
+
}
|
|
18
|
+
_beginAttrib0Hack() {
|
|
19
|
+
this._native.bindBuffer(this.ARRAY_BUFFER, this._attrib0Buffer?._ || 0);
|
|
20
|
+
const uInt8Data = new Uint8Array(this._vertexGlobalState._attribs[0]._data.buffer);
|
|
21
|
+
this._native.bufferData(this.ARRAY_BUFFER, Uint8ArrayToVariant(uInt8Data), this.STREAM_DRAW);
|
|
22
|
+
this._native.enableVertexAttribArray(0);
|
|
23
|
+
this._native.vertexAttribPointer(0, 4, this.FLOAT, false, 0, 0);
|
|
24
|
+
this._native._vertexAttribDivisor(0, 1);
|
|
25
|
+
}
|
|
26
|
+
_endAttrib0Hack() {
|
|
27
|
+
const attrib = this._vertexObjectState._attribs[0];
|
|
28
|
+
if (attrib._pointerBuffer) {
|
|
29
|
+
this._native.bindBuffer(this.ARRAY_BUFFER, attrib._pointerBuffer._);
|
|
30
|
+
} else {
|
|
31
|
+
this._native.bindBuffer(this.ARRAY_BUFFER, 0);
|
|
32
|
+
}
|
|
33
|
+
this._native.vertexAttribPointer(0, attrib._inputSize, attrib._pointerType, attrib._pointerNormal, attrib._inputStride, attrib._pointerOffset);
|
|
34
|
+
this._native._vertexAttribDivisor(0, attrib._divisor);
|
|
35
|
+
this._native.disableVertexAttribArray(0);
|
|
36
|
+
if (this._vertexGlobalState._arrayBufferBinding) {
|
|
37
|
+
this._native.bindBuffer(this.ARRAY_BUFFER, this._vertexGlobalState._arrayBufferBinding._);
|
|
38
|
+
} else {
|
|
39
|
+
this._native.bindBuffer(this.ARRAY_BUFFER, 0);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
drawArrays(mode = 0, first = 0, count = 0) {
|
|
43
|
+
if (first < 0 || count < 0) {
|
|
44
|
+
this.setError(this.INVALID_VALUE);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (!this._checkStencilState()) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const reducedCount = vertexCount(this, mode, count);
|
|
51
|
+
if (reducedCount < 0) {
|
|
52
|
+
this.setError(this.INVALID_ENUM);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!this._framebufferOk()) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (count === 0) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let maxIndex = first;
|
|
62
|
+
if (count > 0) {
|
|
63
|
+
maxIndex = count + first - 1 >>> 0;
|
|
64
|
+
}
|
|
65
|
+
if (this._checkVertexAttribState(maxIndex)) {
|
|
66
|
+
if (this._vertexObjectState._attribs[0]._isPointer || this._extensions.webgl_draw_buffers && this._extensions.webgl_draw_buffers._buffersState && this._extensions.webgl_draw_buffers._buffersState.length > 0) {
|
|
67
|
+
return this._native.drawArrays(mode, first, reducedCount);
|
|
68
|
+
} else {
|
|
69
|
+
this._beginAttrib0Hack();
|
|
70
|
+
this._native._drawArraysInstanced(mode, first, reducedCount, 1);
|
|
71
|
+
this._endAttrib0Hack();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
drawElements(mode = 0, count = 0, type = 0, ioffset = 0) {
|
|
76
|
+
if (count < 0 || ioffset < 0) {
|
|
77
|
+
this.setError(this.INVALID_VALUE);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (!this._checkStencilState()) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const elementBuffer = this._vertexObjectState._elementArrayBufferBinding;
|
|
84
|
+
if (!elementBuffer) {
|
|
85
|
+
this.setError(this.INVALID_OPERATION);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
let elementData = null;
|
|
89
|
+
let offset = ioffset;
|
|
90
|
+
if (type === this.UNSIGNED_SHORT) {
|
|
91
|
+
if (offset % 2) {
|
|
92
|
+
this.setError(this.INVALID_OPERATION);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
offset >>= 1;
|
|
96
|
+
elementData = new Uint16Array(elementBuffer._elements.buffer);
|
|
97
|
+
} else if (this._extensions.oes_element_index_uint && type === this.UNSIGNED_INT) {
|
|
98
|
+
if (offset % 4) {
|
|
99
|
+
this.setError(this.INVALID_OPERATION);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
offset >>= 2;
|
|
103
|
+
elementData = new Uint32Array(elementBuffer._elements.buffer);
|
|
104
|
+
} else if (type === this.UNSIGNED_BYTE) {
|
|
105
|
+
elementData = elementBuffer._elements;
|
|
106
|
+
} else {
|
|
107
|
+
this.setError(this.INVALID_ENUM);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
let reducedCount = count;
|
|
111
|
+
switch (mode) {
|
|
112
|
+
case this.TRIANGLES:
|
|
113
|
+
if (count % 3) {
|
|
114
|
+
reducedCount -= count % 3;
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
case this.LINES:
|
|
118
|
+
if (count % 2) {
|
|
119
|
+
reducedCount -= count % 2;
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
case this.POINTS: break;
|
|
123
|
+
case this.LINE_LOOP:
|
|
124
|
+
case this.LINE_STRIP:
|
|
125
|
+
if (count < 2) {
|
|
126
|
+
this.setError(this.INVALID_OPERATION);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case this.TRIANGLE_FAN:
|
|
131
|
+
case this.TRIANGLE_STRIP:
|
|
132
|
+
if (count < 3) {
|
|
133
|
+
this.setError(this.INVALID_OPERATION);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
default:
|
|
138
|
+
this.setError(this.INVALID_ENUM);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (!this._framebufferOk()) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (count === 0) {
|
|
145
|
+
this._checkVertexAttribState(0);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (count + offset >>> 0 > elementData.length) {
|
|
149
|
+
this.setError(this.INVALID_OPERATION);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
let maxIndex = -1;
|
|
153
|
+
for (let i = offset; i < offset + count; ++i) {
|
|
154
|
+
maxIndex = Math.max(maxIndex, elementData[i]);
|
|
155
|
+
}
|
|
156
|
+
if (maxIndex < 0) {
|
|
157
|
+
this._checkVertexAttribState(0);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (this._checkVertexAttribState(maxIndex)) {
|
|
161
|
+
if (reducedCount > 0) {
|
|
162
|
+
if (this._vertexObjectState._attribs[0]._isPointer) {
|
|
163
|
+
return this._native.drawElements(mode, reducedCount, type, ioffset);
|
|
164
|
+
} else {
|
|
165
|
+
this._beginAttrib0Hack();
|
|
166
|
+
this._native._drawElementsInstanced(mode, reducedCount, type, ioffset, 1);
|
|
167
|
+
this._endAttrib0Hack();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
189
172
|
};
|
|
173
|
+
|
|
174
|
+
//#endregion
|
|
175
|
+
export { WebGLContextBase, WebGLRenderingContext };
|
package/lib/esm/webgl-sampler.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Linkable } from "./linkable.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
WebGLSampler
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-sampler.ts
|
|
4
|
+
var WebGLSampler = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._ctx = ctx;
|
|
8
|
+
}
|
|
9
|
+
_performDelete() {
|
|
10
|
+
const ctx = this._ctx;
|
|
11
|
+
delete ctx._samplers[this._ | 0];
|
|
12
|
+
ctx._native2.deleteSampler(this._ | 0);
|
|
13
|
+
}
|
|
15
14
|
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { WebGLSampler };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
WebGLShaderPrecisionFormat
|
|
1
|
+
//#region src/ts/webgl-shader-precision-format.ts
|
|
2
|
+
var WebGLShaderPrecisionFormat = class {
|
|
3
|
+
constructor(_) {
|
|
4
|
+
this.rangeMin = _.rangeMin;
|
|
5
|
+
this.rangeMax = _.rangeMax;
|
|
6
|
+
this.precision = _.precision;
|
|
7
|
+
}
|
|
10
8
|
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { WebGLShaderPrecisionFormat };
|
package/lib/esm/webgl-shader.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { Linkable } from "./linkable.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
WebGLShader
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-shader.ts
|
|
4
|
+
var WebGLShader = class extends Linkable {
|
|
5
|
+
constructor(_, ctx, type) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._source = "";
|
|
8
|
+
this._compileStatus = false;
|
|
9
|
+
this._compileInfo = "";
|
|
10
|
+
this._needsRecompile = false;
|
|
11
|
+
this._type = type;
|
|
12
|
+
this._ctx = ctx;
|
|
13
|
+
this._source = "";
|
|
14
|
+
this._compileStatus = false;
|
|
15
|
+
this._compileInfo = "";
|
|
16
|
+
}
|
|
17
|
+
_performDelete() {
|
|
18
|
+
const ctx = this._ctx;
|
|
19
|
+
delete ctx._shaders[this._ | 0];
|
|
20
|
+
ctx._gl.deleteShader(this._ | 0);
|
|
21
|
+
}
|
|
23
22
|
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { WebGLShader };
|
package/lib/esm/webgl-sync.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Linkable } from "./linkable.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
WebGLSync
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-sync.ts
|
|
4
|
+
var WebGLSync = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._ctx = ctx;
|
|
8
|
+
}
|
|
9
|
+
_performDelete() {
|
|
10
|
+
const ctx = this._ctx;
|
|
11
|
+
delete ctx._syncs[this._ | 0];
|
|
12
|
+
ctx._native2.deleteSync(this._ | 0);
|
|
13
|
+
}
|
|
15
14
|
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { WebGLSync };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
WebGLTextureUnit
|
|
1
|
+
//#region src/ts/webgl-texture-unit.ts
|
|
2
|
+
var WebGLTextureUnit = class {
|
|
3
|
+
constructor(ctx, idx) {
|
|
4
|
+
this._mode = 0;
|
|
5
|
+
this._bind2D = null;
|
|
6
|
+
this._bindCube = null;
|
|
7
|
+
this._ctx = ctx;
|
|
8
|
+
this._idx = idx;
|
|
9
|
+
}
|
|
12
10
|
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { WebGLTextureUnit };
|
package/lib/esm/webgl-texture.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { Linkable } from "./linkable.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
WebGLTexture
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-texture.ts
|
|
4
|
+
var WebGLTexture = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._binding = 0;
|
|
8
|
+
this._levelWidth = new Int32Array(32);
|
|
9
|
+
this._levelHeight = new Int32Array(32);
|
|
10
|
+
this._format = 0;
|
|
11
|
+
this._type = 0;
|
|
12
|
+
this._complete = true;
|
|
13
|
+
this._ctx = ctx;
|
|
14
|
+
}
|
|
15
|
+
_performDelete() {
|
|
16
|
+
const ctx = this._ctx;
|
|
17
|
+
delete ctx._textures[this._ | 0];
|
|
18
|
+
ctx._gl.deleteTexture(this._ | 0);
|
|
19
|
+
}
|
|
21
20
|
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { WebGLTexture };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Linkable } from "./linkable.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
WebGLTransformFeedback
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-transform-feedback.ts
|
|
4
|
+
var WebGLTransformFeedback = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._ctx = ctx;
|
|
8
|
+
}
|
|
9
|
+
_performDelete() {
|
|
10
|
+
const ctx = this._ctx;
|
|
11
|
+
delete ctx._transformFeedbacks[this._ | 0];
|
|
12
|
+
ctx._native2.deleteTransformFeedback(this._ | 0);
|
|
13
|
+
}
|
|
15
14
|
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { WebGLTransformFeedback };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
WebGLUniformLocation
|
|
1
|
+
//#region src/ts/webgl-uniform-location.ts
|
|
2
|
+
var WebGLUniformLocation = class {
|
|
3
|
+
constructor(_, program, info) {
|
|
4
|
+
this._linkCount = 0;
|
|
5
|
+
this._array = null;
|
|
6
|
+
this._ = _;
|
|
7
|
+
this._program = program;
|
|
8
|
+
this._linkCount = program._linkCount;
|
|
9
|
+
this._activeInfo = info;
|
|
10
|
+
this._array = null;
|
|
11
|
+
}
|
|
14
12
|
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { WebGLUniformLocation };
|