Skip to content
97 changes: 74 additions & 23 deletions .github/workflows/buildusd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,28 @@ on:
- dev
paths:
- '**'
- '!.github/workflows/**'

jobs:
Validation:
runs-on: ubuntu-22.04
timeout-minutes: 30
outputs:
validation-failed: ${{ steps.changed-workflows.outputs.any_changed }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Check workflows directory
id: changed-workflows
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c #v46
with:
files: |
.github/workflows/**
# Validation:
# runs-on: ubuntu-22.04
# timeout-minutes: 30
# outputs:
# validation-failed: ${{ steps.changed-workflows.outputs.any_changed }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# ref: ${{ github.ref }}
# - name: Check workflows directory
# id: changed-workflows
# uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c #v46
# with:
# files: |
# .github/workflows/**

Linux:
needs:
- Validation
# needs:
# - Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
runs-on: ubuntu-22.04
env:
Expand Down Expand Up @@ -83,8 +82,8 @@ jobs:
ctest --output-on-failure -j4 -C Release --exclude-regex "testExecGeomXformable_Perf_Large"

macOS:
needs:
- Validation
# needs:
# - Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
runs-on: macos-15
env:
Expand Down Expand Up @@ -140,8 +139,8 @@ jobs:
ctest --output-on-failure -j4 -C Release --exclude-regex "testExecGeomXformable_Perf_Large"

Windows:
needs:
- Validation
# needs:
# - Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
runs-on: windows-2022
env:
Expand Down Expand Up @@ -193,3 +192,55 @@ jobs:
# Internal ticket USD-8035
ctest --output-on-failure -j4 -C Release --exclude-regex "TfPathUtils|testExecGeomXformable_Perf_Large"
shell: cmd

Wasm:
# needs:
# - Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
strategy:
matrix:
target: [Wasm, Wasm64]
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install Emscripten SDK
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@v4
with:
path: |
USDinst
USDgen/build
key: ${{ runner.os }}-BuildUSD-${{ matrix.target }}-${{ hashFiles('build_scripts/**/*') }}
- name: Build USD
run: |
source ${{ github.workspace }}/emsdk/emsdk_env.sh
python3 build_scripts/build_usd.py -v --build-target ${{ matrix.target }} USDinst \
--build USDgen/build --src USDgen/src \
--build-args USD,"-DPXR_HEADLESS_TEST_MODE=ON -DPXR_BUILD_TESTS=ON"
- name: Save build artifacts to cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
USDinst
USDgen/build
key: ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: usd-${{ matrix.target }}
path: USDinst
- name: Test USD
working-directory: ./USDgen/build/OpenUSD
run: |
ctest --output-on-failure -j4 -C Release
1 change: 1 addition & 0 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2035,6 +2035,7 @@ def InstallUSD(context, force, buildArgs):
group.add_argument("--build-target",
default=GetBuildTargetDefault(),
choices=GetBuildTargets(),
type=str.lower,
help=("Build target for cross compilation. "
"(default: {})".format(
GetBuildTargetDefault())))
Expand Down
16 changes: 12 additions & 4 deletions pxr/usd/sdf/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ void TfDelegatedCountDecrement(Sdf_PathNode const *) noexcept;
struct Sdf_PathPrimTag;
struct Sdf_PathPropTag;

// These are validated below.

// Note: The sizes below represent the largest size of objects which are
// created from the PrimPath and PropPath pools respectively.
// These are validated below.
#ifdef ARCH_BITS_32
static constexpr size_t Sdf_SizeofPrimPathNode = 16;
static constexpr size_t Sdf_SizeofPropPathNode = 16;
static constexpr size_t Sdf_SizeofPropPathNode = 20;
#else
static constexpr size_t Sdf_SizeofPrimPathNode = 24;
static constexpr size_t Sdf_SizeofPropPathNode = 24;
Expand Down Expand Up @@ -1431,8 +1433,14 @@ PXR_NAMESPACE_CLOSE_SCOPE

PXR_NAMESPACE_OPEN_SCOPE

static_assert(Sdf_SizeofPrimPathNode == sizeof(Sdf_PrimPathNode), "");
static_assert(Sdf_SizeofPropPathNode == sizeof(Sdf_PrimPropertyPathNode), "");
static_assert(Sdf_SizeofPrimPathNode >= sizeof(Sdf_PrimPathNode), "");
static_assert(Sdf_SizeofPrimPathNode >= sizeof(Sdf_PrimVariantSelectionNode), "");
static_assert(Sdf_SizeofPropPathNode >= sizeof(Sdf_PrimPropertyPathNode), "");
static_assert(Sdf_SizeofPropPathNode >= sizeof(Sdf_TargetPathNode), "");
static_assert(Sdf_SizeofPropPathNode >= sizeof(Sdf_RelationalAttributePathNode), "");
static_assert(Sdf_SizeofPropPathNode >= sizeof(Sdf_MapperPathNode), "");
static_assert(Sdf_SizeofPropPathNode >= sizeof(Sdf_MapperArgPathNode), "");
static_assert(Sdf_SizeofPropPathNode >= sizeof(Sdf_ExpressionPathNode), "");

PXR_NAMESPACE_CLOSE_SCOPE

Expand Down
12 changes: 12 additions & 0 deletions pxr/usd/sdf/pathNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,22 @@ SDF_INSTANTIATE_POOL(Sdf_PathPropTag, Sdf_SizeofPropPathNode, /*regionBits=*/8);
// changes.
#ifdef ARCH_BITS_32
static_assert(sizeof(Sdf_PrimPathNode) == 16, "");
static_assert(sizeof(Sdf_PrimVariantSelectionNode) == 16, "");
static_assert(sizeof(Sdf_PrimPropertyPathNode) == 16, "");
static_assert(sizeof(Sdf_TargetPathNode) == 20, "");
static_assert(sizeof(Sdf_RelationalAttributePathNode) == 16, "");
static_assert(sizeof(Sdf_MapperPathNode) == 20, "");
static_assert(sizeof(Sdf_MapperArgPathNode) == 16, "");
static_assert(sizeof(Sdf_ExpressionPathNode) == 12, "");
#else
static_assert(sizeof(Sdf_PrimPathNode) == 24, "");
static_assert(sizeof(Sdf_PrimVariantSelectionNode) == 24, "");
static_assert(sizeof(Sdf_PrimPropertyPathNode) == 24, "");
static_assert(sizeof(Sdf_TargetPathNode) == 24, "");
static_assert(sizeof(Sdf_RelationalAttributePathNode) == 24, "");
static_assert(sizeof(Sdf_MapperPathNode) == 24, "");
static_assert(sizeof(Sdf_MapperArgPathNode) == 24, "");
static_assert(sizeof(Sdf_ExpressionPathNode) == 16, "");
#endif

struct Sdf_PathNodePrivateAccess
Expand Down