Commit graph

7 commits

Author SHA1 Message Date
Hermet Park
ac08a9d6e7 wg_engine: introduced global vertexbuffer mempool & ++thread safety
Manage the global buffer memory for vertex and indexed vertex buffers,
increase the memory size incrementally twice by default and reduce
the default buffer size, which is not suitable for typical scenarios.

This could reduce the a bit stack memory usage and improve
the portability across systems where has the stack memory
limitation and potentially gaining performance enhancement
by avoiding brutal stack memory usage at the many function calls.

added the internal functions:

- WgVertexBuffer* mpoolReqVertexBuffer(float scale = 1.0f);
- WgIndexedVertexBuffer* mpoolReqIndexedVertexBuffer(float scale = 1.0f);
- void mpoolRetVertexBuffer(WgVertexBuffer* buffer);
- void mpoolRetIndexedVertexBuffer(WgIndexedVertexBuffer* buffer);

issue: https://github.com/thorvg/thorvg/issues/3159
2025-02-17 18:56:31 +09:00
Jinny You
bb2cefe9bc wasm: optimize binary size
- Changed optimization flags to -Oz, reducing the binary size by 120KB.
- Applied wasm-opt convergence as a post-process to ensure the minimum possible size with the given optimization flag.
2025-02-17 15:05:10 +09:00
Jinny You
5d617c0821 wasm: remove ASYNCIFY to reduce binary size
The binary size recently increased due to the ASYNCIFY option, which was required for WebGPU initialization.

To prevent unnecessary binary size growth, ThorVG will no longer depend on asynchronous processes such as `emscripten_sleep` (ASYNCIFY or JSPI).

As a result, the combined WASM binary size has been significantly reduced to less than 1MB.

Size comparison: 1559KB → 998KB (-36%)
2024-12-13 14:53:55 +09:00
Jinny You
f017bb84c1 wasm: reduce WebGPU stack size
Reduce stack size to 2MB for optimized memory usage
2024-12-10 21:11:06 +09:00
Jinny You
40b82c26f5 wasm: increase stack size
Patch #2826 increased the stack size to 4MB
2024-10-07 18:41:12 +09:00
Jinny You
e70596629f wasm: increase stack size for WebGPU
Current WG Engine requires a minimum stack size of 2MB to function properly.
2024-10-07 12:14:13 +09:00
Jinny You
d704a2503a bindings/wasm: Support WebGPU
Updated WASM binding to bring WebGPU on the web player.

binding will generate a WASM binary, which can render animation through both SW and WG raster engine.

A raster engine will be chosen by parameter `engine`, when initializing.
2024-08-20 17:26:23 +09:00
Renamed from cross/wasm_webgpu.txt (Browse further)