Skip to content

Commit 993c0be

Browse files
committed
Merge branch 'main' of github.com:google/filament into jcaldas/wgpuTQueries
2 parents 097d165 + a7660e4 commit 993c0be

File tree

107 files changed

+1258
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1258
-356
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: 'Set up dependency versions'
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: Set up dependency versions
6+
shell: bash
7+
run: cat ./build/common/versions >> $GITHUB_ENV
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Linux Preqrequisites'
2+
runs:
3+
using: "composite"
4+
steps:
5+
- uses: ./.github/actions/dep-versions
6+
- name: Install Linux Prerequisites
7+
shell: bash
8+
run: |
9+
set -xe
10+
# See https://askubuntu.com/questions/272248/processing-triggers-for-man-db/1476024#1476024
11+
echo "set man-db/auto-update false" | sudo debconf-communicate
12+
sudo dpkg-reconfigure man-db
13+
14+
# Install ninja
15+
source ./build/common/get-ninja.sh
16+
17+
# Install CMake
18+
mkdir -p cmake
19+
cd cmake
20+
21+
sudo wget https://github.com/Kitware/CMake/releases/download/v$GITHUB_CMAKE_VERSION/cmake-$GITHUB_CMAKE_VERSION-Linux-x86_64.sh
22+
sudo chmod +x ./cmake-$GITHUB_CMAKE_VERSION-Linux-x86_64.sh
23+
sudo ./cmake-$GITHUB_CMAKE_VERSION-Linux-x86_64.sh --skip-license > /dev/null
24+
sudo update-alternatives --install /usr/bin/cmake cmake $(pwd)/bin/cmake 1000 --force
25+
26+
cd ..
27+
28+
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
29+
sudo apt-get update
30+
sudo apt-get install clang-$GITHUB_CLANG_VERSION libc++-$GITHUB_CLANG_VERSION-dev libc++abi-$GITHUB_CLANG_VERSION-dev
31+
sudo apt-get install mesa-common-dev libxi-dev libxxf86vm-dev
32+
33+
# For dawn
34+
sudo apt-get install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libx11-xcb-dev
35+
36+
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${GITHUB_CLANG_VERSION} 100
37+
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${GITHUB_CLANG_VERSION} 100
38+
set +xe

.github/actions/mac-prereq/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Mac Preqrequisites'
2+
runs:
3+
using: "composite"
4+
steps:
5+
- uses: ./.github/actions/dep-versions
6+
- name: Set up Homebrew
7+
id: set-up-homebrew
8+
uses: Homebrew/actions/setup-homebrew@master
9+
- name: Set up Python
10+
uses: actions/setup-python@v5
11+
with:
12+
python-version: '3.x'
13+
- name: Cache Brew
14+
id: brew-cache
15+
uses: actions/cache@v4 # Use a specific version
16+
with:
17+
path: $HOME/Library/Caches/Homebrew
18+
key: ${{ runner.os }}-brew-20250424
19+
- name: Install Mac Prerequisites
20+
shell: bash
21+
run: |
22+
# Install ninja
23+
source ./build/common/get-ninja.sh

.github/workflows/android-continuous.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4.1.6
19+
with:
20+
fetch-depth: 0
21+
- uses: ./.github/actions/linux-prereq
1922
- name: Run Android Continuous
2023
uses: ./.github/actions/android-continuous
2124
with:

.github/workflows/ios-continuous.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4.1.6
17+
with:
18+
fetch-depth: 0
19+
- uses: ./.github/actions/mac-prereq
1720
- name: Run build script
1821
run: |
1922
cd build/ios && printf "y" | ./build.sh continuous

.github/workflows/linux-continuous.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4.1.6
17+
with:
18+
fetch-depth: 0
19+
- uses: ./.github/actions/linux-prereq
1720
- name: Run build script
1821
run: |
1922
cd build/linux && printf "y" | ./build.sh continuous

.github/workflows/mac-continuous.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4.1.6
17+
with:
18+
fetch-depth: 0
19+
- uses: ./.github/actions/mac-prereq
1720
- name: Run build script
1821
run: |
1922
cd build/mac && printf "y" | ./build.sh continuous

.github/workflows/presubmit.yml

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,32 @@ on:
99
- main
1010

1111
jobs:
12-
build-desktop:
13-
name: build-desktop
14-
runs-on: ${{ matrix.os }}
15-
16-
strategy:
17-
matrix:
18-
os: [macos-14-xlarge, ubuntu-22.04-16core]
12+
build-desktop-mac:
13+
name: build-mac
14+
runs-on: macos-14-xlarge
15+
steps:
16+
- uses: actions/checkout@v4.1.6
17+
with:
18+
fetch-depth: 0
19+
- uses: ./.github/actions/mac-prereq
20+
- name: Run build script
21+
run: |
22+
cd build/mac && printf "y" | ./build.sh presubmit
23+
- name: Test material parser
24+
run: |
25+
out/cmake-release/filament/test/test_material_parser
1926
27+
build-desktop-linux:
28+
name: build-linux
29+
runs-on: ubuntu-22.04-16core
2030
steps:
2131
- uses: actions/checkout@v4.1.6
2232
with:
2333
fetch-depth: 0
34+
- uses: ./.github/actions/linux-prereq
2435
- name: Run build script
2536
run: |
26-
WORKFLOW_OS=`echo \`uname\` | sed "s/Darwin/mac/" | tr [:upper:] [:lower:]`
27-
cd build/$WORKFLOW_OS && printf "y" | ./build.sh presubmit
37+
cd build/linux && printf "y" | ./build.sh presubmit
2838
- name: Test material parser
2939
run: |
3040
out/cmake-release/filament/test/test_material_parser
@@ -35,6 +45,8 @@ jobs:
3545

3646
steps:
3747
- uses: actions/checkout@v4.1.6
48+
with:
49+
fetch-depth: 0
3850
- name: Run build script
3951
run: |
4052
build\windows\build-github.bat presubmit
@@ -48,6 +60,7 @@ jobs:
4860
- uses: actions/checkout@v4.1.6
4961
with:
5062
fetch-depth: 0
63+
- uses: ./.github/actions/linux-prereq
5164
- uses: actions/setup-java@v3
5265
with:
5366
distribution: 'temurin'
@@ -66,6 +79,7 @@ jobs:
6679
- uses: actions/checkout@v4.1.6
6780
with:
6881
fetch-depth: 0
82+
- uses: ./.github/actions/mac-prereq
6983
- name: Run build script
7084
run: |
7185
cd build/ios && printf "y" | ./build.sh presubmit
@@ -79,6 +93,9 @@ jobs:
7993

8094
steps:
8195
- uses: actions/checkout@v4.1.6
96+
with:
97+
fetch-depth: 0
98+
- uses: ./.github/actions/linux-prereq
8299
- name: Run build script
83100
run: |
84101
cd build/web && printf "y" | ./build.sh presubmit
@@ -101,30 +118,20 @@ jobs:
101118
runs-on: macos-14-xlarge
102119
steps:
103120
- uses: actions/checkout@v4.1.6
104-
- name: Set up Homebrew
105-
id: set-up-homebrew
106-
uses: Homebrew/actions/setup-homebrew@master
107-
- name: Set up Python
108-
uses: actions/setup-python@v5
109121
with:
110-
python-version: '3.x'
122+
fetch-depth: 0
123+
- uses: ./.github/actions/mac-prereq
111124
- name: Cache Mesa and deps
112125
id: mesa-cache
113126
uses: actions/cache@v4 # Use a specific version
114127
with:
115-
path: |
116-
$HOME/Library/Caches/Homebrew
117-
mesa
118-
key: ${{ runner.os }}-mesa-deps-${{ vars.MESA_VERSION }}
128+
path: mesa
129+
key: ${{ runner.os }}-mesa-deps-2-${{ vars.MESA_VERSION }}
119130
- name: Get Mesa
120131
id: mesa-prereq
121-
env:
122-
MESA_VERSION: ${{ vars.MESA_VERSION }}
123-
run: |
124-
bash test/utils/get_mesa.sh
132+
run: bash test/utils/get_mesa.sh
125133
- name: Run Test
126-
run: |
127-
bash test/renderdiff/test.sh
134+
run: bash test/renderdiff/test.sh
128135
- uses: actions/upload-artifact@v4
129136
with:
130137
name: presubmit-renderdiff-result
@@ -133,11 +140,13 @@ jobs:
133140
validate-wgsl-webgpu:
134141
name: validate-wgsl-webgpu
135142
runs-on: 'ubuntu-24.04-8core'
136-
137143
steps:
138144
- uses: actions/checkout@v4.1.6
145+
with:
146+
fetch-depth: 0
147+
- uses: ./.github/actions/linux-prereq
139148
- name: Run build script
140-
run: source ./build/linux/ci-common.sh && ./build.sh -W debug test_filamat filament
149+
run: ./build.sh -W debug test_filamat filament
141150
- name: Run test
142151
run: ./out/cmake-debug/libs/filamat/test_filamat --gtest_filter=MaterialCompiler.Wgsl*
143152

@@ -148,23 +157,16 @@ jobs:
148157
- uses: actions/checkout@v4.1.6
149158
with:
150159
fetch-depth: 0
151-
- name: Set up Homebrew
152-
id: set-up-homebrew
153-
uses: Homebrew/actions/setup-homebrew@master
154-
- name: Set up Python
155-
uses: actions/setup-python@v5
156-
with:
157-
python-version: '3.x'
158-
- name: Install prerequisites
160+
- uses: ./.github/actions/mac-prereq
161+
- name: Install clang-tidy and deps
159162
run: |
160163
pip install pyyaml
161-
brew install llvm
162-
sudo ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
164+
brew install llvm@${GITHUB_LLVM_VERSION}
165+
sudo ln -s "$(brew --prefix llvm)@${GITHUB_LLVM_VERSION}/bin/clang-tidy" "/usr/local/bin/clang-tidy"
163166
- name: Run build script
164167
# We need to build before clang-tidy can run analysis
165168
run: |
166169
# This will build for all three desktop backends on mac
167170
./build.sh -p desktop debug gltf_viewer
168171
- name: Run test
169-
run: |
170-
bash test/code-correctness/test.sh
172+
run: bash test/code-correctness/test.sh

.github/workflows/release.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,42 @@ on:
2929
types: [created]
3030

3131
jobs:
32-
build-desktop:
33-
name: build-desktop
32+
build-linux:
33+
name: build-linux
34+
runs-on: ubuntu-22.04-32core
35+
if: github.event_name == 'release' || github.event.inputs.platform == 'desktop'
36+
37+
steps:
38+
- name: Decide Git ref
39+
id: git_ref
40+
run: |
41+
REF=${RELEASE_TAG:-${GITHUB_REF}}
42+
TAG=${REF##*/}
43+
echo "ref=${REF}" >> $GITHUB_OUTPUT
44+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
45+
- uses: actions/checkout@v4.1.6
46+
with:
47+
ref: ${{ steps.git_ref.outputs.ref }}
48+
- uses: ./.github/actions/linux-prereq
49+
- name: Run build script
50+
env:
51+
TAG: ${{ steps.git_ref.outputs.tag }}
52+
run: |
53+
cd build/linux && printf "y" | ./build.sh release
54+
cd ../..
55+
mv out/filament-release-linux.tgz out/filament-${TAG}-linux.tgz
56+
- uses: actions/github-script@v6
57+
env:
58+
TAG: ${{ steps.git_ref.outputs.tag }}
59+
with:
60+
script: |
61+
const upload = require('./build/common/upload-release-assets');
62+
const { TAG } = process.env;
63+
const globber = await glob.create('out/*.tgz');
64+
await upload({ github, context }, await globber.glob(), TAG);
65+
66+
build-mac:
67+
name: build-mac
3468
runs-on: ${{ matrix.os }}
3569
if: github.event_name == 'release' || github.event.inputs.platform == 'desktop'
3670

@@ -49,15 +83,14 @@ jobs:
4983
- uses: actions/checkout@v4.1.6
5084
with:
5185
ref: ${{ steps.git_ref.outputs.ref }}
86+
- uses: ./.github/actions/mac-prereq
5287
- name: Run build script
5388
env:
5489
TAG: ${{ steps.git_ref.outputs.tag }}
5590
run: |
56-
WORKFLOW_OS=`echo \`uname\` | sed "s/Darwin/mac/" | tr [:upper:] [:lower:]`
57-
cd build/$WORKFLOW_OS && printf "y" | ./build.sh release
91+
cd build/mac && printf "y" | ./build.sh release
5892
cd ../..
59-
if [ -f out/filament-release-darwin.tgz ]; then mv out/filament-release-darwin.tgz out/filament-${TAG}-mac.tgz; fi;
60-
if [ -f out/filament-release-linux.tgz ]; then mv out/filament-release-linux.tgz out/filament-${TAG}-linux.tgz; fi;
93+
mv out/filament-release-darwin.tgz out/filament-${TAG}-mac.tgz
6194
- uses: actions/github-script@v6
6295
env:
6396
TAG: ${{ steps.git_ref.outputs.tag }}
@@ -84,6 +117,7 @@ jobs:
84117
- uses: actions/checkout@v4.1.6
85118
with:
86119
ref: ${{ steps.git_ref.outputs.ref }}
120+
- uses: ./.github/actions/linux-prereq
87121
- name: Run build script
88122
env:
89123
TAG: ${{ steps.git_ref.outputs.tag }}
@@ -121,6 +155,7 @@ jobs:
121155
with:
122156
distribution: 'temurin'
123157
java-version: '17'
158+
- uses: ./.github/actions/linux-prereq
124159
- name: Run build script
125160
env:
126161
TAG: ${{ steps.git_ref.outputs.tag }}
@@ -171,6 +206,7 @@ jobs:
171206
- uses: actions/checkout@v4.1.6
172207
with:
173208
ref: ${{ steps.git_ref.outputs.ref }}
209+
- uses: ./.github/actions/mac-prereq
174210
- name: Run build script
175211
env:
176212
TAG: ${{ steps.git_ref.outputs.tag }}

.github/workflows/web-continuous.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4.1.6
17+
with:
18+
fetch-depth: 0
19+
- uses: ./.github/actions/linux-prereq
1720
- name: Run build script
1821
run: |
1922
cd build/web && printf "y" | ./build.sh continuous

0 commit comments

Comments
 (0)