Skip to content

Commit f384f50

Browse files
committed
Merge branch 'rc/1.63.0' into release
2 parents ede471c + f3f65e8 commit f384f50

File tree

591 files changed

+33772
-152111
lines changed

Some content is hidden

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

591 files changed

+33772
-152111
lines changed

.github/workflows/postsubmit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
env:
5151
GH_TOKEN: ${{ secrets.FILAMENTBOT_TOKEN }}
5252
run: |
53+
bash docs_src/build/install_mdbook.sh && source ~/.bashrc
5354
COMMIT_HASH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | head -n 1 | sed "s/commit //g")
5455
git config --global user.email "[email protected]"
5556
git config --global user.name "Filament Bot"

.github/workflows/presubmit.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,43 @@ jobs:
130130
run: |
131131
bash build/common/get-mesa.sh
132132
pip install tifffile numpy
133-
- name: Run Test
133+
- name: Render and compare
134+
id: render_compare
134135
run: |
135-
echo "${{ steps.get_commit_msg.outputs.msg }}" | bash test/renderdiff/test.sh
136+
TEST_DIR=test/renderdiff
137+
source ${TEST_DIR}/src/preamble.sh
138+
start_
139+
GOLDEN_BRANCH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | python3 ${TEST_DIR}/src/commit_msg.py)
140+
bash ${TEST_DIR}/generate.sh && \
141+
python3 ${TEST_DIR}/src/golden_manager.py \
142+
--branch=${GOLDEN_BRANCH} \
143+
--output=${GOLDEN_OUTPUT_DIR}
144+
145+
# Note that we need to upload the output even if comparison fails, so we undo `set -ex`
146+
end_
147+
148+
python3 ${TEST_DIR}/src/compare.py \
149+
--src=${GOLDEN_OUTPUT_DIR} \
150+
--dest=${RENDER_OUTPUT_DIR} \
151+
--out=${DIFF_OUTPUT_DIR} 2>&1 | tee compare_output.txt
152+
153+
if grep "Failed" compare_output.txt > /dev/null; then
154+
DELIMITER="EOF_FILE_CONTENT_$(date +%s)" # Using timestamp to make it more unique
155+
echo "err<<$DELIMITER" >> "$GITHUB_OUTPUT"
156+
cat compare_output.txt >> "$GITHUB_OUTPUT"
157+
echo "$DELIMITER" >> "$GITHUB_OUTPUT"
158+
fi
136159
- uses: actions/upload-artifact@v4
137160
with:
138161
name: presubmit-renderdiff-result
139162
path: ./out/renderdiff
163+
- name: Compare result
164+
run: |
165+
ERROR_STR="${{ steps.render_compare.outputs.err }}"
166+
if [ -n "${ERROR_STR}" ]; then
167+
echo "${ERROR_STR}"
168+
exit 1
169+
fi
140170
141171
validate-wgsl-webgpu:
142172
name: validate-wgsl-webgpu

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ option(FILAMENT_ENABLE_ASAN_UBSAN "Enable Address and Undefined Behavior Sanitiz
4141

4242
option(FILAMENT_ENABLE_TSAN "Enable Thread Sanitizer" OFF)
4343

44+
option(FILAMENT_ENABLE_COVERAGE "Enable LLVM code coverage" OFF)
45+
4446
option(FILAMENT_ENABLE_FEATURE_LEVEL_0 "Enable Feature Level 0" ON)
4547

4648
option(FILAMENT_ENABLE_MULTIVIEW "Enable multiview for Filament" OFF)
@@ -460,6 +462,10 @@ if (NOT MSVC AND NOT WEBGL)
460462
endif()
461463
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_SANITIZE_OPTIONS}")
462464

465+
if (FILAMENT_ENABLE_COVERAGE)
466+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-instr-generate -fcoverage-mapping")
467+
endif()
468+
463469
# Disable the stack check for macOS to workaround a known issue in clang 11.0.0.
464470
# See: https://forums.developer.apple.com/thread/121887
465471
if (APPLE)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repositories {
3131
}
3232
3333
dependencies {
34-
implementation 'com.google.android.filament:filament-android:1.62.2'
34+
implementation 'com.google.android.filament:filament-android:1.63.0'
3535
}
3636
```
3737

@@ -51,7 +51,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
5151
iOS projects can use CocoaPods to install the latest release:
5252

5353
```shell
54-
pod 'Filament', '~> 1.62.2'
54+
pod 'Filament', '~> 1.63.0'
5555
```
5656

5757
## Documentation
@@ -63,7 +63,7 @@ pod 'Filament', '~> 1.62.2'
6363
- [Materials](https://google.github.io/filament/Materials.html), the full reference
6464
documentation for our material system. This document explains our different material models, how
6565
to use the material compiler `matc` and how to write custom materials.
66-
- [Material Properties](https://google.github.io/filament/Material%20Properties.pdf), a reference
66+
- [Material Properties](https://google.github.io/filament/notes/material_properties.html), a reference
6767
sheet for the standard material model.
6868

6969
## Examples

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ A new header is inserted each time a *tag* is created.
77
Instead, if you are authoring a PR for the main branch, add your release note to
88
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).
99

10+
## v1.63.0
11+
12+
- Rename `sampler` parameter `unfilterable` to `filterable` [⚠️ **New Material Version**]
13+
- Added `Renderer::shouldRenderFrame()`
14+
1015
## v1.62.2
1116

1217
- Metal: fix, respect alpha to coverage rasterization

android/filament-android/src/main/cpp/Renderer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ Java_com_google_android_filament_Renderer_nSkipFrame(JNIEnv *, jclass, jlong nat
3636
renderer->skipFrame(uint64_t(vsyncSteadyClockTimeNano));
3737
}
3838

39+
extern "C" JNIEXPORT jboolean JNICALL
40+
Java_com_google_android_filament_Renderer_nShouldRenderFrame(JNIEnv *, jclass, jlong nativeRenderer) {
41+
Renderer *renderer = (Renderer *) nativeRenderer;
42+
return (jboolean) renderer->shouldRenderFrame();
43+
}
44+
3945
extern "C" JNIEXPORT jboolean JNICALL
4046
Java_com_google_android_filament_Renderer_nBeginFrame(JNIEnv *, jclass, jlong nativeRenderer,
4147
jlong nativeSwapChain, jlong frameTimeNanos) {

android/filament-android/src/main/java/com/google/android/filament/Renderer.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,21 @@ public void skipFrame(long vsyncSteadyClockTimeNano) {
311311
nSkipFrame(getNativeObject(), vsyncSteadyClockTimeNano);
312312
}
313313

314+
/**
315+
* Returns true if the current frame should be rendered.
316+
*
317+
* This is a convenience method that returns the same value as {@link #beginFrame}.
318+
*
319+
* @return
320+
* <code>false</code> the current frame should be skipped<br>
321+
* <code>true</code> the current frame can be rendered
322+
*
323+
* @see #beginFrame
324+
*/
325+
public boolean shouldRenderFrame() {
326+
return nShouldRenderFrame(getNativeObject());
327+
}
328+
314329
/**
315330
* Sets up a frame for this <code>Renderer</code>.
316331
* <p><code>beginFrame</code> manages frame pacing, and returns whether or not a frame should be
@@ -731,6 +746,7 @@ void clearNativeObject() {
731746
private static native void nSetPresentationTime(long nativeObject, long monotonicClockNanos);
732747
private static native void nSetVsyncTime(long nativeObject, long steadyClockTimeNano);
733748
private static native void nSkipFrame(long nativeObject, long vsyncSteadyClockTimeNano);
749+
private static native boolean nShouldRenderFrame(long nativeObject);
734750
private static native boolean nBeginFrame(long nativeRenderer, long nativeSwapChain, long frameTimeNanos);
735751
private static native void nEndFrame(long nativeRenderer);
736752
private static native void nRender(long nativeRenderer, long nativeView);

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.google.android.filament
2-
VERSION_NAME=1.62.2
2+
VERSION_NAME=1.63.0
33

44
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
55

build.sh

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@ function print_help {
5454
echo " Build arm64/x86_64 universal libraries."
5555
echo " For iOS, this builds universal binaries for devices and the simulator (implies -s)."
5656
echo " For macOS, this builds universal binaries for both Apple silicon and Intel-based Macs."
57-
echo " -w"
58-
echo " Build Web documents (compiles .md.html files to .html)."
5957
echo " -k sample1,sample2,..."
6058
echo " When building for Android, also build select sample APKs."
6159
echo " sampleN is an Android sample, e.g., sample-gltf-viewer."
6260
echo " This automatically performs a partial desktop build and install."
6361
echo " -b"
6462
echo " Enable Address and Undefined Behavior Sanitizers (asan/ubsan) for debugging."
6563
echo " This is only for the desktop build."
64+
echo " -V"
65+
echo " Enable LLVM code coverage for debug builds."
66+
echo " This is only for the desktop build."
6667
echo " -x value"
6768
echo " Define a preprocessor flag FILAMENT_BACKEND_DEBUG_FLAG with [value]. This is useful for"
6869
echo " enabling debug paths in the backend from the build script. For example, make a"
@@ -182,8 +183,6 @@ BUILD_JS_DOCS=false
182183

183184
ISSUE_CMAKE_ALWAYS=false
184185

185-
ISSUE_WEB_DOCS=false
186-
187186
ANDROID_SAMPLES=()
188187
BUILD_ANDROID_SAMPLES=false
189188

@@ -208,6 +207,7 @@ MATOPT_OPTION=""
208207
MATOPT_GRADLE_OPTION=""
209208

210209
ASAN_UBSAN_OPTION=""
210+
COVERAGE_OPTION=""
211211

212212
BACKEND_DEBUG_FLAG_OPTION=""
213213

@@ -275,6 +275,7 @@ function build_desktop_target {
275275
${MATDBG_OPTION} \
276276
${MATOPT_OPTION} \
277277
${ASAN_UBSAN_OPTION} \
278+
${COVERAGE_OPTION} \
278279
${BACKEND_DEBUG_FLAG_OPTION} \
279280
${STEREOSCOPIC_OPTION} \
280281
${OSMESA_OPTION} \
@@ -726,21 +727,6 @@ function build_ios {
726727
fi
727728
}
728729

729-
function build_web_docs {
730-
echo "Building Web documents..."
731-
732-
mkdir -p out/web-docs
733-
cp -f docs/web-docs-package.json out/web-docs/package.json
734-
pushd out/web-docs > /dev/null
735-
736-
npm install > /dev/null
737-
738-
# Generate documents
739-
npx markdeep-rasterizer ../../docs/Filament.md.html ../../docs/Materials.md.html ../../docs/
740-
741-
popd > /dev/null
742-
}
743-
744730
function validate_build_command {
745731
set +e
746732
# Make sure CMake is installed
@@ -772,16 +758,6 @@ function validate_build_command {
772758
echo "Error: EMSDK is not set, exiting"
773759
exit 1
774760
fi
775-
# Web documents require node and npm for processing
776-
if [[ "${ISSUE_WEB_DOCS}" == "true" ]]; then
777-
local node_binary=$(command -v node)
778-
local npm_binary=$(command -v npm)
779-
local npx_binary=$(command -v npx)
780-
if [[ ! "${node_binary}" ]] || [[ ! "${npm_binary}" ]] || [[ ! "${npx_binary}" ]]; then
781-
echo "Error: Web documents require node, npm and npx to be installed"
782-
exit 1
783-
fi
784-
fi
785761

786762
# Make sure FILAMENT_BACKEND_DEBUG_FLAG is only meant for debug builds
787763
if [[ "${ISSUE_DEBUG_BUILD}" != "true" ]] && [[ ! -z "${BACKEND_DEBUG_FLAG_OPTION}" ]]; then
@@ -821,8 +797,7 @@ function run_tests {
821797
function check_debug_release_build {
822798
if [[ "${ISSUE_DEBUG_BUILD}" == "true" || \
823799
"${ISSUE_RELEASE_BUILD}" == "true" || \
824-
"${ISSUE_CLEAN}" == "true" || \
825-
"${ISSUE_WEB_DOCS}" == "true" ]]; then
800+
"${ISSUE_CLEAN}" == "true" ]]; then
826801
"$@";
827802
else
828803
echo "You must declare a debug or release target for $@ builds."
@@ -835,7 +810,7 @@ function check_debug_release_build {
835810

836811
pushd "$(dirname "$0")" > /dev/null
837812

838-
while getopts ":hacCfgimp:q:uvWslwedtk:bx:S:X:" opt; do
813+
while getopts ":hacCfgimp:q:uvWslwedtk:bVx:S:X:" opt; do
839814
case ${opt} in
840815
h)
841816
print_help
@@ -973,16 +948,16 @@ while getopts ":hacCfgimp:q:uvWslwedtk:bx:S:X:" opt; do
973948
BUILD_UNIVERSAL_LIBRARIES=true
974949
echo "Building universal libraries."
975950
;;
976-
w)
977-
ISSUE_WEB_DOCS=true
978-
;;
979951
k)
980952
BUILD_ANDROID_SAMPLES=true
981953
ANDROID_SAMPLES=$(echo "${OPTARG}" | tr ',' '\n')
982954
;;
983955
b) ASAN_UBSAN_OPTION="-DFILAMENT_ENABLE_ASAN_UBSAN=ON"
984956
echo "Enabled ASAN/UBSAN"
985957
;;
958+
V) COVERAGE_OPTION="-DFILAMENT_ENABLE_COVERAGE=ON"
959+
echo "Enabled coverage"
960+
;;
986961
x) BACKEND_DEBUG_FLAG_OPTION="-DFILAMENT_BACKEND_DEBUG_FLAG=${OPTARG}"
987962
;;
988963
S) case $(echo "${OPTARG}" | tr '[:upper:]' '[:lower:]') in
@@ -1059,10 +1034,6 @@ if [[ "${ISSUE_WEBGL_BUILD}" == "true" ]]; then
10591034
check_debug_release_build build_webgl
10601035
fi
10611036

1062-
if [[ "${ISSUE_WEB_DOCS}" == "true" ]]; then
1063-
build_web_docs
1064-
fi
1065-
10661037
if [[ "${RUN_TESTS}" == "true" ]]; then
10671038
run_tests
10681039
fi

0 commit comments

Comments
 (0)