Files
EVEngine/scripts/open_webgpu.bat
T
西风逍遥游 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

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%\build\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