Merge branch 'dev' into dev-timesamples-refactor

This commit is contained in:
Syoyo Fujita
2026-01-11 02:22:06 +09:00
5 changed files with 218 additions and 1 deletions

View File

@@ -116,6 +116,59 @@ jobs:
- name: tests
run: cd build && ctest --output-on-failure
# Test with OpenUSD binary
- name: Install TBB dependency
run: |
sudo apt-get update
sudo apt-get install -y libtbb12
- name: Download OpenUSD binary
run: |
gh release download v25.11-lte \
--repo lighttransport/openusd-bin \
--pattern 'openusd-*-minsizerel-linux-x86_64.tar.gz'
env:
GH_TOKEN: ${{ github.token }}
- name: Extract and setup OpenUSD
run: |
mkdir -p openusd
tar -xzf openusd-*-minsizerel-linux-x86_64.tar.gz -C openusd
USD_ROOT="$(pwd)/openusd"
echo "USD_INSTALL_ROOT=$USD_ROOT" >> $GITHUB_ENV
echo "$USD_ROOT/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=$USD_ROOT/lib:$USD_ROOT/tbb/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PYTHONPATH=$USD_ROOT/lib/python:$PYTHONPATH" >> $GITHUB_ENV
echo "PXR_PLUGINPATH_NAME=$USD_ROOT/lib/usd" >> $GITHUB_ENV
- name: Verify OpenUSD installation
run: |
usdcat --help
echo "OpenUSD binary: $(which usdcat)"
- name: Test TinyUSDZ and OpenUSD interoperability
run: |
echo "=== Testing TinyUSDZ <-> OpenUSD interoperability ==="
# Test 1: Read files with both tools
for usd_file in models/suzanne.usdc models/cube.usda; do
if [ -f "$usd_file" ]; then
echo "Testing $usd_file"
./build/tusdcat "$usd_file" > /tmp/tusdcat.txt
usdcat "$usd_file" > /tmp/usdcat.txt
echo "✓ Both tools read $usd_file"
fi
done
# Test 2: Convert with TinyUSDZ, verify with OpenUSD
if [ -f "models/suzanne.usdc" ]; then
./build/tusdcat models/suzanne.usdc > /tmp/tinyusdz.usda
usdcat /tmp/tinyusdz.usda > /dev/null
echo "✓ OpenUSD read TinyUSDZ-generated USDA"
fi
echo "All tests passed!"
# ARM64 ASan build to debug segfaults
build-arm64-asan:
@@ -227,3 +280,56 @@ jobs:
- name: tests
run: cd build && ctest --output-on-failure
# Test with OpenUSD binary (ARM64)
- name: Install TBB dependency (ARM64)
run: |
sudo apt-get update
sudo apt-get install -y libtbb12
- name: Download OpenUSD binary (ARM64)
run: |
gh release download v25.11-lte \
--repo lighttransport/openusd-bin \
--pattern 'openusd-*-minsizerel-linux-arm64.tar.gz'
env:
GH_TOKEN: ${{ github.token }}
- name: Extract and setup OpenUSD (ARM64)
run: |
mkdir -p openusd
tar -xzf openusd-*-minsizerel-linux-arm64.tar.gz -C openusd
USD_ROOT="$(pwd)/openusd"
echo "USD_INSTALL_ROOT=$USD_ROOT" >> $GITHUB_ENV
echo "$USD_ROOT/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=$USD_ROOT/lib:$USD_ROOT/tbb/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PYTHONPATH=$USD_ROOT/lib/python:$PYTHONPATH" >> $GITHUB_ENV
echo "PXR_PLUGINPATH_NAME=$USD_ROOT/lib/usd" >> $GITHUB_ENV
- name: Verify OpenUSD installation (ARM64)
run: |
usdcat --help
echo "OpenUSD binary: $(which usdcat)"
- name: Test TinyUSDZ and OpenUSD interoperability (ARM64)
run: |
echo "=== Testing TinyUSDZ <-> OpenUSD interoperability on ARM64 ==="
# Test 1: Read files with both tools
for usd_file in models/suzanne.usdc models/cube.usda tests/usdc/timesamples-array-vec2f-001.usdc; do
if [ -f "$usd_file" ]; then
echo "Testing $usd_file"
./build/tusdcat "$usd_file" > /tmp/tusdcat.txt
usdcat "$usd_file" > /tmp/usdcat.txt
echo "✓ Both tools read $usd_file"
fi
done
# Test 2: Convert with TinyUSDZ, verify with OpenUSD
if [ -f "models/suzanne.usdc" ]; then
./build/tusdcat models/suzanne.usdc > /tmp/tinyusdz.usda
usdcat /tmp/tinyusdz.usda > /dev/null
echo "✓ OpenUSD read TinyUSDZ-generated USDA"
fi
echo "All ARM64 tests passed!"

View File

@@ -27,3 +27,51 @@ jobs:
run: |
cd build
ctest --output-on-failure
# Test with OpenUSD binary (macOS ARM64)
- name: Download OpenUSD binary (macOS ARM64)
run: |
gh release download v25.11-lte \
--repo lighttransport/openusd-bin \
--pattern 'openusd-*-minsizerel-macos-arm64.tar.gz'
env:
GH_TOKEN: ${{ github.token }}
- name: Extract and setup OpenUSD (macOS ARM64)
run: |
mkdir -p openusd
tar -xzf openusd-*-minsizerel-macos-arm64.tar.gz -C openusd
USD_ROOT="$(pwd)/openusd"
echo "USD_INSTALL_ROOT=$USD_ROOT" >> $GITHUB_ENV
echo "$USD_ROOT/bin" >> $GITHUB_PATH
echo "DYLD_LIBRARY_PATH=$USD_ROOT/lib:$USD_ROOT/tbb/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PYTHONPATH=$USD_ROOT/lib/python:$PYTHONPATH" >> $GITHUB_ENV
echo "PXR_PLUGINPATH_NAME=$USD_ROOT/lib/usd" >> $GITHUB_ENV
- name: Verify OpenUSD installation (macOS ARM64)
run: |
usdcat --help
echo "OpenUSD binary: $(which usdcat)"
- name: Test TinyUSDZ and OpenUSD interoperability (macOS ARM64)
run: |
echo "=== Testing TinyUSDZ <-> OpenUSD interoperability on macOS ARM64 ==="
# Test 1: Read files with both tools
for usd_file in models/suzanne.usdc models/cube.usda; do
if [ -f "$usd_file" ]; then
echo "Testing $usd_file"
./build/tusdcat "$usd_file" > /tmp/tusdcat.txt
usdcat "$usd_file" > /tmp/usdcat.txt
echo "✓ Both tools read $usd_file"
fi
done
# Test 2: Convert with TinyUSDZ, verify with OpenUSD
if [ -f "models/suzanne.usdc" ]; then
./build/tusdcat models/suzanne.usdc > /tmp/tinyusdz.usda
usdcat /tmp/tinyusdz.usda > /dev/null
echo "✓ OpenUSD read TinyUSDZ-generated USDA"
fi
echo "All macOS ARM64 tests passed!"

View File

@@ -35,6 +35,57 @@ jobs:
path: |
build/Release/tusdcat.exe
# Test with OpenUSD binary (Windows x64)
- name: Download OpenUSD binary (Windows x64)
run: |
gh release download v25.11-lte `
--repo lighttransport/openusd-bin `
--pattern 'openusd-*-minsizerel-windows-x86_64.zip'
env:
GH_TOKEN: ${{ github.token }}
- name: Extract and setup OpenUSD (Windows x64)
run: |
$archive = Get-ChildItem -Filter "openusd-*-minsizerel-windows-x86_64.zip" | Select-Object -First 1
New-Item -ItemType Directory -Name openusd -Force | Out-Null
Expand-Archive -Path $archive.FullName -DestinationPath openusd -Force
$usdRoot = Resolve-Path openusd
echo "USD_INSTALL_ROOT=$usdRoot" >> $env:GITHUB_ENV
echo "$usdRoot\bin" >> $env:GITHUB_PATH
echo "$usdRoot\lib" >> $env:GITHUB_PATH
echo "$usdRoot\tbb\bin" >> $env:GITHUB_PATH
echo "PYTHONPATH=$usdRoot\lib\python;$env:PYTHONPATH" >> $env:GITHUB_ENV
echo "PXR_PLUGINPATH_NAME=$usdRoot\lib\usd" >> $env:GITHUB_ENV
- name: Verify OpenUSD installation (Windows x64)
run: |
usdcat --help
Write-Host "OpenUSD binary location: $(Get-Command usdcat | Select-Object -ExpandProperty Source)"
- name: Test TinyUSDZ and OpenUSD interoperability (Windows x64)
run: |
Write-Host "=== Testing TinyUSDZ <-> OpenUSD interoperability on Windows x64 ==="
# Test 1: Read files with both tools
$testFiles = @("models/suzanne.usdc", "models/cube.usda")
foreach ($usdFile in $testFiles) {
if (Test-Path $usdFile) {
Write-Host "Testing $usdFile"
.\build\Release\tusdcat.exe $usdFile > $null
usdcat $usdFile > $null
Write-Host "✓ Both tools read $usdFile"
}
}
# Test 2: Convert with TinyUSDZ, verify with OpenUSD
if (Test-Path "models/suzanne.usdc") {
.\build\Release\tusdcat.exe models/suzanne.usdc > tinyusdz_output.usda
usdcat tinyusdz_output.usda > $null
Write-Host "✓ OpenUSD read TinyUSDZ-generated USDA"
}
Write-Host "All Windows x64 tests passed!"
# Windows(32bit) + Visual Studio 2019 build
build-windows-msvc-win32:

View File

@@ -0,0 +1,12 @@
curdir=`pwd`
builddir=${curdir}/build_ubsan
rm -rf ${builddir}
mkdir ${builddir}
cd ${builddir} && CXX=clang++ CC=clang cmake \
-DSANITIZE_UNDEFINED=1 \
-DCMAKE_VERBOSE_MAKEFILE=1 \
..

View File

@@ -369,7 +369,7 @@ bool parse_int(const tstring_view &sv, int32_t *ret) {
}
}
*ret = negative ? -static_cast<int32_t>(result) : static_cast<int32_t>(result);
*ret = static_cast<int32_t>(negative ? -result : result);
return true;
}