Skip to content

Commit b89a05a

Browse files
committed
Merge branch 'rc/1.67.1' into release
2 parents 7f717f8 + 1e40295 commit b89a05a

482 files changed

Lines changed: 131154 additions & 708 deletions

File tree

Some content is hidden

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

BUILDING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ force a clean build by adding the `-c` flag in that case.
6262
To install the libraries and executables in `out/debug/` and `out/release/`, add the `-i` flag.
6363
The script offers more features described by executing `build.sh -h`.
6464

65+
For more specialized options, please also consider the following pages:
66+
- `-d`: [`matdbg`](https://google.github.io/filament/dup/matdbg.html)
67+
- `-t`: [`fgviewer`](https://google.github.io/filament/dup/fgviewer.html)
68+
- `-b` and `-y`: [ASAN/UBSAN builds](https://google.github.io/filament/notes/asan_ubsan.html)
69+
6570
### Filament-specific CMake Options
6671

6772
The following CMake options are boolean options specific to Filament:

CMakeLists.txt

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ option(FILAMENT_USE_ABSEIL_LOGGING "Use Abseil to log, may increase binary size"
5858

5959
option(FILAMENT_ENABLE_EXPERIMENTAL_GCC_SUPPORT "Enable GCC support (unsupported)" OFF)
6060

61+
option(FILAMENT_SUPPORTS_WEBP_TEXTURES "Enable webp texture support for Filament (builds libwebp when ON)" OFF)
62+
6163
# This is to disable GTAO for the short-term while we investigate a way to better manage size increases.
6264
# On the regular filament build (where size is of less concern), we enable GTAO by default.
6365
option(FILAMENT_DISABLE_GTAO "Disable GTAO" OFF)
@@ -753,12 +755,61 @@ function(combine_static_libs TARGET OUTPUT DEPS)
753755
endfunction()
754756

755757
# ==================================================================================================
756-
# Configuration for CMAKE_CROSSCOMPILING.
757-
# ==================================================================================================
758+
# Configuration importing/exporting prebuilt "/tools" executables
759+
# ==================================================================================================
760+
761+
# In certain cases, we want the ability to separate the build type/flags (release, debug) of tools
762+
# (matc, resgen, etc...) from filament. Cross compilation is one such case (e.g. building material
763+
# with matc running on host while building filament for Android) [1]. Another example is when client
764+
# wants to enable ASAN for filament but not the tool [2].
765+
#
766+
# Here are the varibles that are used to determine behavior is such flows:
767+
# - CMAKE_CROSSCOMPILING : Set by cmake to indicate the build's target platform is different
768+
# from the host platform.
769+
# - IMPORT_EXECUTABLES_DIR : This is the directory containing the /ImportExecutables-type.cmake
770+
# which are then included in other CMakeLists.txt to enable finding targets that have been
771+
# prebuilt. This is set by the client in their `cmake` invocation.
772+
# - IMPORT_EXECUTABLES : Path to a file to for 1) exporting the prebuilt targets or 2)
773+
# importing a previously exported targets. (Used internally and should not be set by client).
774+
# - FILAMENT_EXPORT_PREBUILT_EXECUTABLES_DIR : A path set by the client to indicate that
775+
# they wish to export the tools as prebuilts, and the corresponding targets will be recorded
776+
# in a cmake file (i.e IMPORT_EXECUTABLES). IMPORT_EXECUTABLES will be set relative to the the
777+
# given path. This will set FILAMENT_EXPORT_PREBUILT_EXECUTABLES=ON.
778+
# - FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR : A path set by the client to indicate that they wish
779+
# to import the tools as prebuilts from a .cmake file. The location (IMPORT_EXECUTABLES) of the
780+
# file is relative to the path given. This will set FILAMENT_IMPORT_PREBUILT_EXECUTABLES=ON.
781+
# - IMPORT_PREBUILT_EXECUTABLES and EXPORT_PREBUILT_EXECUTABLES are internal booleans set to
782+
# ON based on the prescence of FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR and
783+
# FILAMENT_EXPORT_PREBUILT_EXECUTABLES_DIR.
784+
#
785+
# In conclusion, for cases
786+
# - [1] (crosscompiling), the client must set IMPORT_EXECUTABLES_DIR for both when they are building
787+
# the tools and when they are building the target-platform filament.
788+
# - [2] (all other instances), the client must set FILAMENT_EXPORT_PREBUILT_EXECUTABLES_DIR in
789+
# the prebuilt exporting step, and set FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR in the importing
790+
# step.
791+
792+
# TODO: Fold the cross compilation case into the more general FILAMENT_IMPORT/EXPORT variables.
793+
794+
if (FILAMENT_EXPORT_PREBUILT_EXECUTABLES_DIR)
795+
set(FILAMENT_EXPORT_PREBUILT_EXECUTABLES ON)
796+
set(IMPORT_EXECUTABLES_DIR ${FILAMENT_EXPORT_PREBUILT_EXECUTABLES_DIR})
797+
endif()
798+
799+
if (FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR)
800+
set(FILAMENT_IMPORT_PREBUILT_EXECUTABLES ON)
801+
set(IMPORT_EXECUTABLES_DIR ${FILAMENT_IMPORT_PREBUILT_EXECUTABLES_DIR})
802+
endif()
803+
758804
if (WEBGL)
759805
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-Release.cmake)
760806
else()
761-
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${CMAKE_BUILD_TYPE}.cmake)
807+
if (FILAMENT_EXPORT_PREBUILT_EXECUTABLES OR FILAMENT_IMPORT_PREBUILT_EXECUTABLES)
808+
set(IMPORT_EXECUTABLES_BUILD_TYPE Prebuilt)
809+
else()
810+
set(IMPORT_EXECUTABLES_BUILD_TYPE ${CMAKE_BUILD_TYPE})
811+
endif()
812+
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${IMPORT_EXECUTABLES_BUILD_TYPE}.cmake)
762813
endif()
763814

764815
# ==================================================================================================
@@ -837,6 +888,7 @@ add_subdirectory(${EXTERNAL}/getopt)
837888
add_subdirectory(${EXTERNAL}/perfetto/tnt)
838889
add_subdirectory(${EXTERNAL}/zstd/tnt)
839890

891+
840892
# Note that this has to be placed after mikktspace in order for combine_static_libs to work.
841893
add_subdirectory(${LIBRARIES}/geometry)
842894

@@ -859,6 +911,11 @@ if (FILAMENT_ENABLE_FGVIEWER)
859911
add_subdirectory(${LIBRARIES}/fgviewer)
860912
endif()
861913

914+
if (FILAMENT_SUPPORTS_WEBP_TEXTURES)
915+
add_subdirectory(${EXTERNAL}/libwebp/tnt)
916+
add_definitions(-DFILAMENT_SUPPORTS_WEBP_TEXTURES)
917+
endif()
918+
862919
if (FILAMENT_SUPPORTS_VULKAN)
863920
add_subdirectory(${LIBRARIES}/bluevk)
864921
add_subdirectory(${EXTERNAL}/vkmemalloc/tnt)
@@ -917,6 +974,6 @@ if (IS_HOST_PLATFORM)
917974
endif()
918975

919976
# Generate exported executables for cross-compiled builds (Android, WebGL, and iOS)
920-
if (NOT CMAKE_CROSSCOMPILING)
977+
if ((NOT CMAKE_CROSSCOMPILING AND NOT FILAMENT_IMPORT_PREBUILT_EXECUTABLES) OR FILAMENT_EXPORT_PREBUILT_EXECUTABLES)
921978
export(TARGETS matc cmgen filamesh mipgen resgen uberz glslminifier FILE ${IMPORT_EXECUTABLES})
922979
endif()

NEW_RELEASE_NOTES.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@
66
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
77

88
## Release notes for next branch cut
9-
10-
- Metal: Add support for the `SwapChain::CONFIG_MSAA_4_SAMPLES` flag.

README.md

Lines changed: 2 additions & 2 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.67.0'
34+
implementation 'com.google.android.filament:filament-android:1.67.1'
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.67.0'
54+
pod 'Filament', '~> 1.67.1'
5555
```
5656

5757
## Documentation

RELEASE_NOTES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ 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.67.1
11+
12+
- Metal: Add support for the `SwapChain::CONFIG_MSAA_4_SAMPLES` flag.
13+
- third_party: Optionally add libwebp to build
14+
- controlled by cmake flag FILAMENT_SUPPORTS_WEBP_TEXTURES, defaults to OFF
15+
- actual webp texture support for libs/gltfio coming in subsequent change
16+
1017
## v1.67.0
1118

1219
- materials: Add a new API getParameterTransformName that will return the value of the transformName field of a sampler

android/filament-android/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ add_library(bluevk STATIC IMPORTED)
5151
set_target_properties(bluevk PROPERTIES IMPORTED_LOCATION
5252
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libbluevk.a)
5353

54-
add_library(vkshaders STATIC IMPORTED)
55-
set_target_properties(vkshaders PROPERTIES IMPORTED_LOCATION
56-
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libvkshaders.a)
57-
5854
if (FILAMENT_SUPPORTS_WEBGPU)
5955
add_library(webgpu_dawn STATIC IMPORTED)
6056
set_target_properties(webgpu_dawn PROPERTIES IMPORTED_LOCATION
@@ -165,7 +161,6 @@ target_link_libraries(filament-jni
165161
PRIVATE $<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:matdbg>
166162
PRIVATE $<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:filamat>
167163
PRIVATE $<$<STREQUAL:${FILAMENT_SUPPORTS_VULKAN},ON>:bluevk>
168-
PRIVATE $<$<STREQUAL:${FILAMENT_SUPPORTS_VULKAN},ON>:vkshaders>
169164
PRIVATE $<$<STREQUAL:${FILAMENT_SUPPORTS_VULKAN},ON>:smol-v>
170165
PRIVATE $<$<STREQUAL:${FILAMENT_SUPPORTS_WEBGPU},ON>:webgpu_dawn>
171166
)

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.67.0
2+
VERSION_NAME=1.67.1
33

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
/.idea/caches
7+
/.idea/gradle.xml
8+
.DS_Store
9+
/build
10+
/captures
11+
/src/main/assets
12+
.externalNativeBuild
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
id 'filament-tools-plugin'
5+
}
6+
7+
project.ext.isSample = true
8+
9+
kotlin {
10+
jvmToolchain(versions.jdk)
11+
}
12+
13+
filamentTools {
14+
materialInputDir = project.layout.projectDirectory.dir("src/main/materials")
15+
materialOutputDir = project.layout.projectDirectory.dir("src/main/assets/materials")
16+
}
17+
18+
clean.doFirst {
19+
delete "src/main/assets"
20+
}
21+
android {
22+
namespace 'com.google.android.filament.materialinstancestress'
23+
24+
compileSdkVersion versions.compileSdk
25+
defaultConfig {
26+
applicationId "com.google.android.filament.materialinstancestress"
27+
minSdkVersion versions.minSdk
28+
targetSdkVersion versions.targetSdk
29+
}
30+
31+
// NOTE: This is a workaround required because the AGP task collectReleaseDependencies
32+
// is not configuration-cache friendly yet; this is only useful for Play publication
33+
dependenciesInfo {
34+
includeInApk = false
35+
}
36+
37+
// We use the .filamat extension for materials compiled with matc
38+
// Telling aapt to not compress them allows to load them efficiently
39+
aaptOptions {
40+
noCompress 'filamat', 'ktx'
41+
}
42+
43+
compileOptions {
44+
sourceCompatibility versions.jdk
45+
targetCompatibility versions.jdk
46+
}
47+
}
48+
49+
dependencies {
50+
implementation deps.kotlin
51+
implementation project(':filament-android')
52+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:icon="@mipmap/ic_launcher"
7+
android:label="@string/app_name"
8+
android:roundIcon="@mipmap/ic_launcher_round"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
<activity
12+
android:exported="true"
13+
android:name=".MainActivity">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN"/>
16+
17+
<category android:name="android.intent.category.LAUNCHER"/>
18+
</intent-filter>
19+
</activity>
20+
</application>
21+
22+
</manifest>

0 commit comments

Comments
 (0)