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
31 lines
1.1 KiB
Batchfile
31 lines
1.1 KiB
Batchfile
@echo off
|
|
rem Launch EVEngine WebGPU demo in the default browser.
|
|
rem Serves build/webgpu-web/src/engine with COOP/COEP headers (required for
|
|
rem Emscripten pthreads / SharedArrayBuffer) and opens eve.html.
|
|
|
|
setlocal
|
|
set "ROOT=%~dp0.."
|
|
set "ENGINE_DIR=%ROOT%\build\webgpu-web\src\engine"
|
|
|
|
if not exist "%ENGINE_DIR%\eve.js" (
|
|
echo eve.js not found. Build first:
|
|
echo emcmake cmake -B build/webgpu-web -G Ninja -DCMAKE_BUILD_TYPE=Release
|
|
echo cmake --build build/webgpu-web
|
|
exit /b 1
|
|
)
|
|
|
|
echo Checking for an existing server on 8090...
|
|
powershell -NoProfile -Command "try { (Invoke-WebRequest -Uri 'http://127.0.0.1:8090/eve.js' -Method Head -UseBasicParsing -TimeoutSec 2).StatusCode } catch { 'down' }" > "%TEMP%\eve_srv.txt"
|
|
set /p SRV=<"%TEMP%\eve_srv.txt"
|
|
if "%SRV%"=="200" (
|
|
echo Server already running on 8090.
|
|
) else (
|
|
echo Starting COOP/COEP server on 8090...
|
|
start "EVEngine WebGPU server" python "%ROOT%\scripts\serve_webgpu.py"
|
|
timeout /t 2 /nobreak >nul
|
|
)
|
|
|
|
echo Opening http://127.0.0.1:8090/eve.html ...
|
|
start "" "http://127.0.0.1:8090/eve.html"
|
|
endlocal
|