Shapes example won't work in Firefox
Closed this issue · 2 comments
yanfrimmel commented
Error when running:
zig build run-shapes -Dtarget=wasm32-emscripten
Error details:
Uncaught RuntimeError: unreachable executed tick http://localhost:6931/shapes.js:1725
In the function 'if' statement:
var _emscripten_request_animation_frame_loop = (cb, userData) => {
function tick(timeStamp) {
if (getWasmTableEntry(cb)(timeStamp, userData)) {
requestAnimationFrame(tick);
}
}
return requestAnimationFrame(tick);
};
- "clear" example did work.
- c version did work from site.
- Tested with Firefox.
yanfrimmel commented
The problem is in these lines:
var vertices: [6 * 1024]sshape.Vertex = undefined;
var indices: [16 * 1024]u16 = undefined;
Those arrays are too large, that causes segmentation fault, consider using heap allocations.