@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,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
WebGLDrawingBufferWrapper
|
|
1
|
+
//#region src/ts/webgl-drawing-buffer-wrapper.ts
|
|
2
|
+
var WebGLDrawingBufferWrapper = class {
|
|
3
|
+
constructor(framebuffer, color, depthStencil) {
|
|
4
|
+
this._framebuffer = framebuffer;
|
|
5
|
+
this._color = color;
|
|
6
|
+
this._depthStencil = depthStencil;
|
|
7
|
+
}
|
|
10
8
|
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { WebGLDrawingBufferWrapper };
|
|
@@ -1,108 +1,110 @@
|
|
|
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
|
-
|
|
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
|
-
WebGLFramebuffer
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-framebuffer.ts
|
|
4
|
+
var WebGLFramebuffer = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._binding = 0;
|
|
8
|
+
this._width = 0;
|
|
9
|
+
this._height = 0;
|
|
10
|
+
this._status = null;
|
|
11
|
+
this._ctx = ctx;
|
|
12
|
+
this._attachments = {};
|
|
13
|
+
this._attachments[ctx.COLOR_ATTACHMENT0] = null;
|
|
14
|
+
this._attachments[ctx.DEPTH_ATTACHMENT] = null;
|
|
15
|
+
this._attachments[ctx.STENCIL_ATTACHMENT] = null;
|
|
16
|
+
this._attachments[ctx.DEPTH_STENCIL_ATTACHMENT] = null;
|
|
17
|
+
this._attachmentLevel = {};
|
|
18
|
+
this._attachmentLevel[ctx.COLOR_ATTACHMENT0] = 0;
|
|
19
|
+
this._attachmentLevel[ctx.DEPTH_ATTACHMENT] = 0;
|
|
20
|
+
this._attachmentLevel[ctx.STENCIL_ATTACHMENT] = 0;
|
|
21
|
+
this._attachmentLevel[ctx.DEPTH_STENCIL_ATTACHMENT] = 0;
|
|
22
|
+
this._attachmentFace = {};
|
|
23
|
+
this._attachmentFace[ctx.COLOR_ATTACHMENT0] = 0;
|
|
24
|
+
this._attachmentFace[ctx.DEPTH_ATTACHMENT] = 0;
|
|
25
|
+
this._attachmentFace[ctx.STENCIL_ATTACHMENT] = 0;
|
|
26
|
+
this._attachmentFace[ctx.DEPTH_STENCIL_ATTACHMENT] = 0;
|
|
27
|
+
if (ctx._extensions.webgl_draw_buffers) {
|
|
28
|
+
const webGLDrawBuffers = ctx._extensions.webgl_draw_buffers;
|
|
29
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT1_WEBGL] = null;
|
|
30
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT2_WEBGL] = null;
|
|
31
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT3_WEBGL] = null;
|
|
32
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT4_WEBGL] = null;
|
|
33
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT5_WEBGL] = null;
|
|
34
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT6_WEBGL] = null;
|
|
35
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT7_WEBGL] = null;
|
|
36
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT8_WEBGL] = null;
|
|
37
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT9_WEBGL] = null;
|
|
38
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT10_WEBGL] = null;
|
|
39
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT11_WEBGL] = null;
|
|
40
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT12_WEBGL] = null;
|
|
41
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT13_WEBGL] = null;
|
|
42
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT14_WEBGL] = null;
|
|
43
|
+
this._attachments[webGLDrawBuffers.COLOR_ATTACHMENT15_WEBGL] = null;
|
|
44
|
+
this._attachments[ctx.NONE] = null;
|
|
45
|
+
this._attachments[ctx.BACK] = null;
|
|
46
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT1_WEBGL] = 0;
|
|
47
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT2_WEBGL] = 0;
|
|
48
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT3_WEBGL] = 0;
|
|
49
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT4_WEBGL] = 0;
|
|
50
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT5_WEBGL] = 0;
|
|
51
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT6_WEBGL] = 0;
|
|
52
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT7_WEBGL] = 0;
|
|
53
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT8_WEBGL] = 0;
|
|
54
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT9_WEBGL] = 0;
|
|
55
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT10_WEBGL] = 0;
|
|
56
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT11_WEBGL] = 0;
|
|
57
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT12_WEBGL] = 0;
|
|
58
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT13_WEBGL] = 0;
|
|
59
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT14_WEBGL] = 0;
|
|
60
|
+
this._attachmentLevel[webGLDrawBuffers.COLOR_ATTACHMENT15_WEBGL] = 0;
|
|
61
|
+
this._attachmentLevel[ctx.NONE] = null;
|
|
62
|
+
this._attachmentLevel[ctx.BACK] = null;
|
|
63
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT1_WEBGL] = 0;
|
|
64
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT2_WEBGL] = 0;
|
|
65
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT3_WEBGL] = 0;
|
|
66
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT4_WEBGL] = 0;
|
|
67
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT5_WEBGL] = 0;
|
|
68
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT6_WEBGL] = 0;
|
|
69
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT7_WEBGL] = 0;
|
|
70
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT8_WEBGL] = 0;
|
|
71
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT9_WEBGL] = 0;
|
|
72
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT10_WEBGL] = 0;
|
|
73
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT11_WEBGL] = 0;
|
|
74
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT12_WEBGL] = 0;
|
|
75
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT13_WEBGL] = 0;
|
|
76
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT14_WEBGL] = 0;
|
|
77
|
+
this._attachmentFace[webGLDrawBuffers.COLOR_ATTACHMENT15_WEBGL] = 0;
|
|
78
|
+
this._attachmentFace[ctx.NONE] = null;
|
|
79
|
+
this._attachmentFace[ctx.BACK] = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_clearAttachment(attachment) {
|
|
83
|
+
const object = this._attachments[attachment];
|
|
84
|
+
if (!object) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this._attachments[attachment] = null;
|
|
88
|
+
this._unlink(object);
|
|
89
|
+
}
|
|
90
|
+
_setAttachment(object, attachment) {
|
|
91
|
+
const prevObject = this._attachments[attachment];
|
|
92
|
+
if (prevObject === object) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this._clearAttachment(attachment);
|
|
96
|
+
if (!object) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this._attachments[attachment] = object;
|
|
100
|
+
this._link(object);
|
|
101
|
+
}
|
|
102
|
+
_performDelete() {
|
|
103
|
+
const ctx = this._ctx;
|
|
104
|
+
delete ctx._framebuffers[this._ | 0];
|
|
105
|
+
ctx._gl.deleteFramebuffer(this._ | 0);
|
|
106
|
+
}
|
|
108
107
|
};
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { WebGLFramebuffer };
|
package/lib/esm/webgl-program.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
WebGLProgram
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-program.ts
|
|
4
|
+
var WebGLProgram = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._linkCount = 0;
|
|
8
|
+
this._linkStatus = false;
|
|
9
|
+
this._linkInfoLog = "not linked";
|
|
10
|
+
this._attributes = [];
|
|
11
|
+
this._uniforms = [];
|
|
12
|
+
this._ctx = ctx;
|
|
13
|
+
this._linkCount = 0;
|
|
14
|
+
this._linkStatus = false;
|
|
15
|
+
this._linkInfoLog = "not linked";
|
|
16
|
+
this._attributes = [];
|
|
17
|
+
this._uniforms = [];
|
|
18
|
+
}
|
|
19
|
+
_performDelete() {
|
|
20
|
+
const ctx = this._ctx;
|
|
21
|
+
delete ctx._programs[this._ | 0];
|
|
22
|
+
ctx._gl.deleteProgram(this._ | 0);
|
|
23
|
+
}
|
|
25
24
|
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { WebGLProgram };
|
package/lib/esm/webgl-query.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
|
-
WebGLQuery
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-query.ts
|
|
4
|
+
var WebGLQuery = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._ctx = ctx;
|
|
8
|
+
}
|
|
9
|
+
_performDelete() {
|
|
10
|
+
const ctx = this._ctx;
|
|
11
|
+
delete ctx._queries[this._ | 0];
|
|
12
|
+
ctx._native2.deleteQuery(this._ | 0);
|
|
13
|
+
}
|
|
15
14
|
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { WebGLQuery };
|
|
@@ -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
|
-
WebGLRenderbuffer
|
|
2
|
+
|
|
3
|
+
//#region src/ts/webgl-renderbuffer.ts
|
|
4
|
+
var WebGLRenderbuffer = class extends Linkable {
|
|
5
|
+
constructor(_, ctx) {
|
|
6
|
+
super(_);
|
|
7
|
+
this._binding = 0;
|
|
8
|
+
this._width = 0;
|
|
9
|
+
this._height = 0;
|
|
10
|
+
this._format = 0;
|
|
11
|
+
this._ctx = ctx;
|
|
12
|
+
this._binding = 0;
|
|
13
|
+
this._width = 0;
|
|
14
|
+
this._height = 0;
|
|
15
|
+
this._format = 0;
|
|
16
|
+
}
|
|
17
|
+
_performDelete() {
|
|
18
|
+
const ctx = this._ctx;
|
|
19
|
+
delete ctx._renderbuffers[this._ | 0];
|
|
20
|
+
ctx._gl.deleteRenderbuffer(this._);
|
|
21
|
+
}
|
|
23
22
|
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { WebGLRenderbuffer };
|