xbintsc 0.5.37 → 0.5.41
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/dist/src/cli/help.d.ts +1 -1
- package/dist/src/codegen/generator/module.js +23 -7
- package/dist/src/codegen/generator/module.js.map +1 -1
- package/dist/src/codegen/generator/state.js +1 -0
- package/dist/src/codegen/generator/state.js.map +1 -1
- package/dist/src/codegen/generator/tables.js +1 -0
- package/dist/src/codegen/generator/tables.js.map +1 -1
- package/dist/src/driver/bundler/deferred.d.ts +63 -0
- package/dist/src/driver/bundler/deferred.js +279 -0
- package/dist/src/driver/bundler/deferred.js.map +1 -0
- package/dist/src/driver/bundler/merge.js +214 -2
- package/dist/src/driver/bundler/merge.js.map +1 -1
- package/dist/src/driver/runtime-objects.d.ts +1 -1
- package/dist/src/driver/runtime-objects.js +1 -0
- package/dist/src/driver/runtime-objects.js.map +1 -1
- package/dist/src/driver/version.d.ts +1 -1
- package/dist/src/driver/version.js +1 -1
- package/dist/src/extensions/gui/html.js +98 -15
- package/dist/src/extensions/gui/html.js.map +1 -1
- package/dist/src/extensions/gui/index.js +1 -0
- package/dist/src/extensions/gui/index.js.map +1 -1
- package/dist/src/extensions/gui/three.d.ts +4 -3
- package/dist/src/extensions/gui/three.js +4 -3
- package/dist/src/extensions/gui/three.js.map +1 -1
- package/dist/tests/codegen/closures.test.js +7 -0
- package/dist/tests/codegen/closures.test.js.map +1 -1
- package/dist/tests/e2e/compile-objects-classes.test.js +31 -0
- package/dist/tests/e2e/compile-objects-classes.test.js.map +1 -1
- package/dist/tests/e2e/gui-canvas-state.test.d.ts +9 -0
- package/dist/tests/e2e/gui-canvas-state.test.js +297 -0
- package/dist/tests/e2e/gui-canvas-state.test.js.map +1 -0
- package/dist/tests/e2e/gui-draw-perf.test.d.ts +22 -0
- package/dist/tests/e2e/gui-draw-perf.test.js +405 -0
- package/dist/tests/e2e/gui-draw-perf.test.js.map +1 -0
- package/dist/tests/e2e/gui-perf.test.d.ts +23 -0
- package/dist/tests/e2e/gui-perf.test.js +283 -0
- package/dist/tests/e2e/gui-perf.test.js.map +1 -0
- package/dist/tests/e2e/gui-script-import-order.test.d.ts +10 -0
- package/dist/tests/e2e/gui-script-import-order.test.js +169 -0
- package/dist/tests/e2e/gui-script-import-order.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl.test.js +4 -4
- package/dist/tests/e2e/gui-webgl.test.js.map +1 -1
- package/dist/tests/e2e/gui-webgl2-shadow-sampler.test.d.ts +8 -0
- package/dist/tests/e2e/gui-webgl2-shadow-sampler.test.js +336 -0
- package/dist/tests/e2e/gui-webgl2-shadow-sampler.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl2-shadow.test.d.ts +10 -0
- package/dist/tests/e2e/gui-webgl2-shadow.test.js +108 -0
- package/dist/tests/e2e/gui-webgl2-shadow.test.js.map +1 -0
- package/dist/tests/e2e/url.test.d.ts +6 -0
- package/dist/tests/e2e/url.test.js +114 -0
- package/dist/tests/e2e/url.test.js.map +1 -0
- package/dist/tests/extensions/gui.test.js +45 -10
- package/dist/tests/extensions/gui.test.js.map +1 -1
- package/doc/gui/api.md +28 -2
- package/doc/gui/canvas.md +110 -27
- package/doc/gui/known-issues.md +32 -10
- package/doc/gui/rendering.md +77 -0
- package/doc/gui/runtime.md +18 -3
- package/doc/gui/webgl.md +58 -29
- package/doc/gui-scripts.md +19 -19
- package/doc/gui.md +43 -9
- package/doc/implemented/fetch.md +5 -0
- package/doc/implemented/modules.md +13 -0
- package/doc/implemented/stdlib.md +17 -0
- package/doc/unimplemented/deviations.md +1 -0
- package/doc/zh-CN/gui/api.md +25 -2
- package/doc/zh-CN/gui/canvas.md +95 -26
- package/doc/zh-CN/gui/known-issues.md +21 -4
- package/doc/zh-CN/gui/rendering.md +59 -0
- package/doc/zh-CN/gui/runtime.md +13 -3
- package/doc/zh-CN/gui/webgl.md +30 -8
- package/doc/zh-CN/gui-scripts.md +14 -13
- package/doc/zh-CN/gui.md +32 -8
- package/doc/zh-CN/implemented/fetch.md +4 -0
- package/doc/zh-CN/implemented/modules.md +10 -0
- package/doc/zh-CN/implemented/stdlib.md +15 -0
- package/doc/zh-CN/unimplemented/deviations.md +1 -0
- package/package.json +7 -7
- package/runtime/ext_gui/browser.cpp +3 -1
- package/runtime/ext_gui/canvas.cpp +135 -89
- package/runtime/ext_gui/canvas.h +116 -0
- package/runtime/ext_gui/canvas_clip.cpp +143 -0
- package/runtime/ext_gui/canvas_composite.cpp +241 -0
- package/runtime/ext_gui/canvas_coverage.cpp +241 -0
- package/runtime/ext_gui/canvas_gradient.cpp +41 -4
- package/runtime/ext_gui/canvas_image_data.cpp +4 -0
- package/runtime/ext_gui/canvas_internal.h +34 -9
- package/runtime/ext_gui/canvas_raster.cpp +207 -178
- package/runtime/ext_gui/canvas_shadow.cpp +161 -0
- package/runtime/ext_gui/canvas_stroke.cpp +37 -9
- package/runtime/ext_gui/canvas_style.cpp +59 -0
- package/runtime/ext_gui/canvas_text.cpp +140 -0
- package/runtime/ext_gui/css.h +7 -0
- package/runtime/ext_gui/css_sheet.cpp +22 -0
- package/runtime/ext_gui/document.cpp +25 -1
- package/runtime/ext_gui/document.h +8 -0
- package/runtime/ext_gui/dom_api_canvas.cpp +16 -1
- package/runtime/ext_gui/dom_api_canvas_image.cpp +9 -0
- package/runtime/ext_gui/dom_api_canvas_state.cpp +217 -0
- package/runtime/ext_gui/dom_api_internal.h +36 -37
- package/runtime/ext_gui/dom_api_offscreen.cpp +213 -0
- package/runtime/ext_gui/dom_api_proto.cpp +18 -0
- package/runtime/ext_gui/dom_api_webgl.cpp +29 -9
- package/runtime/ext_gui/dom_api_webgl2.cpp +33 -1
- package/runtime/ext_gui/dom_api_webgl_internal.h +58 -0
- package/runtime/ext_gui/dom_api_webgl_source.cpp +18 -0
- package/runtime/ext_gui/gradient_values.cpp +12 -1
- package/runtime/ext_gui/gui.cpp +5 -0
- package/runtime/ext_gui/gui_canvas.cpp +4 -0
- package/runtime/ext_gui/gui_engine.h +32 -0
- package/runtime/ext_gui/gui_events.cpp +182 -58
- package/runtime/ext_gui/gui_media.cpp +3 -0
- package/runtime/ext_gui/image.cpp +69 -0
- package/runtime/ext_gui/image_bitmap_browser.cpp +11 -0
- package/runtime/ext_gui/layout.cpp +4 -0
- package/runtime/ext_gui/paint.cpp +19 -0
- package/runtime/ext_gui/paint_background.cpp +18 -1
- package/runtime/ext_gui/perf.cpp +171 -0
- package/runtime/ext_gui/perf.h +127 -0
- package/runtime/ext_gui/renderer.cpp +109 -41
- package/runtime/ext_gui/renderer.h +33 -9
- package/runtime/ext_gui/renderer_image.cpp +135 -65
- package/runtime/ext_gui/renderer_internal.h +15 -3
- package/runtime/ext_gui/renderer_text.cpp +24 -12
- package/runtime/ext_gui/script.cpp +31 -0
- package/runtime/ext_gui/style.cpp +101 -30
- package/runtime/ext_gui/style.h +6 -3
- package/runtime/ext_gui/style_print.cpp +7 -1
- package/runtime/ext_gui/text.cpp +23 -4
- package/runtime/ext_gui/text.h +29 -0
- package/runtime/ext_gui/text_cache.cpp +118 -0
- package/runtime/ext_gui/text_glyph_cache.cpp +100 -0
- package/runtime/ext_gui/webgl.h +48 -146
- package/runtime/ext_gui/webgl_blit.cpp +12 -1
- package/runtime/ext_gui/webgl_blit_depth.cpp +270 -0
- package/runtime/ext_gui/webgl_buffer.cpp +59 -1
- package/runtime/ext_gui/webgl_buffer_objects.cpp +106 -9
- package/runtime/ext_gui/webgl_clear.cpp +3 -0
- package/runtime/ext_gui/webgl_context.cpp +29 -3
- package/runtime/ext_gui/webgl_draw.cpp +75 -270
- package/runtime/ext_gui/webgl_draw_buffers.cpp +1 -0
- package/runtime/ext_gui/webgl_draw_setup.cpp +321 -0
- package/runtime/ext_gui/webgl_draw_state.h +130 -0
- package/runtime/ext_gui/webgl_glsl.h +3 -0
- package/runtime/ext_gui/webgl_glsl_scan.cpp +3 -8
- package/runtime/ext_gui/webgl_glsl_unroll.cpp +283 -0
- package/runtime/ext_gui/webgl_msl.cpp +4 -0
- package/runtime/ext_gui/webgl_objects.h +148 -0
- package/runtime/ext_gui/webgl_pipeline.cpp +8 -8
- package/runtime/ext_gui/webgl_program_internal.h +35 -0
- package/runtime/ext_gui/webgl_shader.cpp +34 -36
- package/runtime/ext_gui/webgl_webgl2.cpp +36 -0
- package/runtime/ext_gui/window.cpp +56 -1
- package/runtime/rt.h +3 -0
- package/runtime/xt_fetch/async.inc +60 -0
- package/runtime/xt_url_object.c +463 -0
- package/src/codegen/generator/module.ts +22 -7
- package/src/codegen/generator/state.ts +1 -0
- package/src/codegen/generator/tables.ts +1 -0
- package/src/driver/bundler/deferred.ts +351 -0
- package/src/driver/bundler/merge.ts +219 -2
- package/src/driver/runtime-objects.ts +1 -0
- package/src/driver/version.ts +1 -1
- package/src/extensions/gui/html.ts +100 -17
- package/src/extensions/gui/index.ts +1 -0
- package/src/extensions/gui/three.ts +4 -3
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end test for the `gui` extension — rendering performance counters.
|
|
3
|
+
*
|
|
4
|
+
* A 200-row list (about 1,000 boxes plus text) is loaded, then one thing is
|
|
5
|
+
* changed per frame: a text node, a class, an inline width, and a burst of
|
|
6
|
+
* pointer moves. The engine reports what each frame actually did through
|
|
7
|
+
* `win.stats()` (see `runtime/ext_gui/perf.h`), and the test pins the shape of
|
|
8
|
+
* that work:
|
|
9
|
+
*
|
|
10
|
+
* - a text/class/width change restyles once and repaints once;
|
|
11
|
+
* - a pointer move over a page without `:hover` rules does not restyle;
|
|
12
|
+
* - an idle frame lays out, paints, uploads and presents nothing (a present
|
|
13
|
+
* the window system asked for, or one a starved frame had to defer, is
|
|
14
|
+
* reported separately as `exposes`/`deferred` and is not counted as the
|
|
15
|
+
* page's work);
|
|
16
|
+
* - `@media` is evaluated once per rule, not once per rule and node;
|
|
17
|
+
* - unchanged text is shaped once and then served from the cache.
|
|
18
|
+
*
|
|
19
|
+
* Only counters are asserted (they are deterministic); the wall-clock numbers
|
|
20
|
+
* are printed for a human and, on the machine that ran the suite, compared
|
|
21
|
+
* against `XBINTSC_GUI_PERF_STRICT_MS` (unset in CI, where the GPU is software).
|
|
22
|
+
*/
|
|
23
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
24
|
+
import { createGuiHarness, guiAvailable } from "./gui-helpers.js";
|
|
25
|
+
const harness = createGuiHarness();
|
|
26
|
+
/** The row count of the generated page (three elements per row). */
|
|
27
|
+
const ROWS = 200;
|
|
28
|
+
/** Parse `perf.<phase> key=value ...` lines out of the program's stdout. */
|
|
29
|
+
function parsePhases(stdout) {
|
|
30
|
+
const phases = {};
|
|
31
|
+
for (const line of stdout.split("\n")) {
|
|
32
|
+
const match = /^(perf\.[a-z0-9]+)[ \t]+(.*)$/.exec(line);
|
|
33
|
+
if (match === null)
|
|
34
|
+
continue;
|
|
35
|
+
const phase = match[1];
|
|
36
|
+
const rest = match[2];
|
|
37
|
+
if (phase === undefined || rest === undefined)
|
|
38
|
+
continue;
|
|
39
|
+
const fields = {};
|
|
40
|
+
for (const token of rest.split(/\s+/)) {
|
|
41
|
+
const equals = token.indexOf("=");
|
|
42
|
+
if (equals > 0)
|
|
43
|
+
fields[token.slice(0, equals)] = token.slice(equals + 1);
|
|
44
|
+
}
|
|
45
|
+
phases[phase] = fields;
|
|
46
|
+
}
|
|
47
|
+
return phases;
|
|
48
|
+
}
|
|
49
|
+
function count(phases, phase, key) {
|
|
50
|
+
const fields = phases[phase];
|
|
51
|
+
if (fields === undefined)
|
|
52
|
+
throw new Error(`missing ${phase} line in the program output`);
|
|
53
|
+
const raw = fields[key];
|
|
54
|
+
if (raw === undefined)
|
|
55
|
+
throw new Error(`missing ${phase}.${key} in the program output`);
|
|
56
|
+
const value = Number(raw);
|
|
57
|
+
if (Number.isNaN(value))
|
|
58
|
+
throw new Error(`${phase}.${key} is not a number`);
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Presents the page caused: every presented frame minus the ones the frame loop
|
|
63
|
+
* had to attribute to something other than this frame's work.
|
|
64
|
+
*
|
|
65
|
+
* `exposes` is a redraw the *window system* asked for. A headless X server maps
|
|
66
|
+
* the window whenever it gets around to it and then sends `Expose`, which the
|
|
67
|
+
* engine must honour (the window has no contents) — that arrives at a time no
|
|
68
|
+
* test can schedule, and only on a slow runner does it land inside the quiet
|
|
69
|
+
* sample. `deferred` is a present a starved frame had to postpone: SDL's
|
|
70
|
+
* non-blocking swapchain acquire skips a frame while the GPU still holds the
|
|
71
|
+
* image, and the engine then presents the retained paint on the next frame (see
|
|
72
|
+
* `runtime/ext_gui/perf.h`).
|
|
73
|
+
*/
|
|
74
|
+
function pagePresents(phases, phase) {
|
|
75
|
+
return (count(phases, phase, "presents") -
|
|
76
|
+
count(phases, phase, "exposes") -
|
|
77
|
+
count(phases, phase, "deferred"));
|
|
78
|
+
}
|
|
79
|
+
describe.skipIf(!guiAvailable)("gui extension — rendering performance", () => {
|
|
80
|
+
beforeAll(() => harness.setup());
|
|
81
|
+
afterAll(() => harness.cleanup());
|
|
82
|
+
it("scales with the change instead of the whole document", () => {
|
|
83
|
+
const result = harness.compileAndRun("perf-stress", `
|
|
84
|
+
import { createWindow, run } from "gui";
|
|
85
|
+
|
|
86
|
+
const ROWS = ${ROWS};
|
|
87
|
+
|
|
88
|
+
const CSS = \`
|
|
89
|
+
* { margin: 0; padding: 0; }
|
|
90
|
+
html, body { background-color: #05070a; color: #d0d8e0; font-size: 12px; }
|
|
91
|
+
.row { display: flex; height: 22px; padding: 2px 6px; background-color: #101418; }
|
|
92
|
+
.label { flex: 1; color: #d0d8e0; }
|
|
93
|
+
.value { width: 80px; color: #6fd3a0; }
|
|
94
|
+
.hot { background-color: #2a303a; }
|
|
95
|
+
@media (max-width: 500px) { .row { height: 16px; } }
|
|
96
|
+
@media (min-width: 500px) { .value { width: 90px; } }
|
|
97
|
+
\`;
|
|
98
|
+
|
|
99
|
+
let body = "";
|
|
100
|
+
for (let i = 0; i < ROWS; i++) {
|
|
101
|
+
body = body + '<div class="row"><span class="label">Item ' + i +
|
|
102
|
+
'</span><span class="value">' + (1000 + i) + "</span></div>";
|
|
103
|
+
}
|
|
104
|
+
const HTML = "<html><head><style>" + CSS + "</style></head><body>" +
|
|
105
|
+
"<div id='root'>" + body + "</div></body></html>";
|
|
106
|
+
|
|
107
|
+
const win = createWindow({ title: "perf", width: 900, height: 700 });
|
|
108
|
+
win.setBackground("#05070a");
|
|
109
|
+
win.loadHTML(HTML);
|
|
110
|
+
|
|
111
|
+
const doc = win.document;
|
|
112
|
+
const labels = doc.querySelectorAll(".label");
|
|
113
|
+
const values = doc.querySelectorAll(".value");
|
|
114
|
+
const rows = doc.querySelectorAll(".row");
|
|
115
|
+
|
|
116
|
+
const round = (value: number): number => Math.round(value * 100) / 100;
|
|
117
|
+
|
|
118
|
+
/** Print the work the frame that just finished did. */
|
|
119
|
+
const report = (label: string, before: any, after: any): void => {
|
|
120
|
+
console.log(label +
|
|
121
|
+
" restyles=" + (after.restyles - before.restyles) +
|
|
122
|
+
" nodes=" + (after.restyleNodes - before.restyleNodes) +
|
|
123
|
+
" rules=" + (after.rulesEvaluated - before.rulesEvaluated) +
|
|
124
|
+
" media=" + (after.mediaEvaluated - before.mediaEvaluated) +
|
|
125
|
+
" layouts=" + (after.layouts - before.layouts) +
|
|
126
|
+
" boxes=" + (after.layoutBoxes - before.layoutBoxes) +
|
|
127
|
+
" shapes=" + (after.textShapeCalls - before.textShapeCalls) +
|
|
128
|
+
" hits=" + (after.textShapeHits - before.textShapeHits) +
|
|
129
|
+
" paints=" + (after.paints - before.paints) +
|
|
130
|
+
" ops=" + (after.paintOps - before.paintOps) +
|
|
131
|
+
" runs=" + (after.drawRuns - before.drawRuns) +
|
|
132
|
+
" draws=" + (after.drawCalls - before.drawCalls) +
|
|
133
|
+
" uploads=" + (after.uploadSubmits - before.uploadSubmits) +
|
|
134
|
+
" presents=" + (after.presents - before.presents) +
|
|
135
|
+
" exposes=" + (after.exposes - before.exposes) +
|
|
136
|
+
" deferred=" + (after.deferred - before.deferred) +
|
|
137
|
+
" starved=" + (after.starvedFrames - before.starvedFrames) +
|
|
138
|
+
" frames=" + (after.frames - before.frames) +
|
|
139
|
+
" sync=" + (after.syncNodes - before.syncNodes) +
|
|
140
|
+
" ms=" + round(after.frameMs) +
|
|
141
|
+
" restyleMs=" + round(after.restyleMs) +
|
|
142
|
+
" layoutMs=" + round(after.layoutMs) +
|
|
143
|
+
" paintMs=" + round(after.paintMs) +
|
|
144
|
+
" uploadMs=" + round(after.uploadMs) +
|
|
145
|
+
" drawMs=" + round(after.drawMs));
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const phases = ["perf.idle", "perf.text", "perf.class", "perf.width", "perf.hover"];
|
|
149
|
+
let step = 0;
|
|
150
|
+
let before: any = null;
|
|
151
|
+
let tailBefore: any = null;
|
|
152
|
+
let tailStarted = false;
|
|
153
|
+
|
|
154
|
+
const apply = (index: number): void => {
|
|
155
|
+
if (index === 1) labels[0].textContent = "Item 0 changed";
|
|
156
|
+
else if (index === 2) rows[5].classList.add("hot");
|
|
157
|
+
else if (index === 3) values[7].style.width = "120px";
|
|
158
|
+
else if (index === 4) {
|
|
159
|
+
for (let i = 0; i < 6; i++) win.sendEvent("mousemove", { x: 200, y: 40 + i * 22 });
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const finish = (): void => {
|
|
164
|
+
const now: any = win.stats();
|
|
165
|
+
report("perf.idle2", tailBefore, now);
|
|
166
|
+
console.log("perf.page rows=" + ROWS + " labels=" + labels.length +
|
|
167
|
+
" treeNodes=" + now.treeNodes);
|
|
168
|
+
win.close();
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/* The quiet-period sample: the first timer snapshot still contains the
|
|
172
|
+
* last animated frame, so take one more 60 ms apart and compare from
|
|
173
|
+
* there. No animation frame is pending, so the engine must present
|
|
174
|
+
* nothing while the counter still advances. */
|
|
175
|
+
const tail = (): void => {
|
|
176
|
+
if (tailStarted) return;
|
|
177
|
+
tailStarted = true;
|
|
178
|
+
tailBefore = win.stats();
|
|
179
|
+
win.setTimeout(finish, 60);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const tick = (): void => {
|
|
183
|
+
const now: any = win.stats();
|
|
184
|
+
if (before !== null && step <= phases.length) report(phases[step - 1], before, now);
|
|
185
|
+
if (step >= phases.length) {
|
|
186
|
+
win.setTimeout(tail, 40);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
before = now;
|
|
190
|
+
apply(step);
|
|
191
|
+
step = step + 1;
|
|
192
|
+
win.requestAnimationFrame(tick);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
win.on("ready", () => {
|
|
196
|
+
console.log("perf.ready driver=" + win.driver());
|
|
197
|
+
win.requestAnimationFrame(tick);
|
|
198
|
+
});
|
|
199
|
+
win.on("close", () => console.log("perf.closed"));
|
|
200
|
+
run();
|
|
201
|
+
console.log("perf.exit");
|
|
202
|
+
`, { autocloseMs: 8000, console: true });
|
|
203
|
+
expect(result.stdout).toContain("perf.ready");
|
|
204
|
+
expect(result.stdout).toContain("perf.closed");
|
|
205
|
+
const phases = parsePhases(result.stdout);
|
|
206
|
+
/* The generated page really is the large one. */
|
|
207
|
+
expect(count(phases, "perf.page", "rows")).toBe(ROWS);
|
|
208
|
+
expect(count(phases, "perf.page", "labels")).toBe(ROWS);
|
|
209
|
+
expect(count(phases, "perf.page", "treeNodes")).toBeGreaterThan(ROWS * 4);
|
|
210
|
+
/* First animated frame after the document settled: it presents, but the
|
|
211
|
+
* document is not restyled, laid out or repainted again. The sample is a
|
|
212
|
+
* single frame, so an expose the window system asked for in it coalesces
|
|
213
|
+
* into the same present and does not change the count. If the GPU or the
|
|
214
|
+
* compositor had no image for it, the frame is counted as `starved` instead
|
|
215
|
+
* and its present happens on a later frame. */
|
|
216
|
+
expect(count(phases, "perf.idle", "restyles")).toBe(0);
|
|
217
|
+
expect(count(phases, "perf.idle", "layouts")).toBe(0);
|
|
218
|
+
expect(count(phases, "perf.idle", "paints")).toBe(0);
|
|
219
|
+
const idlePresented = count(phases, "perf.idle", "presents") + count(phases, "perf.idle", "starved");
|
|
220
|
+
expect(idlePresented).toBe(1);
|
|
221
|
+
/* Every presented frame issues one draw per run — the documented cost of
|
|
222
|
+
* the current painter-order batching. */
|
|
223
|
+
if (count(phases, "perf.idle", "presents") > 0) {
|
|
224
|
+
expect(count(phases, "perf.idle", "draws")).toBeGreaterThanOrEqual(ROWS);
|
|
225
|
+
}
|
|
226
|
+
/* One text change: one restyle, one layout, one repaint. */
|
|
227
|
+
expect(count(phases, "perf.text", "restyles")).toBe(1);
|
|
228
|
+
expect(count(phases, "perf.text", "nodes")).toBeGreaterThan(ROWS * 2);
|
|
229
|
+
expect(count(phases, "perf.text", "layouts")).toBe(1);
|
|
230
|
+
expect(count(phases, "perf.text", "paints")).toBe(1);
|
|
231
|
+
/* The repaint rebuilt the alternating runs, and the frame that drew them
|
|
232
|
+
* issued one draw per run. A frame with no drawable target (no swapchain
|
|
233
|
+
* image, a window with no drawable area) records no draws and is presented
|
|
234
|
+
* again later instead — the engine keeps the paint pending, so the runs are
|
|
235
|
+
* not lost; that is what `deferred` reports. */
|
|
236
|
+
expect(count(phases, "perf.text", "runs")).toBeGreaterThanOrEqual(ROWS);
|
|
237
|
+
const textDraws = count(phases, "perf.text", "draws");
|
|
238
|
+
if (textDraws > 0) {
|
|
239
|
+
expect(textDraws).toBe(count(phases, "perf.text", "runs"));
|
|
240
|
+
}
|
|
241
|
+
/* `@media` is evaluated once per rule, not once per rule and node. */
|
|
242
|
+
expect(count(phases, "perf.text", "media")).toBeLessThanOrEqual(2);
|
|
243
|
+
/* Text is shaped from the cache: only the changed words are new. */
|
|
244
|
+
expect(count(phases, "perf.text", "hits")).toBeGreaterThan(ROWS);
|
|
245
|
+
expect(count(phases, "perf.text", "shapes")).toBeLessThan(ROWS);
|
|
246
|
+
/* A class change repaints; a width change reflows. */
|
|
247
|
+
expect(count(phases, "perf.class", "paints")).toBe(1);
|
|
248
|
+
expect(count(phases, "perf.width", "layouts")).toBe(1);
|
|
249
|
+
/* Pointer moves over a document without `:hover` rules must not restyle. */
|
|
250
|
+
expect(count(phases, "perf.hover", "restyles")).toBe(0);
|
|
251
|
+
expect(count(phases, "perf.hover", "layouts")).toBe(0);
|
|
252
|
+
/* Nothing changed across a quiet period: no restyle, no layout, no paint,
|
|
253
|
+
* no upload, no present of the page's making and no draw, while frames keep
|
|
254
|
+
* being served. A present the window system asked for (`exposes`) or a
|
|
255
|
+
* starved frame deferred (`deferred`) is not the page's, but it does replay
|
|
256
|
+
* the retained draws — so the draw assertion only applies to a quiet window
|
|
257
|
+
* the compositor left alone. */
|
|
258
|
+
expect(count(phases, "perf.idle2", "frames")).toBeGreaterThan(0);
|
|
259
|
+
expect(count(phases, "perf.idle2", "restyles")).toBe(0);
|
|
260
|
+
expect(count(phases, "perf.idle2", "layouts")).toBe(0);
|
|
261
|
+
expect(count(phases, "perf.idle2", "paints")).toBe(0);
|
|
262
|
+
expect(count(phases, "perf.idle2", "uploads")).toBe(0);
|
|
263
|
+
expect(pagePresents(phases, "perf.idle2")).toBe(0);
|
|
264
|
+
if (count(phases, "perf.idle2", "exposes") === 0 &&
|
|
265
|
+
count(phases, "perf.idle2", "deferred") === 0) {
|
|
266
|
+
expect(count(phases, "perf.idle2", "draws")).toBe(0);
|
|
267
|
+
}
|
|
268
|
+
/* A human-readable wall-clock line, and an opt-in local budget. */
|
|
269
|
+
console.log("gui perf: " +
|
|
270
|
+
`textFrame=${count(phases, "perf.text", "ms")}ms ` +
|
|
271
|
+
`restyle=${count(phases, "perf.text", "restyleMs")}ms ` +
|
|
272
|
+
`layout=${count(phases, "perf.text", "layoutMs")}ms ` +
|
|
273
|
+
`paint=${count(phases, "perf.text", "paintMs")}ms ` +
|
|
274
|
+
`upload=${count(phases, "perf.text", "uploadMs")}ms ` +
|
|
275
|
+
`draw=${count(phases, "perf.text", "drawMs")}ms ` +
|
|
276
|
+
`runs=${count(phases, "perf.text", "runs")}`);
|
|
277
|
+
const strictMs = Number(process.env.XBINTSC_GUI_PERF_STRICT_MS ?? "0");
|
|
278
|
+
if (strictMs > 0) {
|
|
279
|
+
expect(count(phases, "perf.text", "ms")).toBeLessThan(strictMs);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
//# sourceMappingURL=gui-perf.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gui-perf.test.js","sourceRoot":"","sources":["../../../tests/e2e/gui-perf.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;AAEnC,oEAAoE;AACpE,MAAM,IAAI,GAAG,GAAG,CAAC;AAKjB,4EAA4E;AAC5E,SAAS,WAAW,CAAC,MAAc;IACjC,MAAM,MAAM,GAAW,EAAE,CAAC;IAC1B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzD,IAAI,KAAK,KAAK,IAAI;YAAE,SAAS;QAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS;YAAE,SAAS;QACxD,MAAM,MAAM,GAAW,EAAE,CAAC;QAC1B,KAAK,MAAM,KAAK,IAAI,IAAI,CA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;YACjD,QAAQ,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,CAC/C,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,GAAG,CAAC,CAAC;QACvE,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAClE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GUI e2e: `<script src>` module imports run after `loadHTML`.
|
|
3
|
+
*
|
|
4
|
+
* A browser evaluates a module script's import graph after the document has
|
|
5
|
+
* been parsed, so the imported modules already see real elements (and any DOM
|
|
6
|
+
* work at their top level is not wasted on an empty document). The `.html`
|
|
7
|
+
* loader marks relative imports as deferred; the bundler wraps the module and
|
|
8
|
+
* the registered script invokes it at `loadHTML` time.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GUI e2e: `<script src>` module imports run after `loadHTML`.
|
|
3
|
+
*
|
|
4
|
+
* A browser evaluates a module script's import graph after the document has
|
|
5
|
+
* been parsed, so the imported modules already see real elements (and any DOM
|
|
6
|
+
* work at their top level is not wasted on an empty document). The `.html`
|
|
7
|
+
* loader marks relative imports as deferred; the bundler wraps the module and
|
|
8
|
+
* the registered script invokes it at `loadHTML` time.
|
|
9
|
+
*/
|
|
10
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
11
|
+
import { createGuiHarness, guiAvailable } from "./gui-helpers.js";
|
|
12
|
+
import { nodeExtension } from "../../src/extensions/node/index.js";
|
|
13
|
+
const harness = createGuiHarness();
|
|
14
|
+
const PROBE_PAGE = `<html><body>
|
|
15
|
+
<div class="touch"></div><div class="touch"></div><div class="touch"></div>
|
|
16
|
+
<canvas id="probe-canvas" width="120" height="80"></canvas>
|
|
17
|
+
<script src="./probe.ts"></script>
|
|
18
|
+
</body></html>`;
|
|
19
|
+
const PAGE = `<html><body>
|
|
20
|
+
<div id="box">hi</div>
|
|
21
|
+
<script src="./app.ts"></script>
|
|
22
|
+
<script src="./app2.ts"></script>
|
|
23
|
+
<script src="./app3.ts"></script>
|
|
24
|
+
<script src="./app4.ts"></script>
|
|
25
|
+
<script src="./app6.ts"></script>
|
|
26
|
+
<script src="./app7.ts"></script>
|
|
27
|
+
<script src="./app8.ts"></script>
|
|
28
|
+
<script src="./app9.ts"></script>
|
|
29
|
+
<script src="./app10.ts"></script>
|
|
30
|
+
<script src="./app11.ts"></script>
|
|
31
|
+
</body></html>`;
|
|
32
|
+
describe.skipIf(!guiAvailable)("gui extension — deferred <script src> imports", () => {
|
|
33
|
+
beforeAll(() => harness.setup());
|
|
34
|
+
afterAll(() => harness.cleanup());
|
|
35
|
+
it("evaluates the import graph after loadHTML and shares module state", () => {
|
|
36
|
+
const { value, stdout } = harness.compileAndRun("script-import-order", `
|
|
37
|
+
import { createWindow } from "gui";
|
|
38
|
+
import page from "./page.html";
|
|
39
|
+
import { shared } from "./shared";
|
|
40
|
+
|
|
41
|
+
const win = createWindow({ title: "deferred", width: 320, height: 240 });
|
|
42
|
+
console.log("shared-main=" + shared);
|
|
43
|
+
const label = (name: string, value: any): void => console.log(name + "=" + value);
|
|
44
|
+
label("before", (win as any).imported === undefined ? "undefined" : "set");
|
|
45
|
+
label("before-deep", (win as any).deep === undefined ? "undefined" : "set");
|
|
46
|
+
win.loadHTML(page);
|
|
47
|
+
label("after", (win as any).imported);
|
|
48
|
+
label("after-deep", (win as any).deep);
|
|
49
|
+
label("body", (win as any).scriptBody);
|
|
50
|
+
win.close();
|
|
51
|
+
`, {
|
|
52
|
+
extensions: [nodeExtension],
|
|
53
|
+
files: {
|
|
54
|
+
"page.html": PAGE,
|
|
55
|
+
"app.ts": `
|
|
56
|
+
import { probe } from "./helper";
|
|
57
|
+
const box = document.getElementById("box");
|
|
58
|
+
console.log("app=" + box.textContent);
|
|
59
|
+
( window as any ).scriptBody = probe() + ":" + box.textContent;
|
|
60
|
+
`,
|
|
61
|
+
"app2.ts": `
|
|
62
|
+
import { bump } from "./counter";
|
|
63
|
+
console.log("app2=" + bump());
|
|
64
|
+
`,
|
|
65
|
+
"helper.ts": `
|
|
66
|
+
import "./deep";
|
|
67
|
+
const box = document.getElementById("box");
|
|
68
|
+
( window as any ).imported = "yes:" + box.textContent;
|
|
69
|
+
console.log("helper=" + box.textContent);
|
|
70
|
+
export function probe(): string { return "probe"; }
|
|
71
|
+
`,
|
|
72
|
+
"deep.ts": `
|
|
73
|
+
( window as any ).deep = "yes";
|
|
74
|
+
console.log("deep");
|
|
75
|
+
`,
|
|
76
|
+
"counter.ts": `
|
|
77
|
+
import { seed } from "./seed";
|
|
78
|
+
let n = 0;
|
|
79
|
+
export function bump(): number { n += seed; return n; }
|
|
80
|
+
`,
|
|
81
|
+
"seed.ts": "export const seed = 1;",
|
|
82
|
+
"app3.ts": 'import { value } from "./reexport"; console.log("app3=" + value);',
|
|
83
|
+
"reexport.ts": 'import { value } from "./value"; export { value };',
|
|
84
|
+
"app6.ts": 'import { shared } from "./shared"; console.log("app6=" + shared);',
|
|
85
|
+
"shared.ts": 'export const shared = "s"; console.log("shared-eager");',
|
|
86
|
+
"app7.ts": 'import { A, E } from "./klass"; console.log("app7=" + new A().x + ":" + E.One);',
|
|
87
|
+
"klass.ts": 'export class A { x = 1; } export enum E { One }',
|
|
88
|
+
"app8.ts": 'import make from "./anon"; console.log("app8=" + make());',
|
|
89
|
+
"anon.ts": 'export default function () { return 5; }',
|
|
90
|
+
"app9.ts": 'import Shape from "./anonclass"; console.log("app9=" + new Shape().x);',
|
|
91
|
+
"anonclass.ts": 'export default class { x = 3; }',
|
|
92
|
+
"app10.ts": 'import * as math from "./mathmod"; console.log("app10=" + math.add(2, 3) + math.tag);',
|
|
93
|
+
"mathmod.ts": 'export function add(a: number, b: number): number { return a + b; } export const tag = "m";',
|
|
94
|
+
"app11.ts": 'import { readEmpty } from "./guilib"; console.log("app11=" + (readEmpty() === ""));',
|
|
95
|
+
"guilib.ts": 'import { readFileSync } from "fs"; export function readEmpty(): string { return readFileSync("/dev/null", "utf8"); }',
|
|
96
|
+
"value.ts": 'export const value = "v";',
|
|
97
|
+
"app4.ts": 'import { value } from "./wide"; console.log("app4=" + value);',
|
|
98
|
+
"wide.ts": 'export * from "./value";',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
/* Module top-level code runs while the script functions run (during
|
|
102
|
+
* loadHTML), not at program start. */
|
|
103
|
+
expect(value("before")).toBe("undefined");
|
|
104
|
+
expect(value("before-deep")).toBe("undefined");
|
|
105
|
+
expect(value("after")).toBe("yes:hi");
|
|
106
|
+
expect(value("after-deep")).toBe("yes");
|
|
107
|
+
expect(value("body")).toBe("probe:hi");
|
|
108
|
+
expect(stdout).toContain("helper=hi");
|
|
109
|
+
expect(stdout).toContain("deep");
|
|
110
|
+
/* The script order is document order, and the shared module was evaluated
|
|
111
|
+
* once, so the second script sees the incremented state. */
|
|
112
|
+
expect(stdout.indexOf("helper=hi")).toBeLessThan(stdout.indexOf("app="));
|
|
113
|
+
expect(stdout).toContain("app2=1");
|
|
114
|
+
expect(stdout).toContain("app3=v");
|
|
115
|
+
expect(stdout).toContain("app4=v");
|
|
116
|
+
expect(stdout).toContain("app6=s");
|
|
117
|
+
expect(stdout).toContain("app7=1:0");
|
|
118
|
+
expect(stdout).toContain("app8=5");
|
|
119
|
+
expect(stdout).toContain("app9=3");
|
|
120
|
+
expect(stdout).toContain("app10=5m");
|
|
121
|
+
expect(stdout).toContain("app11=true");
|
|
122
|
+
expect(stdout).toContain("shared-main=s");
|
|
123
|
+
/* The shared module was already reachable eagerly and must not run twice. */
|
|
124
|
+
expect(stdout.match(/shared-eager/g)?.length).toBe(1);
|
|
125
|
+
});
|
|
126
|
+
it("gives imported modules the real window, document and canvas", () => {
|
|
127
|
+
const { value } = harness.compileAndRun("script-import-probe", `
|
|
128
|
+
import { createWindow } from "gui";
|
|
129
|
+
import page from "./probe.html";
|
|
130
|
+
|
|
131
|
+
const win = createWindow({ title: "probe", width: 1280, height: 720 });
|
|
132
|
+
const label = (name: string, value: any): void => console.log(name + "=" + value);
|
|
133
|
+
label("before", (win as any).probe === undefined ? "undefined" : "set");
|
|
134
|
+
win.loadHTML(page);
|
|
135
|
+
label("size", (win as any).innerWidth + "x" + (win as any).innerHeight);
|
|
136
|
+
label("probe", (win as any).probe);
|
|
137
|
+
win.close();
|
|
138
|
+
`, {
|
|
139
|
+
files: {
|
|
140
|
+
"probe.html": PROBE_PAGE,
|
|
141
|
+
"probe.ts": `
|
|
142
|
+
const canvas: any = document.getElementById("probe-canvas");
|
|
143
|
+
const gl: any = canvas.getContext("webgl2");
|
|
144
|
+
const span: any = document.createElement("span");
|
|
145
|
+
span.dataset.touch = "ok";
|
|
146
|
+
const touches = document.querySelectorAll(".touch");
|
|
147
|
+
( window as any ).probe = [
|
|
148
|
+
window.innerWidth + "x" + window.innerHeight,
|
|
149
|
+
touches.length,
|
|
150
|
+
span.tagName + ":" + span.dataset.touch,
|
|
151
|
+
canvas.width + "x" + canvas.height,
|
|
152
|
+
gl != null
|
|
153
|
+
].join(",");
|
|
154
|
+
console.log("probe-module=" + ( window as any ).probe);
|
|
155
|
+
`,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
expect(value("before")).toBe("undefined");
|
|
159
|
+
const parts = value("probe").split(",");
|
|
160
|
+
/* The module ran during `loadHTML` and saw the same window the program
|
|
161
|
+
* holds. Its size is compared rather than asserted literally: a runner may
|
|
162
|
+
* clamp the requested 1280×720 to its display (the macOS CI window comes
|
|
163
|
+
* back smaller), and the point here is that the deferred module reads the
|
|
164
|
+
* real window, not a particular size. */
|
|
165
|
+
expect(parts[0]).toBe(value("size"));
|
|
166
|
+
expect(parts.slice(1)).toEqual(["3", "SPAN:ok", "120x80", "true"]);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
//# sourceMappingURL=gui-script-import-order.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gui-script-import-order.test.js","sourceRoot":"","sources":["../../../tests/e2e/gui-script-import-order.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;AAEnC,MAAM,UAAU,GAAG;;;;eAIJ,CAAC;AAEhB,MAAM,IAAI,GAAG;;;;;;;;;;;;eAYE,CAAC;AAEhB,QAAQ,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,+CAA+C,EAAE,GAAG,EAAE;IACnF,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAElC,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAC7C,qBAAqB,EACrB;;;;;;;;;;;;;;;OAeC,EACD;YACE,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,KAAK,EAAE;gBACL,WAAW,EAAE,IAAI;gBACjB,QAAQ,EAAE;;;;;CAKnB;gBACS,SAAS,EAAE;;;CAGpB;gBACS,WAAW,EAAE;;;;;;CAMtB;gBACS,SAAS,EAAE;;;CAGpB;gBACS,YAAY,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AK,CAAC,GAAG,CAAC,CAAC;QACxC;;;;iDAIyC;QACzC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -175,7 +175,7 @@ describe.skipIf(!guiAvailable)("gui extension — WebGL", () => {
|
|
|
175
175
|
expect(stderr).not.toContain("pipeline creation failed");
|
|
176
176
|
expect(stderr).not.toContain("shader build");
|
|
177
177
|
});
|
|
178
|
-
it("supports blend constants, dynamic buffers, vertex textures, gl_FragDepth
|
|
178
|
+
it("supports blend constants, dynamic buffers, vertex textures, gl_FragDepth and context loss", () => {
|
|
179
179
|
const { value, stderr } = harness.compileAndRun("webgl-extra", `
|
|
180
180
|
import { createWindow } from "gui";
|
|
181
181
|
import page from "./page.html";
|
|
@@ -287,7 +287,7 @@ describe.skipIf(!guiAvailable)("gui extension — WebGL", () => {
|
|
|
287
287
|
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
288
288
|
label("vertex-texture", probe());
|
|
289
289
|
|
|
290
|
-
// --- shader-written depth is
|
|
290
|
+
// --- shader-written depth is translated ----------------------------
|
|
291
291
|
const depth_fs: any = gl.createShader(gl.FRAGMENT_SHADER);
|
|
292
292
|
gl.shaderSource(depth_fs, "precision mediump float;" +
|
|
293
293
|
"void main() { gl_FragDepth = 0.5; gl_FragColor = vec4(1.0); }");
|
|
@@ -325,8 +325,8 @@ describe.skipIf(!guiAvailable)("gui extension — WebGL", () => {
|
|
|
325
325
|
expect(value("vtex-vs")).toBe("true");
|
|
326
326
|
expect(value("vtex-link")).toBe("true");
|
|
327
327
|
expect(value("vertex-texture")).toBe("0,255,0,255");
|
|
328
|
-
expect(value("fragdepth")).toBe("
|
|
329
|
-
expect(value("fragdepth-log")).toContain("gl_FragDepth");
|
|
328
|
+
expect(value("fragdepth")).toBe("true");
|
|
329
|
+
expect(value("fragdepth-log")).not.toContain("gl_FragDepth is not supported");
|
|
330
330
|
expect(value("lose-ext")).toBe("true");
|
|
331
331
|
expect(value("lost")).toBe("true");
|
|
332
332
|
expect(value("lost-error")).toBe("37442"); // GL_CONTEXT_LOST_WEBGL
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gui-webgl.test.js","sourceRoot":"","sources":["../../../tests/e2e/gui-webgl.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;AAEnC,MAAM,IAAI,GAAG;;;;eAIE,CAAC;AAEhB,QAAQ,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAC3D,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAElC,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAC7C,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqIC,EACD,EAAE,KAAK,EA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eAAe,CAAC,CAAC;QAClD,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC9C,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAClD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GUI e2e: comparative shadow samplers and `gl_FragDepth`.
|
|
3
|
+
*
|
|
4
|
+
* `sampler2DShadow` must reach SDL_GPU as a comparison sampler, and a fragment
|
|
5
|
+
* shader that writes `gl_FragDepth` must actually update the depth attachment.
|
|
6
|
+
* Both are checked by rendering and reading pixels back.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|