@gtkx/gl 0.21.0 → 1.0.0-rc.1
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/README.md +137 -82
- package/dist/generated/commands.d.ts +286 -289
- package/dist/generated/commands.d.ts.map +1 -1
- package/dist/generated/commands.js +342 -403
- package/dist/generated/commands.js.map +1 -1
- package/dist/generated/enums.d.ts +1363 -1367
- package/dist/generated/enums.d.ts.map +1 -1
- package/dist/generated/enums.js +1363 -1367
- package/dist/generated/enums.js.map +1 -1
- package/dist/generated/types.d.ts +4 -16
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/generated/types.js +2 -6
- package/dist/generated/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/overrides.d.ts +44 -0
- package/dist/overrides.d.ts.map +1 -0
- package/dist/{companion.js → overrides.js} +31 -4
- package/dist/overrides.js.map +1 -0
- package/package.json +15 -8
- package/src/generated/commands.ts +879 -3592
- package/src/generated/enums.ts +1363 -1367
- package/src/generated/types.ts +4 -20
- package/src/index.ts +1 -1
- package/src/{companion.ts → overrides.ts} +53 -9
- package/dist/companion.d.ts +0 -8
- package/dist/companion.d.ts.map +0 -1
- package/dist/companion.js.map +0 -1
package/src/generated/types.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GENERATED FILE
|
|
3
|
-
*
|
|
4
|
-
* Emitted by the `@gtkx/codegen` Khronos generator from the vendored
|
|
5
|
-
* `registry/gl.xml` (gl 4.6 core profile). Regenerate with
|
|
6
|
-
* `pnpm --filter @gtkx/codegen codegen:gl`.
|
|
2
|
+
* GENERATED FILE: do not edit.
|
|
7
3
|
*/
|
|
8
4
|
|
|
9
|
-
import type
|
|
5
|
+
import { type ExternalObject, type Handle } from "@gtkx/native";
|
|
10
6
|
|
|
11
7
|
/** An opaque `GLsync` fence handle. */
|
|
12
|
-
export type GLsync = Handle
|
|
8
|
+
export type GLsync = ExternalObject<Handle>;
|
|
13
9
|
|
|
14
10
|
/** An opaque native pointer handle (e.g. a `glMapBufferRange` mapping). */
|
|
15
|
-
export type GLpointer = Handle
|
|
11
|
+
export type GLpointer = ExternalObject<Handle>;
|
|
16
12
|
|
|
17
13
|
/** The C `GLenum` scalar. */
|
|
18
14
|
export type GLenum = number;
|
|
@@ -41,24 +37,12 @@ export type GLshort = number;
|
|
|
41
37
|
/** The C `GLushort` scalar. */
|
|
42
38
|
export type GLushort = number;
|
|
43
39
|
|
|
44
|
-
/** The C `GLfixed` scalar. */
|
|
45
|
-
export type GLfixed = number;
|
|
46
|
-
|
|
47
|
-
/** The C `GLclampx` scalar. */
|
|
48
|
-
export type GLclampx = number;
|
|
49
|
-
|
|
50
40
|
/** The C `GLfloat` scalar. */
|
|
51
41
|
export type GLfloat = number;
|
|
52
42
|
|
|
53
|
-
/** The C `GLclampf` scalar. */
|
|
54
|
-
export type GLclampf = number;
|
|
55
|
-
|
|
56
43
|
/** The C `GLdouble` scalar. */
|
|
57
44
|
export type GLdouble = number;
|
|
58
45
|
|
|
59
|
-
/** The C `GLclampd` scalar. */
|
|
60
|
-
export type GLclampd = number;
|
|
61
|
-
|
|
62
46
|
/** The C `GLint64` scalar. */
|
|
63
47
|
export type GLint64 = number;
|
|
64
48
|
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t } from "@gtkx/
|
|
2
|
-
import { clientWaitSync, enable, getProgramiv, getProgramPipelineiv, getShaderiv } from "./generated/commands.js";
|
|
1
|
+
import { t } from "@gtkx/runtime";
|
|
2
|
+
import { clientWaitSync, enable, getProgramiv, getProgramPipelineiv, getShaderiv, LIB } from "./generated/commands.js";
|
|
3
3
|
import {
|
|
4
4
|
ALREADY_SIGNALED,
|
|
5
5
|
CONDITION_SATISFIED,
|
|
@@ -8,9 +8,17 @@ import {
|
|
|
8
8
|
INFO_LOG_LENGTH,
|
|
9
9
|
TIMEOUT_EXPIRED,
|
|
10
10
|
} from "./generated/enums.js";
|
|
11
|
-
import type {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import type {
|
|
12
|
+
DebugSeverity,
|
|
13
|
+
DebugSource,
|
|
14
|
+
DebugType,
|
|
15
|
+
GLenum,
|
|
16
|
+
GLint,
|
|
17
|
+
GLsync,
|
|
18
|
+
GLuint,
|
|
19
|
+
SyncObjectMask,
|
|
20
|
+
SyncStatus,
|
|
21
|
+
} from "./generated/types.js";
|
|
14
22
|
|
|
15
23
|
type LengthQuery = (id: GLuint, pname: GLenum) => GLint;
|
|
16
24
|
|
|
@@ -28,23 +36,46 @@ const readInfoLog = (symbol: string, id: GLuint, query: LengthQuery): string =>
|
|
|
28
36
|
return log.value;
|
|
29
37
|
};
|
|
30
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Reads the info log for a shader object, containing compilation diagnostics.
|
|
41
|
+
* @param shader The name of the shader object to query.
|
|
42
|
+
* @returns The shader info log, or an empty string when none is available.
|
|
43
|
+
*/
|
|
31
44
|
export function getShaderInfoLog(shader: GLuint): string {
|
|
32
45
|
return readInfoLog("glGetShaderInfoLog", shader, getShaderiv);
|
|
33
46
|
}
|
|
34
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Reads the info log for a program object, containing linking diagnostics.
|
|
50
|
+
* @param program The name of the program object to query.
|
|
51
|
+
* @returns The program info log, or an empty string when none is available.
|
|
52
|
+
*/
|
|
35
53
|
export function getProgramInfoLog(program: GLuint): string {
|
|
36
54
|
return readInfoLog("glGetProgramInfoLog", program, getProgramiv);
|
|
37
55
|
}
|
|
38
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Reads the info log for a program pipeline object, containing validation diagnostics.
|
|
59
|
+
* @param pipeline The name of the program pipeline object to query.
|
|
60
|
+
* @returns The pipeline info log, or an empty string when none is available.
|
|
61
|
+
*/
|
|
39
62
|
export function getProgramPipelineInfoLog(pipeline: GLuint): string {
|
|
40
63
|
return readInfoLog("glGetProgramPipelineInfoLog", pipeline, getProgramPipelineiv);
|
|
41
64
|
}
|
|
42
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Callback invoked for each GL debug message reported by the driver.
|
|
68
|
+
* @param source The origin of the message (API, window system, shader compiler, and so on).
|
|
69
|
+
* @param type The category of the message (error, deprecated behavior, performance, and so on).
|
|
70
|
+
* @param id The driver-assigned identifier of the message.
|
|
71
|
+
* @param severity The severity level of the message.
|
|
72
|
+
* @param message The human-readable message text.
|
|
73
|
+
*/
|
|
43
74
|
export type DebugMessageCallback = (
|
|
44
|
-
source:
|
|
45
|
-
type:
|
|
75
|
+
source: DebugSource,
|
|
76
|
+
type: DebugType,
|
|
46
77
|
id: GLuint,
|
|
47
|
-
severity:
|
|
78
|
+
severity: DebugSeverity,
|
|
48
79
|
message: string,
|
|
49
80
|
) => void;
|
|
50
81
|
|
|
@@ -60,6 +91,11 @@ const glDebugMessageCallbackBinding = t.bind(
|
|
|
60
91
|
t.void,
|
|
61
92
|
);
|
|
62
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Installs a callback that receives GL debug messages, enabling synchronous debug output.
|
|
96
|
+
* Passing null removes any previously installed callback.
|
|
97
|
+
* @param callback The handler to invoke for each debug message, or null to clear it.
|
|
98
|
+
*/
|
|
63
99
|
export function debugMessageCallback(callback: DebugMessageCallback | null): void {
|
|
64
100
|
if (callback === null) {
|
|
65
101
|
glDebugMessageCallbackBinding(null);
|
|
@@ -75,7 +111,15 @@ export function debugMessageCallback(callback: DebugMessageCallback | null): voi
|
|
|
75
111
|
|
|
76
112
|
const MAX_WAIT_CHUNK_NS = 1_000_000_000;
|
|
77
113
|
|
|
78
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Blocks until a sync object is signaled or the timeout elapses, looping over glClientWaitSync
|
|
116
|
+
* in bounded chunks so long waits are not truncated by the driver's per-call limit.
|
|
117
|
+
* @param sync The sync object (fence) to wait on.
|
|
118
|
+
* @param flags Flags controlling the wait, such as flushing pending commands on the first call.
|
|
119
|
+
* @param timeoutNs The total time to wait, in nanoseconds.
|
|
120
|
+
* @returns The status of the sync object: signaled, condition satisfied, or timeout expired.
|
|
121
|
+
*/
|
|
122
|
+
export function clientWaitSyncLoop(sync: GLsync, flags: SyncObjectMask, timeoutNs: number): SyncStatus {
|
|
79
123
|
let remaining = timeoutNs;
|
|
80
124
|
let currentFlags = flags;
|
|
81
125
|
for (;;) {
|
package/dist/companion.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { GLbitfield, GLenum, GLsync, GLuint } from "./generated/types.js";
|
|
2
|
-
export declare function getShaderInfoLog(shader: GLuint): string;
|
|
3
|
-
export declare function getProgramInfoLog(program: GLuint): string;
|
|
4
|
-
export declare function getProgramPipelineInfoLog(pipeline: GLuint): string;
|
|
5
|
-
export type DebugMessageCallback = (source: GLenum, type: GLenum, id: GLuint, severity: GLenum, message: string) => void;
|
|
6
|
-
export declare function debugMessageCallback(callback: DebugMessageCallback | null): void;
|
|
7
|
-
export declare function clientWaitSyncLoop(sync: GLsync, flags: GLbitfield, timeoutNs: number): GLenum;
|
|
8
|
-
//# sourceMappingURL=companion.d.ts.map
|
package/dist/companion.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"companion.d.ts","sourceRoot":"","sources":["../src/companion.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAoBtF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,MAAM,MAAM,oBAAoB,GAAG,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAA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