Commit Graph
6 Commits
Author SHA1 Message Date
西风逍遥游 104dac8725 fix(webgpu): give the default sphere demo its own file and rebuild scene on demo switch 2026-08-22 01:33:05 +08:00
西风逍遥游 2693c361e3 fix(webgpu): playground console cap, canvas-scoped keyboard, demo scene reset 2026-08-22 01:27:53 +08:00
西风逍遥游 cffe868416 feat(webgpu): async frame readback + playground screenshot
Frame readback (saveFramePng/getPixel) previously crashed the WASM runtime
when called from the playground bridge: emscripten_sleep inside a deep
JS->Squirrel->Graphics call chain breaks ASYNCIFY (rewind hits 'unreachable').

- add async two-phase readback to the webgpu backend (beginFrameReadback /
  frameReadbackStatus, pumped from present() so the map callback is delivered
  on the browser event loop without sleeping)
- bridge: eve_playground_capture / eve_playground_readback_status /
  eve_playground_read_bytes (binary-safe VFS read)
- playground: 截图 button captures the current frame and previews the PNG
- bump ASYNCIFY_STACK_SIZE and TOTAL_STACK (1 MiB) for deep native chains
- export HEAPU8 for binary reads from the page
2026-08-21 20:49:29 +08:00
西风逍遥游 63445728e1 feat(webgpu): online playground with live script hot-reload
Adds a self-contained browser playground (editor + canvas + console + REPL)
around the Emscripten WebGPU build, plus the engine fixes required to render:
- JS<->Squirrel bridge (apply/eval/read/pause) and Emscripten 6 exports
- soft hot-reload via load.nut handle_change with __pg state preservation
- fix Uint16 index buffer byte sizes in SetIndexBuffer calls
- fix dangling GbufferSlot/SceneColorSlot gpuHandle pointers (std::move bug)
- fallback shadow depth texture when no shadow map is configured
- fix WGSL syntax (mod/ivec2) and default shadow sampler maxAnisotropy
- serve_webgpu.py COOP/COEP server and playground docs/demos/assets
2026-08-21 20:35:20 +08:00
西风逍遥游 b3e5cfc5b2 fix(webgpu): build config, module init, and loading overlay
- Link eve to eve.html via --shell-file so the shell template is actually applied and regenerated on every build; track the shell as a link dependency.
- Keep C++ exception catching enabled under ASYNCIFY so expose() failures abort cleanly instead of asserting on __cxa_throw.
- ModuleManager::exposeVM no longer find()+catch for the eve table: Runtime::initialize() guarantees expose() runs once, and ASYNCIFY-wrapped frames can drop the catch and leak NotFoundException.
- Expose window.hideEVELoading and call it on the first presented frame so the shell's loading overlay is dismissed.
- FileWatch.h includes common/config.h so EVENGINE_WEBGPU is defined before the Poco guard.
2026-08-15 17:06:33 +08:00
西风逍遥游 8dd21d3ea3 feat(webgpu): integrate WebGPU backend support and enhance build configuration
- Added support for the WebGPU backend in the CMake configuration, enabling builds for Emscripten and native Dawn.
- Implemented conditional compilation for WebGPU-specific features, including shader management and file system handling.
- Updated the build process to exclude unnecessary modules and dependencies for WebGPU, optimizing the engine for browser environments.
- Enhanced the installation script to include WebGPU-related files and directories in the output.
- Refactored existing modules to accommodate WebGPU, ensuring compatibility and performance improvements across the engine.
- Introduced new compile options and configurations tailored for WebGPU builds, including handling of third-party libraries and assets.
2026-08-15 10:46:26 +08:00