Skip to content

Commit

Permalink
Merge branch 'rc/1.10.3' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Jun 14, 2021
2 parents 4ca87b1 + c4259b5 commit 0bf02b7
Show file tree
Hide file tree
Showing 45 changed files with 766 additions and 500 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ jobs:
- name: Run build script
run: |
cd build/android && printf "y" | ./build.sh release
- name: Sign sample-gltf-viewer
run: |
echo "${APK_KEYSTORE_BASE64}" > filament.jks.base64
base64 --decode filament.jks.base64 > filament.jks
BUILD_TOOLS_VERSION=$(ls ${ANDROID_HOME}/build-tools | sort -V | tail -n 1)
APKSIGNER=${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/apksigner
IN_FILE="out/sample-gltf-viewer-release.apk"
OUT_FILE="out/filament-gltf-viewer-${TAG}-android.apk"
${APKSIGNER} sign --ks filament.jks --key-pass=pass:${APK_KEYSTORE_PASS} --ks-pass=pass:${APK_KEYSTORE_PASS} --in ${IN_FILE} --out ${OUT_FILE}
rm "${IN_FILE}"
env:
TAG: ${{ steps.git_ref.outputs.tag }}
APK_KEYSTORE_BASE64: ${{ secrets.APK_KEYSTORE_BASE64 }}
APK_KEYSTORE_PASS: ${{ secrets.APK_KEYSTORE_PASS }}
- name: Upload release assets
run: |
pip3 install setuptools
Expand All @@ -107,7 +121,7 @@ jobs:
mv out/gltfio-android-lite-release.aar out/gltfio-${TAG}-lite-android.aar
mv out/filament-utils-android-release.aar out/filament-utils-${TAG}-android.aar
mv out/filament-utils-android-lite-release.aar out/filament-utils-${TAG}-lite-android.aar
python3 build/common/upload-assets.py ${TAG} out/*.aar
python3 build/common/upload-assets.py ${TAG} out/*.aar out/*.apk
env:
TAG: ${{ steps.git_ref.outputs.tag }}
GITHUB_API_KEY: ${{ secrets.GITHUB_API_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.10.2'
implementation 'com.google.android.filament:filament-android:1.10.3'
}
```

Expand Down Expand Up @@ -63,7 +63,7 @@ A much smaller alternative to `filamat-android` that can only generate OpenGL sh
iOS projects can use CocoaPods to install the latest release:

```
pod 'Filament', '~> 1.10.2'
pod 'Filament', '~> 1.10.3'
```

### Snapshots
Expand Down
10 changes: 9 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
This file contains one line summaries of commits that are worthy of mentioning in release notes.
A new header is inserted each time a *tag* is created.

## v1.10.3 (currently main branch)
## v1.10.4 (currently main branch)

## v1.10.3

- android: use `debug.filament.backend` system property to select the desired backend.
- engine: fix `LightManager::getFalloff`.
- gltfio: fix crash with non-triangles.
- macOS: fix main thread checker warnings with OpenGL.
- vulkan: fix crash on Windows machines with NVIDIA GPUs.

## v1.10.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public enum AttachmentPoint {
COLOR1,
COLOR2,
COLOR3,
COLOR4,
COLOR5,
COLOR6,
COLOR7,
DEPTH
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
VERSION_NAME=1.10.2
VERSION_NAME=1.10.3

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

Expand Down
83 changes: 82 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ function print_help {
echo " Generate .tgz build archives, implies -i."
echo " -c"
echo " Clean build directories."
echo " -C"
echo " Clean build directories and revert android/ to a freshly sync'ed state."
echo " All (and only) git-ignored files under android/ are deleted."
echo " This is sometimes needed instead of -c (which still misses some clean steps)."
echo " -d"
echo " Enable matdbg and disable material optimization."
echo " -f"
Expand Down Expand Up @@ -48,6 +52,10 @@ function print_help {
echo " For macOS, this builds universal binaries for both Apple silicon and Intel-based Macs."
echo " -w"
echo " Build Web documents (compiles .md.html files to .html)."
echo " -k sample1,sample2,..."
echo " When building for Android, also build select sample APKs."
echo " sampleN is an Android sample, e.g., sample-gltf-viewer."
echo " This automatically performs a partial desktop build and install."
echo ""
echo "Build types:"
echo " release"
Expand Down Expand Up @@ -112,6 +120,7 @@ CMAKE_MINOR=19

# Internal variables
ISSUE_CLEAN=false
ISSUE_CLEAN_AGGRESSIVE=false

ISSUE_DEBUG_BUILD=false
ISSUE_RELEASE_BUILD=false
Expand All @@ -136,6 +145,9 @@ ISSUE_CMAKE_ALWAYS=false

ISSUE_WEB_DOCS=false

ANDROID_SAMPLES=()
BUILD_ANDROID_SAMPLES=false

RUN_TESTS=false

FILAMENT_ENABLE_JAVA=ON
Expand Down Expand Up @@ -170,6 +182,12 @@ function build_clean {
rm -Rf android/filament-utils-android/build android/filament-utils-android/.externalNativeBuild android/filament-utils-android/.cxx
}

function build_clean_aggressive {
echo "Cleaning build directories..."
rm -Rf out
git clean -qfX android
}

function build_desktop_target {
local lc_target=$(echo "$1" | tr '[:upper:]' '[:lower:]')
local build_targets=$2
Expand Down Expand Up @@ -395,6 +413,24 @@ function build_android {

build_desktop "${MOBILE_HOST_TOOLS}"

# When building the samples, we need to partially "install" the host tools so Gradle can see
# them.
if [[ "${BUILD_ANDROID_SAMPLES}" == "true" ]]; then
if [[ "${ISSUE_DEBUG_BUILD}" == "true" ]]; then
mkdir -p out/debug/filament/bin
for tool in ${MOBILE_HOST_TOOLS}; do
cp out/cmake-debug/tools/${tool}/${tool} out/debug/filament/bin/
done
fi

if [[ "${ISSUE_RELEASE_BUILD}" == "true" ]]; then
mkdir -p out/release/filament/bin
for tool in ${MOBILE_HOST_TOOLS}; do
cp out/cmake-release/tools/${tool}/${tool} out/release/filament/bin/
done
fi
fi

INSTALL_COMMAND=${old_install_command}

if [[ "${ABI_ARM64_V8A}" == "true" ]]; then
Expand Down Expand Up @@ -434,6 +470,15 @@ function build_android {
-Pfilament_abis=${ABI_GRADLE_OPTION} \
:filamat-android:assembleDebug

if [[ "${BUILD_ANDROID_SAMPLES}" == "true" ]]; then
for sample in ${ANDROID_SAMPLES}; do
./gradlew \
-Pfilament_dist_dir=../out/android-debug/filament \
-Pfilament_abis=${ABI_GRADLE_OPTION} \
:samples:${sample}:assembleDebug
done
fi

if [[ "${INSTALL_COMMAND}" ]]; then
echo "Installing out/filamat-android-debug.aar..."
cp filamat-android/build/outputs/aar/filamat-android-lite-debug.aar ../out/
Expand All @@ -449,6 +494,14 @@ function build_android {
echo "Installing out/filament-utils-android-debug.aar..."
cp filament-utils-android/build/outputs/aar/filament-utils-android-lite-debug.aar ../out/
cp filament-utils-android/build/outputs/aar/filament-utils-android-full-debug.aar ../out/filament-utils-android-debug.aar

if [[ "${BUILD_ANDROID_SAMPLES}" == "true" ]]; then
for sample in ${ANDROID_SAMPLES}; do
echo "Installing out/${sample}-debug.apk"
cp samples/${sample}/build/outputs/apk/debug/${sample}-debug-unsigned.apk \
../out/${sample}-debug.apk
done
fi
fi
fi

Expand All @@ -466,6 +519,15 @@ function build_android {
-Pfilament_abis=${ABI_GRADLE_OPTION} \
:filamat-android:assembleRelease

if [[ "${BUILD_ANDROID_SAMPLES}" == "true" ]]; then
for sample in ${ANDROID_SAMPLES}; do
./gradlew \
-Pfilament_dist_dir=../out/android-release/filament \
-Pfilament_abis=${ABI_GRADLE_OPTION} \
:samples:${sample}:assembleRelease
done
fi

if [[ "${INSTALL_COMMAND}" ]]; then
echo "Installing out/filamat-android-release.aar..."
cp filamat-android/build/outputs/aar/filamat-android-lite-release.aar ../out/
Expand All @@ -481,6 +543,14 @@ function build_android {
echo "Installing out/filament-utils-android-release.aar..."
cp filament-utils-android/build/outputs/aar/filament-utils-android-lite-release.aar ../out/
cp filament-utils-android/build/outputs/aar/filament-utils-android-full-release.aar ../out/filament-utils-android-release.aar

if [[ "${BUILD_ANDROID_SAMPLES}" == "true" ]]; then
for sample in ${ANDROID_SAMPLES}; do
echo "Installing out/${sample}-release.apk"
cp samples/${sample}/build/outputs/apk/release/${sample}-release-unsigned.apk \
../out/${sample}-release.apk
done
fi
fi
fi

Expand Down Expand Up @@ -678,7 +748,7 @@ function run_tests {

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

while getopts ":hacfijmp:q:uvslwtd" opt; do
while getopts ":hacCfijmp:q:uvslwtdk:" opt; do
case ${opt} in
h)
print_help
Expand All @@ -691,6 +761,9 @@ while getopts ":hacfijmp:q:uvslwtd" opt; do
c)
ISSUE_CLEAN=true
;;
C)
ISSUE_CLEAN_AGGRESSIVE=true
;;
d)
PRINT_MATDBG_HELP=true
MATDBG_OPTION="-DFILAMENT_ENABLE_MATDBG=ON, -DFILAMENT_DISABLE_MATOPT=ON"
Expand Down Expand Up @@ -792,6 +865,10 @@ while getopts ":hacfijmp:q:uvslwtd" opt; do
w)
ISSUE_WEB_DOCS=true
;;
k)
BUILD_ANDROID_SAMPLES=true
ANDROID_SAMPLES=$(echo "${OPTARG}" | tr ',' '\n')
;;
\?)
echo "Invalid option: -${OPTARG}" >&2
echo ""
Expand Down Expand Up @@ -830,6 +907,10 @@ if [[ "${ISSUE_CLEAN}" == "true" ]]; then
build_clean
fi

if [[ "${ISSUE_CLEAN_AGGRESSIVE}" == "true" ]]; then
build_clean_aggressive
fi

if [[ "${ISSUE_DESKTOP_BUILD}" == "true" ]]; then
build_desktop
fi
Expand Down
8 changes: 7 additions & 1 deletion build/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,11 @@ if [[ "$TARGET" == "presubmit" ]]; then
ANDROID_ABIS="-q arm64-v8a,x86"
fi

# Build the Android sample-gltf-viewer APK during release.
BUILD_SAMPLES=
if [[ "$TARGET" == "release" ]]; then
BUILD_SAMPLES="-k sample-gltf-viewer"
fi

pushd `dirname $0`/../.. > /dev/null
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android $ANDROID_ABIS -c $GENERATE_ARCHIVES $BUILD_DEBUG $BUILD_RELEASE
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android $ANDROID_ABIS -c $BUILD_SAMPLES $GENERATE_ARCHIVES $BUILD_DEBUG $BUILD_RELEASE
2 changes: 2 additions & 0 deletions filament/backend/include/backend/TargetBufferInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class TargetBufferInfo {
class MRT {
public:
static constexpr uint8_t MIN_SUPPORTED_RENDER_TARGET_COUNT = 4u;

// When updating this, make sure to also take care of RenderTarget.java
static constexpr uint8_t MAX_SUPPORTED_RENDER_TARGET_COUNT = 8u;

private:
Expand Down
2 changes: 1 addition & 1 deletion filament/backend/src/CommandStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CommandStream::CommandStream(Driver& driver, CircularBuffer& buffer) noexcept
{
#ifdef ANDROID
char property[PROP_VALUE_MAX];
__system_property_get("filament.perfcounters", property);
__system_property_get("debug.filament.perfcounters", property);
mUsePerformanceCounter = bool(atoi(property));
#endif
}
Expand Down
10 changes: 10 additions & 0 deletions filament/backend/src/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <utils/debug.h>

#if defined(ANDROID)
#include <sys/system_properties.h>
#if defined(FILAMENT_SUPPORTS_OPENGL) && !defined(FILAMENT_USE_EXTERNAL_GLES3)
#include "opengl/PlatformEGLAndroid.h"
#endif
Expand Down Expand Up @@ -82,6 +83,15 @@ Platform::~Platform() noexcept = default;
DefaultPlatform* DefaultPlatform::create(Backend* backend) noexcept {
SYSTRACE_CALL();
assert_invariant(backend);

#if defined(ANDROID)
char scratch[PROP_VALUE_MAX + 1];
int length = __system_property_get("debug.filament.backend", scratch);
if (length > 0) {
*backend = Backend(atoi(scratch));
}
#endif

if (*backend == Backend::DEFAULT) {
*backend = Backend::OPENGL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static void loadSymbol(T*& pfn, const char *symbol) noexcept {

ExternalStreamManagerAndroid& ExternalStreamManagerAndroid::get() noexcept {
// declaring this thread local, will ensure it's destroyed with the calling thread
static UTILS_DECLARE_TLS(ExternalStreamManagerAndroid) instance;
static thread_local ExternalStreamManagerAndroid instance;
return instance;
}

Expand Down
4 changes: 1 addition & 3 deletions filament/backend/src/android/VirtualMachineEnv.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#define TNT_FILAMENT_DRIVER_ANDROID_VIRTUAL_MACHINE_ENV_H

#include <utils/compiler.h>
#include <utils/ThreadLocal.h>
#include <utils/debug.h>

#include <jni.h>
Expand All @@ -31,8 +30,7 @@ class VirtualMachineEnv {

static VirtualMachineEnv& get() noexcept {
// declaring this thread local, will ensure it's destroyed with the calling thread
static UTILS_DECLARE_TLS(VirtualMachineEnv)
instance;
static thread_local VirtualMachineEnv instance;
return instance;
}

Expand Down
4 changes: 2 additions & 2 deletions filament/backend/src/opengl/OpenGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ OpenGLContext::OpenGLContext() noexcept {
if (ext.KHR_debug) {
auto cb = [](GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length,
const GLchar* message, const void *userParam) {
io::LogStream* stream = nullptr;
io::ostream* stream = nullptr;
switch (severity) {
case GL_DEBUG_SEVERITY_HIGH:
stream = &slog.e;
Expand All @@ -196,7 +196,7 @@ OpenGLContext::OpenGLContext() noexcept {
stream = &slog.i;
break;
}
io::LogStream& out = *stream;
io::ostream& out = *stream;
out << "KHR_debug ";
switch (type) {
case GL_DEBUG_TYPE_ERROR:
Expand Down
Loading

0 comments on commit 0bf02b7

Please sign in to comment.