mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
- Add USDLoadOptions with memory limits to web binding C++ code - Implement architecture-specific defaults: 2GB for WASM32, 8GB for WASM64 - Add TINYUSDZ_WASM_MEMORY64 preprocessor define for WASM64 builds - Update JavaScript wrapper with memory limit configuration API - Add getNativeDefaultMemoryLimitMB() method to query architecture defaults - Support per-operation memory limit overrides in load/parse methods - Update documentation and examples for both build architectures - Add build examples script for WASM32/WASM64 configurations Security enhancement to prevent memory exhaustion attacks when loading potentially malicious USD files in web environments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
1.2 KiB
Bash
Executable File
35 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# TinyUSDZ Web Build Examples
|
|
# This script demonstrates different build configurations with various memory limits
|
|
|
|
echo "TinyUSDZ Web Build Examples"
|
|
echo "=========================="
|
|
echo
|
|
|
|
# Clean previous builds
|
|
rm -rf build
|
|
|
|
echo "1. Standard WASM32 build (2GB memory limit default)"
|
|
echo "---------------------------------------------------"
|
|
mkdir build-wasm32
|
|
emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DTINYUSDZ_WASM64=OFF -Bbuild-wasm32
|
|
echo "Build command: emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DTINYUSDZ_WASM64=OFF -Bbuild-wasm32"
|
|
echo "Memory default: 2GB (2048 MB)"
|
|
echo
|
|
|
|
echo "2. WASM64/MEMORY64 build (8GB memory limit default)"
|
|
echo "---------------------------------------------------"
|
|
mkdir build-wasm64
|
|
emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DTINYUSDZ_WASM64=ON -Bbuild-wasm64
|
|
echo "Build command: emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DTINYUSDZ_WASM64=ON -Bbuild-wasm64"
|
|
echo "Memory default: 8GB (8192 MB)"
|
|
echo
|
|
|
|
echo "To build, run:"
|
|
echo " make -C build-wasm32 # For WASM32 build"
|
|
echo " make -C build-wasm64 # For WASM64 build"
|
|
echo
|
|
|
|
echo "Note: WASM64/MEMORY64 requires browsers with MEMORY64 support"
|
|
echo "(Chrome 109+, Firefox 102+ with flags enabled)" |