@aethervtt/shard-gpu-webgl2 0.0.0-stage → 0.1.0
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 +21 -0
- package/README.md +2 -2
- package/dist/binding.d.ts +32 -0
- package/dist/binding.js +81 -0
- package/dist/cache.d.ts +73 -0
- package/dist/cache.js +184 -0
- package/dist/commands.d.ts +94 -0
- package/dist/commands.js +366 -0
- package/dist/constants.d.ts +41 -0
- package/dist/constants.js +38 -0
- package/dist/copies.d.ts +61 -0
- package/dist/copies.js +621 -0
- package/dist/device.d.ts +160 -0
- package/dist/device.js +384 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +18 -0
- package/dist/fake-gl.d.ts +316 -0
- package/dist/fake-gl.js +949 -0
- package/dist/fbo.d.ts +30 -0
- package/dist/fbo.js +142 -0
- package/dist/formats.d.ts +25 -0
- package/dist/formats.js +106 -0
- package/dist/gl.d.ts +216 -0
- package/dist/gl.js +232 -0
- package/dist/gpu.d.ts +58 -0
- package/dist/gpu.js +213 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +42 -0
- package/dist/naga.d.ts +37 -0
- package/dist/naga.js +99 -0
- package/dist/pipeline.d.ts +113 -0
- package/dist/pipeline.js +294 -0
- package/dist/present.d.ts +18 -0
- package/dist/present.js +108 -0
- package/dist/queue.d.ts +13 -0
- package/dist/queue.js +50 -0
- package/dist/readback.d.ts +17 -0
- package/dist/readback.js +104 -0
- package/dist/replay.d.ts +76 -0
- package/dist/replay.js +657 -0
- package/dist/resources.d.ts +93 -0
- package/dist/resources.js +353 -0
- package/dist/state.d.ts +43 -0
- package/dist/state.js +169 -0
- package/package.json +36 -4
- package/wasm/shard_naga.wasm +0 -0
package/dist/fbo.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Webgl2Texture } from './resources.js';
|
|
2
|
+
/** Attachments to look up: filled in place by a pass, a resolve, a copy or a present. */
|
|
3
|
+
export declare class Attachments {
|
|
4
|
+
count: number;
|
|
5
|
+
readonly colors: (Webgl2Texture | null)[];
|
|
6
|
+
readonly colorMips: number[];
|
|
7
|
+
/** Array layer, cube face or 3D slice; 0 for a 2D texture. */
|
|
8
|
+
readonly colorLayers: number[];
|
|
9
|
+
depth: Webgl2Texture | null;
|
|
10
|
+
depthMip: number;
|
|
11
|
+
depthLayer: number;
|
|
12
|
+
reset(): void;
|
|
13
|
+
color(index: number, texture: Webgl2Texture | null, mip: number, layer: number): void;
|
|
14
|
+
setDepth(texture: Webgl2Texture, mip: number, layer: number): void;
|
|
15
|
+
/** The texture a lookup is filed under: the first attached. */
|
|
16
|
+
first(): Webgl2Texture | null;
|
|
17
|
+
}
|
|
18
|
+
export declare class FramebufferCache {
|
|
19
|
+
private readonly gl;
|
|
20
|
+
private readonly byTexture;
|
|
21
|
+
/** Framebuffers that failed their completeness check, for the error they raise once. */
|
|
22
|
+
incomplete: ((status: number) => void) | undefined;
|
|
23
|
+
constructor(gl: WebGL2RenderingContext);
|
|
24
|
+
/** The framebuffer for `a`, bound to FRAMEBUFFER (read and draw) when it's new. */
|
|
25
|
+
get(a: Attachments): WebGLFramebuffer | null;
|
|
26
|
+
/** Deletes every framebuffer `texture` is attached to. */
|
|
27
|
+
forget(texture: Webgl2Texture): void;
|
|
28
|
+
clear(): void;
|
|
29
|
+
private create;
|
|
30
|
+
}
|
package/dist/fbo.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { GL } from "./gl.js";
|
|
2
|
+
class Attachments {
|
|
3
|
+
count = 0;
|
|
4
|
+
colors = [];
|
|
5
|
+
colorMips = [];
|
|
6
|
+
/** Array layer, cube face or 3D slice; 0 for a 2D texture. */
|
|
7
|
+
colorLayers = [];
|
|
8
|
+
depth = null;
|
|
9
|
+
depthMip = 0;
|
|
10
|
+
depthLayer = 0;
|
|
11
|
+
reset() {
|
|
12
|
+
for (let i = 0; i < this.count; i++) this.colors[i] = null;
|
|
13
|
+
this.count = 0;
|
|
14
|
+
this.depth = null;
|
|
15
|
+
}
|
|
16
|
+
color(index, texture, mip, layer) {
|
|
17
|
+
while (this.count <= index) {
|
|
18
|
+
this.colors[this.count] = null;
|
|
19
|
+
this.colorMips[this.count] = 0;
|
|
20
|
+
this.colorLayers[this.count] = 0;
|
|
21
|
+
this.count++;
|
|
22
|
+
}
|
|
23
|
+
this.colors[index] = texture;
|
|
24
|
+
this.colorMips[index] = mip;
|
|
25
|
+
this.colorLayers[index] = layer;
|
|
26
|
+
}
|
|
27
|
+
setDepth(texture, mip, layer) {
|
|
28
|
+
this.depth = texture;
|
|
29
|
+
this.depthMip = mip;
|
|
30
|
+
this.depthLayer = layer;
|
|
31
|
+
}
|
|
32
|
+
/** The texture a lookup is filed under: the first attached. */
|
|
33
|
+
first() {
|
|
34
|
+
for (let i = 0; i < this.count; i++) if (this.colors[i]) return this.colors[i];
|
|
35
|
+
return this.depth;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function matches(r, a) {
|
|
39
|
+
if (r.colors.length !== a.count || r.depth !== a.depth) return false;
|
|
40
|
+
if (a.depth && (r.depthMip !== a.depthMip || r.depthLayer !== a.depthLayer)) return false;
|
|
41
|
+
for (let i = 0; i < a.count; i++) {
|
|
42
|
+
if (r.colors[i] !== a.colors[i]) return false;
|
|
43
|
+
if (a.colors[i] && (r.colorMips[i] !== a.colorMips[i] || r.colorLayers[i] !== a.colorLayers[i])) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
class FramebufferCache {
|
|
50
|
+
gl;
|
|
51
|
+
byTexture = /* @__PURE__ */ new Map();
|
|
52
|
+
/** Framebuffers that failed their completeness check, for the error they raise once. */
|
|
53
|
+
incomplete;
|
|
54
|
+
constructor(gl) {
|
|
55
|
+
this.gl = gl;
|
|
56
|
+
}
|
|
57
|
+
/** The framebuffer for `a`, bound to FRAMEBUFFER (read and draw) when it's new. */
|
|
58
|
+
get(a) {
|
|
59
|
+
const first = a.first();
|
|
60
|
+
if (!first) return null;
|
|
61
|
+
let list = this.byTexture.get(first);
|
|
62
|
+
if (list) {
|
|
63
|
+
for (let i = 0; i < list.length; i++) if (matches(list[i], a)) return list[i].fbo;
|
|
64
|
+
} else {
|
|
65
|
+
list = [];
|
|
66
|
+
this.byTexture.set(first, list);
|
|
67
|
+
}
|
|
68
|
+
const record = this.create(a);
|
|
69
|
+
list.push(record);
|
|
70
|
+
return record.fbo;
|
|
71
|
+
}
|
|
72
|
+
/** Deletes every framebuffer `texture` is attached to. */
|
|
73
|
+
forget(texture) {
|
|
74
|
+
for (const [key, list] of this.byTexture) {
|
|
75
|
+
for (let i = list.length - 1; i >= 0; i--) {
|
|
76
|
+
const r = list[i];
|
|
77
|
+
if (key === texture || r.depth === texture || r.colors.includes(texture)) {
|
|
78
|
+
this.gl.deleteFramebuffer(r.fbo);
|
|
79
|
+
list.splice(i, 1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (list.length === 0) this.byTexture.delete(key);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
clear() {
|
|
86
|
+
for (const list of this.byTexture.values())
|
|
87
|
+
for (const r of list) this.gl.deleteFramebuffer(r.fbo);
|
|
88
|
+
this.byTexture.clear();
|
|
89
|
+
}
|
|
90
|
+
create(a) {
|
|
91
|
+
const gl = this.gl;
|
|
92
|
+
const fbo = gl.createFramebuffer();
|
|
93
|
+
gl.bindFramebuffer(GL.FRAMEBUFFER, fbo);
|
|
94
|
+
const buffers = [];
|
|
95
|
+
for (let i = 0; i < a.count; i++) {
|
|
96
|
+
const t = a.colors[i];
|
|
97
|
+
if (t) attach(gl, GL.COLOR_ATTACHMENT0 + i, t, a.colorMips[i], a.colorLayers[i]);
|
|
98
|
+
buffers.push(t ? GL.COLOR_ATTACHMENT0 + i : GL.NONE);
|
|
99
|
+
}
|
|
100
|
+
if (a.depth) {
|
|
101
|
+
const info = a.depth.info;
|
|
102
|
+
const point = info.depth && info.stencil ? GL.DEPTH_STENCIL_ATTACHMENT : info.depth ? GL.DEPTH_ATTACHMENT : GL.STENCIL_ATTACHMENT;
|
|
103
|
+
attach(gl, point, a.depth, a.depthMip, a.depthLayer);
|
|
104
|
+
}
|
|
105
|
+
gl.drawBuffers(buffers);
|
|
106
|
+
if (a.count === 0) gl.readBuffer(GL.NONE);
|
|
107
|
+
if (this.incomplete) {
|
|
108
|
+
const status = gl.checkFramebufferStatus(GL.FRAMEBUFFER);
|
|
109
|
+
if (status !== GL.FRAMEBUFFER_COMPLETE) this.incomplete(status);
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
fbo,
|
|
113
|
+
colors: a.colors.slice(0, a.count),
|
|
114
|
+
colorMips: a.colorMips.slice(0, a.count),
|
|
115
|
+
colorLayers: a.colorLayers.slice(0, a.count),
|
|
116
|
+
depth: a.depth,
|
|
117
|
+
depthMip: a.depthMip,
|
|
118
|
+
depthLayer: a.depthLayer
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function attach(gl, point, t, mip, layer) {
|
|
123
|
+
if (t.renderbuffer) {
|
|
124
|
+
gl.framebufferRenderbuffer(GL.FRAMEBUFFER, point, GL.RENDERBUFFER, t.renderbuffer);
|
|
125
|
+
} else if (t.target === GL.TEXTURE_2D) {
|
|
126
|
+
gl.framebufferTexture2D(GL.FRAMEBUFFER, point, GL.TEXTURE_2D, t.gl, mip);
|
|
127
|
+
} else if (t.target === GL.TEXTURE_CUBE_MAP) {
|
|
128
|
+
gl.framebufferTexture2D(
|
|
129
|
+
GL.FRAMEBUFFER,
|
|
130
|
+
point,
|
|
131
|
+
GL.TEXTURE_CUBE_MAP_POSITIVE_X + layer,
|
|
132
|
+
t.gl,
|
|
133
|
+
mip
|
|
134
|
+
);
|
|
135
|
+
} else {
|
|
136
|
+
gl.framebufferTextureLayer(GL.FRAMEBUFFER, point, t.gl, mip, layer);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export {
|
|
140
|
+
Attachments,
|
|
141
|
+
FramebufferCache
|
|
142
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type FormatKind = 'float' | 'unfilterable-float' | 'uint' | 'sint' | 'depth' | 'stencil';
|
|
2
|
+
export interface GlFormat {
|
|
3
|
+
internal: number;
|
|
4
|
+
/** Pixel format and type for uploads and reads (uncompressed). */
|
|
5
|
+
format: number;
|
|
6
|
+
type: number;
|
|
7
|
+
/** Bytes per texel, or per 4×4 block when compressed. */
|
|
8
|
+
bytes: number;
|
|
9
|
+
/** Texels a block covers per side (4 when compressed). */
|
|
10
|
+
block: number;
|
|
11
|
+
kind: FormatKind;
|
|
12
|
+
/** Renderable without extensions (true), with EXT_color_buffer_float ('float'), or never. */
|
|
13
|
+
renderable: boolean | 'float';
|
|
14
|
+
/** Linear filtering needs OES_texture_float_linear. */
|
|
15
|
+
float32?: boolean;
|
|
16
|
+
depth?: boolean;
|
|
17
|
+
stencil?: boolean;
|
|
18
|
+
srgb?: boolean;
|
|
19
|
+
/** Components: 1 to 4. */
|
|
20
|
+
components: number;
|
|
21
|
+
compressed?: 'bc' | 'astc' | 'etc2';
|
|
22
|
+
}
|
|
23
|
+
export declare const FORMATS: Readonly<Record<string, GlFormat>>;
|
|
24
|
+
/** The format, or an error naming it: the shim only has what the engine uses. */
|
|
25
|
+
export declare function formatOf(name: string): GlFormat;
|
package/dist/formats.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { GL } from "./gl.js";
|
|
2
|
+
const f = (internal, format, type, bytes, kind, renderable, components, extra = {}) => ({ internal, format, type, bytes, block: 1, kind, renderable, components, ...extra });
|
|
3
|
+
const compressed = (internal, family, extra = {}) => ({
|
|
4
|
+
internal,
|
|
5
|
+
format: 0,
|
|
6
|
+
type: 0,
|
|
7
|
+
bytes: 16,
|
|
8
|
+
block: 4,
|
|
9
|
+
kind: "float",
|
|
10
|
+
renderable: false,
|
|
11
|
+
components: 4,
|
|
12
|
+
compressed: family,
|
|
13
|
+
...extra
|
|
14
|
+
});
|
|
15
|
+
const FORMATS = {
|
|
16
|
+
r8unorm: f(GL.R8, GL.RED, GL.UNSIGNED_BYTE, 1, "float", true, 1),
|
|
17
|
+
rg8unorm: f(GL.RG8, GL.RG, GL.UNSIGNED_BYTE, 2, "float", true, 2),
|
|
18
|
+
rgba8unorm: f(GL.RGBA8, GL.RGBA, GL.UNSIGNED_BYTE, 4, "float", true, 4),
|
|
19
|
+
"rgba8unorm-srgb": f(GL.SRGB8_ALPHA8, GL.RGBA, GL.UNSIGNED_BYTE, 4, "float", true, 4, {
|
|
20
|
+
srgb: true
|
|
21
|
+
}),
|
|
22
|
+
rgb10a2unorm: f(GL.RGB10_A2, GL.RGBA, GL.UNSIGNED_INT_2_10_10_10_REV, 4, "float", true, 4),
|
|
23
|
+
r16float: f(GL.R16F, GL.RED, GL.HALF_FLOAT, 2, "float", "float", 1),
|
|
24
|
+
rg16float: f(GL.RG16F, GL.RG, GL.HALF_FLOAT, 4, "float", "float", 2),
|
|
25
|
+
rgba16float: f(GL.RGBA16F, GL.RGBA, GL.HALF_FLOAT, 8, "float", "float", 4),
|
|
26
|
+
r32float: f(GL.R32F, GL.RED, GL.FLOAT, 4, "unfilterable-float", "float", 1, { float32: true }),
|
|
27
|
+
rg32float: f(GL.RG32F, GL.RG, GL.FLOAT, 8, "unfilterable-float", "float", 2, { float32: true }),
|
|
28
|
+
rgba32float: f(GL.RGBA32F, GL.RGBA, GL.FLOAT, 16, "unfilterable-float", "float", 4, {
|
|
29
|
+
float32: true
|
|
30
|
+
}),
|
|
31
|
+
rg11b10ufloat: f(
|
|
32
|
+
GL.R11F_G11F_B10F,
|
|
33
|
+
GL.RGB,
|
|
34
|
+
GL.UNSIGNED_INT_10F_11F_11F_REV,
|
|
35
|
+
4,
|
|
36
|
+
"float",
|
|
37
|
+
"float",
|
|
38
|
+
3
|
|
39
|
+
),
|
|
40
|
+
r8uint: f(GL.R8UI, GL.RED_INTEGER, GL.UNSIGNED_BYTE, 1, "uint", true, 1),
|
|
41
|
+
rgba8uint: f(GL.RGBA8UI, GL.RGBA_INTEGER, GL.UNSIGNED_BYTE, 4, "uint", true, 4),
|
|
42
|
+
r16uint: f(GL.R16UI, GL.RED_INTEGER, GL.UNSIGNED_SHORT, 2, "uint", true, 1),
|
|
43
|
+
r32uint: f(GL.R32UI, GL.RED_INTEGER, GL.UNSIGNED_INT, 4, "uint", true, 1),
|
|
44
|
+
rg32uint: f(GL.RG32UI, GL.RG_INTEGER, GL.UNSIGNED_INT, 8, "uint", true, 2),
|
|
45
|
+
rgba32uint: f(GL.RGBA32UI, GL.RGBA_INTEGER, GL.UNSIGNED_INT, 16, "uint", true, 4),
|
|
46
|
+
depth16unorm: f(
|
|
47
|
+
GL.DEPTH_COMPONENT16,
|
|
48
|
+
GL.DEPTH_COMPONENT,
|
|
49
|
+
GL.UNSIGNED_SHORT,
|
|
50
|
+
2,
|
|
51
|
+
"depth",
|
|
52
|
+
true,
|
|
53
|
+
1,
|
|
54
|
+
{
|
|
55
|
+
depth: true
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
depth24plus: f(GL.DEPTH_COMPONENT24, GL.DEPTH_COMPONENT, GL.UNSIGNED_INT, 4, "depth", true, 1, {
|
|
59
|
+
depth: true
|
|
60
|
+
}),
|
|
61
|
+
depth32float: f(GL.DEPTH_COMPONENT32F, GL.DEPTH_COMPONENT, GL.FLOAT, 4, "depth", true, 1, {
|
|
62
|
+
depth: true
|
|
63
|
+
}),
|
|
64
|
+
"depth24plus-stencil8": f(
|
|
65
|
+
GL.DEPTH24_STENCIL8,
|
|
66
|
+
GL.DEPTH_STENCIL,
|
|
67
|
+
GL.UNSIGNED_INT_24_8,
|
|
68
|
+
4,
|
|
69
|
+
"depth",
|
|
70
|
+
true,
|
|
71
|
+
1,
|
|
72
|
+
{
|
|
73
|
+
depth: true,
|
|
74
|
+
stencil: true
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
"depth32float-stencil8": f(
|
|
78
|
+
GL.DEPTH32F_STENCIL8,
|
|
79
|
+
GL.DEPTH_STENCIL,
|
|
80
|
+
GL.FLOAT_32_UNSIGNED_INT_24_8_REV,
|
|
81
|
+
8,
|
|
82
|
+
"depth",
|
|
83
|
+
true,
|
|
84
|
+
1,
|
|
85
|
+
{ depth: true, stencil: true }
|
|
86
|
+
),
|
|
87
|
+
// Only as an attachment (a renderbuffer): WebGL2 can't sample stencil.
|
|
88
|
+
stencil8: f(GL.STENCIL_INDEX8, 0, 0, 1, "stencil", true, 1, { stencil: true }),
|
|
89
|
+
"bc5-rg-unorm": compressed(36285, "bc", { components: 2 }),
|
|
90
|
+
"bc7-rgba-unorm": compressed(36492, "bc"),
|
|
91
|
+
"bc7-rgba-unorm-srgb": compressed(36493, "bc", { srgb: true }),
|
|
92
|
+
"astc-4x4-unorm": compressed(37808, "astc"),
|
|
93
|
+
"astc-4x4-unorm-srgb": compressed(37840, "astc", { srgb: true }),
|
|
94
|
+
"etc2-rgba8unorm": compressed(37496, "etc2"),
|
|
95
|
+
"etc2-rgba8unorm-srgb": compressed(37497, "etc2", { srgb: true }),
|
|
96
|
+
"eac-rg11unorm": compressed(37490, "etc2", { components: 2 })
|
|
97
|
+
};
|
|
98
|
+
function formatOf(name) {
|
|
99
|
+
const format = FORMATS[name];
|
|
100
|
+
if (!format) throw new Error(`gpu-webgl2/unsupported: the texture format "${name}"`);
|
|
101
|
+
return format;
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
FORMATS,
|
|
105
|
+
formatOf
|
|
106
|
+
};
|
package/dist/gl.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export declare const GL: {
|
|
2
|
+
readonly ARRAY_BUFFER: 34962;
|
|
3
|
+
readonly ELEMENT_ARRAY_BUFFER: 34963;
|
|
4
|
+
readonly UNIFORM_BUFFER: 35345;
|
|
5
|
+
readonly COPY_READ_BUFFER: 36662;
|
|
6
|
+
readonly COPY_WRITE_BUFFER: 36663;
|
|
7
|
+
readonly PIXEL_PACK_BUFFER: 35051;
|
|
8
|
+
readonly PIXEL_UNPACK_BUFFER: 35052;
|
|
9
|
+
readonly STATIC_DRAW: 35044;
|
|
10
|
+
readonly DYNAMIC_DRAW: 35048;
|
|
11
|
+
readonly STREAM_READ: 35041;
|
|
12
|
+
readonly DYNAMIC_READ: 35049;
|
|
13
|
+
readonly BYTE: 5120;
|
|
14
|
+
readonly UNSIGNED_BYTE: 5121;
|
|
15
|
+
readonly SHORT: 5122;
|
|
16
|
+
readonly UNSIGNED_SHORT: 5123;
|
|
17
|
+
readonly INT: 5124;
|
|
18
|
+
readonly UNSIGNED_INT: 5125;
|
|
19
|
+
readonly FLOAT: 5126;
|
|
20
|
+
readonly HALF_FLOAT: 5131;
|
|
21
|
+
readonly UNSIGNED_INT_2_10_10_10_REV: 33640;
|
|
22
|
+
readonly UNSIGNED_INT_10F_11F_11F_REV: 35899;
|
|
23
|
+
readonly UNSIGNED_INT_24_8: 34042;
|
|
24
|
+
readonly FLOAT_32_UNSIGNED_INT_24_8_REV: 36269;
|
|
25
|
+
readonly RED: 6403;
|
|
26
|
+
readonly RG: 33319;
|
|
27
|
+
readonly RGB: 6407;
|
|
28
|
+
readonly RGBA: 6408;
|
|
29
|
+
readonly RED_INTEGER: 36244;
|
|
30
|
+
readonly RG_INTEGER: 33320;
|
|
31
|
+
readonly RGBA_INTEGER: 36249;
|
|
32
|
+
readonly DEPTH_COMPONENT: 6402;
|
|
33
|
+
readonly DEPTH_STENCIL: 34041;
|
|
34
|
+
readonly STENCIL_INDEX8: 36168;
|
|
35
|
+
readonly R8: 33321;
|
|
36
|
+
readonly RG8: 33323;
|
|
37
|
+
readonly RGBA8: 32856;
|
|
38
|
+
readonly SRGB8_ALPHA8: 35907;
|
|
39
|
+
readonly RGB10_A2: 32857;
|
|
40
|
+
readonly R16F: 33325;
|
|
41
|
+
readonly RG16F: 33327;
|
|
42
|
+
readonly RGBA16F: 34842;
|
|
43
|
+
readonly R32F: 33326;
|
|
44
|
+
readonly RG32F: 33328;
|
|
45
|
+
readonly RGBA32F: 34836;
|
|
46
|
+
readonly R11F_G11F_B10F: 35898;
|
|
47
|
+
readonly R8UI: 33330;
|
|
48
|
+
readonly RGBA8UI: 36220;
|
|
49
|
+
readonly R16UI: 33332;
|
|
50
|
+
readonly R32UI: 33334;
|
|
51
|
+
readonly RG32UI: 33340;
|
|
52
|
+
readonly RGBA32UI: 36208;
|
|
53
|
+
readonly DEPTH_COMPONENT16: 33189;
|
|
54
|
+
readonly DEPTH_COMPONENT24: 33190;
|
|
55
|
+
readonly DEPTH_COMPONENT32F: 36012;
|
|
56
|
+
readonly DEPTH24_STENCIL8: 35056;
|
|
57
|
+
readonly DEPTH32F_STENCIL8: 36013;
|
|
58
|
+
readonly TEXTURE_2D: 3553;
|
|
59
|
+
readonly TEXTURE_2D_ARRAY: 35866;
|
|
60
|
+
readonly TEXTURE_3D: 32879;
|
|
61
|
+
readonly TEXTURE_CUBE_MAP: 34067;
|
|
62
|
+
readonly TEXTURE_CUBE_MAP_POSITIVE_X: 34069;
|
|
63
|
+
readonly TEXTURE0: 33984;
|
|
64
|
+
readonly TEXTURE_BASE_LEVEL: 33084;
|
|
65
|
+
readonly TEXTURE_MAX_LEVEL: 33085;
|
|
66
|
+
readonly TEXTURE_MIN_FILTER: 10241;
|
|
67
|
+
readonly TEXTURE_MAG_FILTER: 10240;
|
|
68
|
+
readonly TEXTURE_WRAP_S: 10242;
|
|
69
|
+
readonly TEXTURE_WRAP_T: 10243;
|
|
70
|
+
readonly TEXTURE_WRAP_R: 32882;
|
|
71
|
+
readonly TEXTURE_MIN_LOD: 33082;
|
|
72
|
+
readonly TEXTURE_MAX_LOD: 33083;
|
|
73
|
+
readonly TEXTURE_COMPARE_MODE: 34892;
|
|
74
|
+
readonly TEXTURE_COMPARE_FUNC: 34893;
|
|
75
|
+
readonly COMPARE_REF_TO_TEXTURE: 34894;
|
|
76
|
+
readonly NONE: 0;
|
|
77
|
+
readonly NEAREST: 9728;
|
|
78
|
+
readonly LINEAR: 9729;
|
|
79
|
+
readonly NEAREST_MIPMAP_NEAREST: 9984;
|
|
80
|
+
readonly LINEAR_MIPMAP_NEAREST: 9985;
|
|
81
|
+
readonly NEAREST_MIPMAP_LINEAR: 9986;
|
|
82
|
+
readonly LINEAR_MIPMAP_LINEAR: 9987;
|
|
83
|
+
readonly REPEAT: 10497;
|
|
84
|
+
readonly CLAMP_TO_EDGE: 33071;
|
|
85
|
+
readonly MIRRORED_REPEAT: 33648;
|
|
86
|
+
readonly TEXTURE_MAX_ANISOTROPY_EXT: 34046;
|
|
87
|
+
readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: 34047;
|
|
88
|
+
readonly UNPACK_ALIGNMENT: 3317;
|
|
89
|
+
readonly PACK_ALIGNMENT: 3333;
|
|
90
|
+
readonly UNPACK_ROW_LENGTH: 3314;
|
|
91
|
+
readonly UNPACK_IMAGE_HEIGHT: 32878;
|
|
92
|
+
readonly UNPACK_SKIP_ROWS: 3315;
|
|
93
|
+
readonly UNPACK_SKIP_PIXELS: 3316;
|
|
94
|
+
readonly UNPACK_SKIP_IMAGES: 32877;
|
|
95
|
+
readonly UNPACK_FLIP_Y_WEBGL: 37440;
|
|
96
|
+
readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: 37441;
|
|
97
|
+
readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: 37443;
|
|
98
|
+
readonly PACK_ROW_LENGTH: 3330;
|
|
99
|
+
readonly FRAMEBUFFER: 36160;
|
|
100
|
+
readonly READ_FRAMEBUFFER: 36008;
|
|
101
|
+
readonly DRAW_FRAMEBUFFER: 36009;
|
|
102
|
+
readonly RENDERBUFFER: 36161;
|
|
103
|
+
readonly COLOR_ATTACHMENT0: 36064;
|
|
104
|
+
readonly DEPTH_ATTACHMENT: 36096;
|
|
105
|
+
readonly STENCIL_ATTACHMENT: 36128;
|
|
106
|
+
readonly DEPTH_STENCIL_ATTACHMENT: 33306;
|
|
107
|
+
readonly FRAMEBUFFER_COMPLETE: 36053;
|
|
108
|
+
readonly COLOR_BUFFER_BIT: 16384;
|
|
109
|
+
readonly DEPTH_BUFFER_BIT: 256;
|
|
110
|
+
readonly STENCIL_BUFFER_BIT: 1024;
|
|
111
|
+
readonly COLOR: 6144;
|
|
112
|
+
readonly DEPTH: 6145;
|
|
113
|
+
readonly STENCIL: 6146;
|
|
114
|
+
readonly BACK: 1029;
|
|
115
|
+
readonly SAMPLES: 32937;
|
|
116
|
+
readonly BLEND: 3042;
|
|
117
|
+
readonly DITHER: 3024;
|
|
118
|
+
readonly CULL_FACE: 2884;
|
|
119
|
+
readonly DEPTH_TEST: 2929;
|
|
120
|
+
readonly STENCIL_TEST: 2960;
|
|
121
|
+
readonly SCISSOR_TEST: 3089;
|
|
122
|
+
readonly POLYGON_OFFSET_FILL: 32823;
|
|
123
|
+
readonly RASTERIZER_DISCARD: 35977;
|
|
124
|
+
readonly FRONT: 1028;
|
|
125
|
+
readonly FRONT_AND_BACK: 1032;
|
|
126
|
+
readonly CW: 2304;
|
|
127
|
+
readonly CCW: 2305;
|
|
128
|
+
readonly NEVER: 512;
|
|
129
|
+
readonly LESS: 513;
|
|
130
|
+
readonly EQUAL: 514;
|
|
131
|
+
readonly LEQUAL: 515;
|
|
132
|
+
readonly GREATER: 516;
|
|
133
|
+
readonly NOTEQUAL: 517;
|
|
134
|
+
readonly GEQUAL: 518;
|
|
135
|
+
readonly ALWAYS: 519;
|
|
136
|
+
readonly KEEP: 7680;
|
|
137
|
+
readonly ZERO: 0;
|
|
138
|
+
readonly ONE: 1;
|
|
139
|
+
readonly REPLACE: 7681;
|
|
140
|
+
readonly INCR: 7682;
|
|
141
|
+
readonly DECR: 7683;
|
|
142
|
+
readonly INVERT: 5386;
|
|
143
|
+
readonly INCR_WRAP: 34055;
|
|
144
|
+
readonly DECR_WRAP: 34056;
|
|
145
|
+
readonly SRC_COLOR: 768;
|
|
146
|
+
readonly ONE_MINUS_SRC_COLOR: 769;
|
|
147
|
+
readonly SRC_ALPHA: 770;
|
|
148
|
+
readonly ONE_MINUS_SRC_ALPHA: 771;
|
|
149
|
+
readonly DST_ALPHA: 772;
|
|
150
|
+
readonly ONE_MINUS_DST_ALPHA: 773;
|
|
151
|
+
readonly DST_COLOR: 774;
|
|
152
|
+
readonly ONE_MINUS_DST_COLOR: 775;
|
|
153
|
+
readonly SRC_ALPHA_SATURATE: 776;
|
|
154
|
+
readonly CONSTANT_COLOR: 32769;
|
|
155
|
+
readonly ONE_MINUS_CONSTANT_COLOR: 32770;
|
|
156
|
+
readonly FUNC_ADD: 32774;
|
|
157
|
+
readonly FUNC_SUBTRACT: 32778;
|
|
158
|
+
readonly FUNC_REVERSE_SUBTRACT: 32779;
|
|
159
|
+
readonly MIN: 32775;
|
|
160
|
+
readonly MAX: 32776;
|
|
161
|
+
readonly TRIANGLES: 4;
|
|
162
|
+
readonly TRIANGLE_STRIP: 5;
|
|
163
|
+
readonly LINES: 1;
|
|
164
|
+
readonly LINE_STRIP: 3;
|
|
165
|
+
readonly POINTS: 0;
|
|
166
|
+
readonly VERTEX_SHADER: 35633;
|
|
167
|
+
readonly FRAGMENT_SHADER: 35632;
|
|
168
|
+
readonly COMPILE_STATUS: 35713;
|
|
169
|
+
readonly LINK_STATUS: 35714;
|
|
170
|
+
readonly UNIFORM_BLOCK_DATA_SIZE: 35392;
|
|
171
|
+
readonly COMPLETION_STATUS_KHR: 37297;
|
|
172
|
+
readonly SYNC_GPU_COMMANDS_COMPLETE: 37143;
|
|
173
|
+
readonly SYNC_STATUS: 37140;
|
|
174
|
+
readonly SIGNALED: 37145;
|
|
175
|
+
readonly ALREADY_SIGNALED: 37146;
|
|
176
|
+
readonly CONDITION_SATISFIED: 37148;
|
|
177
|
+
readonly TIMEOUT_EXPIRED: 37147;
|
|
178
|
+
readonly WAIT_FAILED: 37149;
|
|
179
|
+
readonly MAX_TEXTURE_SIZE: 3379;
|
|
180
|
+
readonly MAX_3D_TEXTURE_SIZE: 32883;
|
|
181
|
+
readonly MAX_ARRAY_TEXTURE_LAYERS: 35071;
|
|
182
|
+
readonly MAX_CUBE_MAP_TEXTURE_SIZE: 34076;
|
|
183
|
+
readonly MAX_TEXTURE_IMAGE_UNITS: 34930;
|
|
184
|
+
readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: 35660;
|
|
185
|
+
readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: 35661;
|
|
186
|
+
readonly MAX_UNIFORM_BLOCK_SIZE: 35376;
|
|
187
|
+
readonly MAX_VERTEX_UNIFORM_BLOCKS: 35371;
|
|
188
|
+
readonly MAX_FRAGMENT_UNIFORM_BLOCKS: 35373;
|
|
189
|
+
readonly MAX_COMBINED_UNIFORM_BLOCKS: 35374;
|
|
190
|
+
readonly MAX_UNIFORM_BUFFER_BINDINGS: 35375;
|
|
191
|
+
readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: 35380;
|
|
192
|
+
readonly MAX_DRAW_BUFFERS: 34852;
|
|
193
|
+
readonly MAX_COLOR_ATTACHMENTS: 36063;
|
|
194
|
+
readonly MAX_VERTEX_ATTRIBS: 34921;
|
|
195
|
+
readonly MAX_VARYING_COMPONENTS: 35659;
|
|
196
|
+
readonly MAX_SAMPLES: 36183;
|
|
197
|
+
readonly MAX_RENDERBUFFER_SIZE: 34024;
|
|
198
|
+
readonly MAX_VERTEX_UNIFORM_VECTORS: 36347;
|
|
199
|
+
readonly MAX_ELEMENT_INDEX: 36203;
|
|
200
|
+
readonly NO_ERROR: 0;
|
|
201
|
+
readonly INVALID_ENUM: 1280;
|
|
202
|
+
readonly INVALID_VALUE: 1281;
|
|
203
|
+
readonly INVALID_OPERATION: 1282;
|
|
204
|
+
readonly OUT_OF_MEMORY: 1285;
|
|
205
|
+
readonly INVALID_FRAMEBUFFER_OPERATION: 1286;
|
|
206
|
+
readonly CONTEXT_LOST_WEBGL: 37442;
|
|
207
|
+
readonly UNMASKED_VENDOR_WEBGL: 37445;
|
|
208
|
+
readonly UNMASKED_RENDERER_WEBGL: 37446;
|
|
209
|
+
readonly VENDOR: 7936;
|
|
210
|
+
readonly RENDERER: 7937;
|
|
211
|
+
};
|
|
212
|
+
/** EXT_clip_control, when present. */
|
|
213
|
+
export declare const CLIP: {
|
|
214
|
+
readonly LOWER_LEFT_EXT: 36001;
|
|
215
|
+
readonly ZERO_TO_ONE_EXT: 37727;
|
|
216
|
+
};
|