Skip to content

Commit

Permalink
Merge branch 'rc/1.54.3' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
poweifeng committed Sep 10, 2024
2 parents bb1d1c7 + 32b0625 commit 3e55658
Show file tree
Hide file tree
Showing 41 changed files with 248 additions and 135 deletions.
17 changes: 17 additions & 0 deletions .github/actions/android-continuous/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Android Continuous'
inputs:
build-abi:
description: 'The target platform ABI'
required: true
default: 'armeabi-v7a'
runs:
using: "composite"
steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Run build script
run: |
cd build/android && printf "y" | ./build.sh continuous ${{ inputs.build-abi }}
shell: bash
47 changes: 25 additions & 22 deletions .github/workflows/android-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,35 @@ on:
- rc/**

jobs:
build-android:
name: build-android
build-android-armv7:
name: build-android-armv7
runs-on: macos-14

steps:
- uses: actions/[email protected]
- uses: actions/setup-java@v3
- name: Run Android Continuous
uses: ./.github/actions/android-continuous
with:
distribution: 'temurin'
java-version: '17'
- name: Run build script
run: |
cd build/android && printf "y" | ./build.sh continuous
- uses: actions/[email protected]
with:
name: filament-android
path: out/filament-android-release.aar
- uses: actions/[email protected]
with:
name: filamat-android-full
path: out/filamat-android-release.aar
- uses: actions/[email protected]
build-abi: armeabi-v7a

build-android-armv8a:
name: build-android-armv8a
runs-on: macos-14

steps:
- uses: actions/[email protected]
- name: Run Android Continuous
uses: ./.github/actions/android-continuous
with:
name: gltfio-android-release
path: out/gltfio-android-release.aar
- uses: actions/[email protected]
build-abi: arm64-v8a

build-android-x86_64:
name: build-android-x86_64
runs-on: macos-14

steps:
- uses: actions/[email protected]
- name: Run Android Continuous
uses: ./.github/actions/android-continuous
with:
name: filament-utils-android-release
path: out/filament-utils-android-release.aar
build-abi: x86_64
4 changes: 3 additions & 1 deletion .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Run build script
# Only build 1 64 bit target during presubmit to cut down build times during presubmit
# Continuous builds will build everything
run: |
cd build/android && printf "y" | ./build.sh presubmit
cd build/android && printf "y" | ./build.sh presubmit arm64-v8a
build-ios:
name: build-iOS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
env:
TAG: ${{ steps.git_ref.outputs.tag }}
run: |
cd build/android && printf "y" | ./build.sh release
cd build/android && printf "y" | ./build.sh release armeabi-v7a,arm64-v8a,x86,x86_64
cd ../..
mv out/filament-android-release.aar out/filament-${TAG}-android.aar
mv out/filamat-android-release.aar out/filamat-${TAG}-android.aar
Expand Down
14 changes: 2 additions & 12 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.54.2'
implementation 'com.google.android.filament:filament-android:1.54.3'
}
```

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

```shell
pod 'Filament', '~> 1.54.2'
pod 'Filament', '~> 1.54.3'
```

### Snapshots

If you prefer to live on the edge, you can download a continuous build by following the following
steps:

1. Find the [commit](https://github.com/google/filament/commits/main) you're interested in.
2. Click the green check mark under the commit message.
3. Click on the _Details_ link for the platform you're interested in.
4. On the top left click _Summary_, then in the _Artifacts_ section choose the desired artifact.

## Documentation

- [Filament](https://google.github.io/filament/Filament.html), an in-depth explanation of
Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ A new header is inserted each time a *tag* is created.
Instead, if you are authoring a PR for the main branch, add your release note to
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).

## v1.54.3


## v1.54.2

- Add a `name` API to Filament objects for debugging handle use-after-free assertions
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.54.2
VERSION_NAME=1.54.3

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

Expand Down
22 changes: 15 additions & 7 deletions build/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,27 @@ if [[ ! -d "${ANDROID_HOME}/ndk/$FILAMENT_NDK_VERSION" ]]; then
yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses
${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "ndk;$FILAMENT_NDK_VERSION"
fi

# Only build 1 64 bit target during presubmit to cut down build times during presubmit
# Continuous builds will build everything
ANDROID_ABIS=
if [[ "$TARGET" == "presubmit" ]]; then
ANDROID_ABIS="-q arm64-v8a"
fi

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

function build_android() {
local ABI=$1

# Do the following in two steps so that we do not run out of space
if [[ -n "${BUILD_DEBUG}" ]]; then
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android -q ${ABI} -c ${BUILD_SAMPLES} ${GENERATE_ARCHIVES} ${BUILD_DEBUG}
rm -rf out/cmake-android-debug-*
fi
if [[ -n "${BUILD_RELEASE}" ]]; then
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android -q ${ABI} -c ${BUILD_SAMPLES} ${GENERATE_ARCHIVES} ${BUILD_RELEASE}
rm -rf out/cmake-android-release-*
fi
}

pushd `dirname $0`/../.. > /dev/null
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android $ANDROID_ABIS -c $BUILD_SAMPLES $GENERATE_ARCHIVES $BUILD_DEBUG $BUILD_RELEASE
build_android $2
2 changes: 1 addition & 1 deletion filament/backend/include/backend/DriverEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ struct RasterState {
bool inverseFrontFaces : 1; // 31

//! padding, must be 0
uint8_t padding : 1; // 32
bool depthClamp : 1; // 32
};
uint32_t u = 0;
};
Expand Down
7 changes: 3 additions & 4 deletions filament/backend/include/private/backend/DriverAPI.inc
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ DECL_DRIVER_API_SYNCHRONOUS_0(bool, isParallelShaderCompileSupported)
DECL_DRIVER_API_SYNCHRONOUS_0(bool, isDepthStencilResolveSupported)
DECL_DRIVER_API_SYNCHRONOUS_N(bool, isDepthStencilBlitSupported, backend::TextureFormat, format)
DECL_DRIVER_API_SYNCHRONOUS_0(bool, isProtectedTexturesSupported)
DECL_DRIVER_API_SYNCHRONOUS_0(bool, isDepthClampSupported)
DECL_DRIVER_API_SYNCHRONOUS_0(uint8_t, getMaxDrawBuffers)
DECL_DRIVER_API_SYNCHRONOUS_0(size_t, getMaxUniformBufferSize)
DECL_DRIVER_API_SYNCHRONOUS_0(math::float2, getClipSpaceParams)
Expand Down Expand Up @@ -443,12 +444,10 @@ DECL_DRIVER_API_N(setPushConstant,
backend::PushConstantVariant, value)

DECL_DRIVER_API_N(insertEventMarker,
const char*, string,
uint32_t, len = 0)
const char*, string)

DECL_DRIVER_API_N(pushGroupMarker,
const char*, string,
uint32_t, len = 0)
const char*, string)

DECL_DRIVER_API_0(popGroupMarker)

Expand Down
2 changes: 1 addition & 1 deletion filament/backend/src/CircularBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <utils/debug.h>
#include <utils/ostream.h>

#if !defined(WIN32) && !defined(__EMSCRIPTEN__) && !defined(IOS)
#if !defined(WIN32) && !defined(__EMSCRIPTEN__)
# include <sys/mman.h>
# include <unistd.h>
# define HAS_MMAP 1
Expand Down
1 change: 1 addition & 0 deletions filament/backend/src/metal/MetalContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ struct MetalContext {
std::array<BufferState, MAX_SSBO_COUNT> ssboState;
CullModeStateTracker cullModeState;
WindingStateTracker windingState;
DepthClampStateTracker depthClampState;
Handle<HwRenderPrimitive> currentRenderPrimitive;

// State caches.
Expand Down
15 changes: 13 additions & 2 deletions filament/backend/src/metal/MetalDriver.mm
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,10 @@
return false;
}

bool MetalDriver::isDepthClampSupported() {
return true;
}

bool MetalDriver::isWorkaroundNeeded(Workaround workaround) {
switch (workaround) {
case Workaround::SPLIT_EASU:
Expand Down Expand Up @@ -1298,11 +1302,11 @@
pushConstants.setPushConstant(value, index);
}

void MetalDriver::insertEventMarker(const char* string, uint32_t len) {
void MetalDriver::insertEventMarker(const char* string) {

}

void MetalDriver::pushGroupMarker(const char* string, uint32_t len) {
void MetalDriver::pushGroupMarker(const char* string) {
mContext->groupMarkers.push(string);
}

Expand Down Expand Up @@ -1774,6 +1778,13 @@
[mContext->currentRenderPassEncoder setFrontFacingWinding:winding];
}

// depth clip mode
MTLDepthClipMode depthClipMode = rs.depthClamp ? MTLDepthClipModeClamp : MTLDepthClipModeClip;
mContext->depthClampState.updateState(depthClipMode);
if (mContext->depthClampState.stateChanged()) {
[mContext->currentRenderPassEncoder setDepthClipMode:depthClipMode];
}

// Set the depth-stencil state, if a state change is needed.
DepthStencilState depthState;
if (depthAttachment) {
Expand Down
1 change: 1 addition & 0 deletions filament/backend/src/metal/MetalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ using SamplerStateCache = StateCache<SamplerState, id<MTLSamplerState>, SamplerS

using CullModeStateTracker = StateTracker<MTLCullMode>;
using WindingStateTracker = StateTracker<MTLWinding>;
using DepthClampStateTracker = StateTracker<MTLDepthClipMode>;

// Argument encoder

Expand Down
8 changes: 6 additions & 2 deletions filament/backend/src/noop/NoopDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ bool NoopDriver::isProtectedTexturesSupported() {
return true;
}

bool NoopDriver::isDepthClampSupported() {
return false;
}

bool NoopDriver::isWorkaroundNeeded(Workaround) {
return false;
}
Expand Down Expand Up @@ -316,10 +320,10 @@ void NoopDriver::setPushConstant(backend::ShaderStage stage, uint8_t index,
backend::PushConstantVariant value) {
}

void NoopDriver::insertEventMarker(char const* string, uint32_t len) {
void NoopDriver::insertEventMarker(char const* string) {
}

void NoopDriver::pushGroupMarker(char const* string, uint32_t len) {
void NoopDriver::pushGroupMarker(char const* string) {
}

void NoopDriver::popGroupMarker(int) {
Expand Down
2 changes: 2 additions & 0 deletions filament/backend/src/opengl/OpenGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ void OpenGLContext::initExtensionsGLES(Extensions* ext, GLint major, GLint minor
#ifndef __EMSCRIPTEN__
ext->EXT_debug_marker = exts.has("GL_EXT_debug_marker"sv);
#endif
ext->EXT_depth_clamp = exts.has("GL_EXT_depth_clamp"sv);
ext->EXT_discard_framebuffer = exts.has("GL_EXT_discard_framebuffer"sv);
#ifndef __EMSCRIPTEN__
ext->EXT_disjoint_timer_query = exts.has("GL_EXT_disjoint_timer_query"sv);
Expand Down Expand Up @@ -746,6 +747,7 @@ void OpenGLContext::initExtensionsGL(Extensions* ext, GLint major, GLint minor)
ext->EXT_color_buffer_half_float = true; // Assumes core profile.
ext->EXT_clip_cull_distance = true;
ext->EXT_debug_marker = exts.has("GL_EXT_debug_marker"sv);
ext->EXT_depth_clamp = true;
ext->EXT_discard_framebuffer = false;
ext->EXT_disjoint_timer_query = true;
ext->EXT_multisampled_render_to_texture = false;
Expand Down
8 changes: 5 additions & 3 deletions filament/backend/src/opengl/OpenGLContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ class OpenGLContext final : public TimerQueryFactoryInterface {
bool EXT_color_buffer_float;
bool EXT_color_buffer_half_float;
bool EXT_debug_marker;
bool EXT_disjoint_timer_query;
bool EXT_depth_clamp;
bool EXT_discard_framebuffer;
bool EXT_disjoint_timer_query;
bool EXT_multisampled_render_to_texture2;
bool EXT_multisampled_render_to_texture;
bool EXT_protected_textures;
Expand All @@ -239,10 +240,10 @@ class OpenGLContext final : public TimerQueryFactoryInterface {
bool KHR_parallel_shader_compile;
bool KHR_texture_compression_astc_hdr;
bool KHR_texture_compression_astc_ldr;
bool OES_depth_texture;
bool OES_EGL_image_external_essl3;
bool OES_depth24;
bool OES_depth_texture;
bool OES_packed_depth_stencil;
bool OES_EGL_image_external_essl3;
bool OES_rgb8_rgba8;
bool OES_standard_derivatives;
bool OES_texture_npot;
Expand Down Expand Up @@ -627,6 +628,7 @@ constexpr size_t OpenGLContext::getIndexForCap(GLenum cap) noexcept { //NOLINT
#ifdef BACKEND_OPENGL_VERSION_GL
case GL_PROGRAM_POINT_SIZE: index = 10; break;
#endif
case GL_DEPTH_CLAMP: index = 11; break;
default: break;
}
assert_invariant(index < state.enables.caps.size());
Expand Down
Loading

0 comments on commit 3e55658

Please sign in to comment.