Skip to content

Commit

Permalink
Merge branch 'rc/1.54.5' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Sep 24, 2024
2 parents 65aed71 + 6cc4ae0 commit 0e4d35b
Show file tree
Hide file tree
Showing 22 changed files with 110 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ios-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Run build script
run: |
cd build/ios && printf "y" | ./build.sh continuous
- uses: actions/upload-artifact@v1.0.0
- uses: actions/upload-artifact@v4
with:
name: filament-ios
path: out/filament-release-ios.tgz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Run build script
run: |
cd build/linux && printf "y" | ./build.sh continuous
- uses: actions/upload-artifact@v1.0.0
- uses: actions/upload-artifact@v4
with:
name: filament-linux
path: out/filament-release-linux.tgz
2 changes: 1 addition & 1 deletion .github/workflows/mac-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Run build script
run: |
cd build/mac && printf "y" | ./build.sh continuous
- uses: actions/upload-artifact@v1.0.0
- uses: actions/upload-artifact@v4
with:
name: filament-mac
path: out/filament-release-darwin.tgz
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
os: [macos-14, ubuntu-22.04]
os: [macos-14-xlarge, ubuntu-22.04-16core]

steps:
- uses: actions/[email protected]
Expand All @@ -29,7 +29,7 @@ jobs:
build-windows:
name: build-windows
runs-on: windows-2019
runs-on: windows-2019-32core

steps:
- uses: actions/[email protected]
Expand All @@ -40,7 +40,7 @@ jobs:

build-android:
name: build-android
runs-on: macos-14
runs-on: ubuntu-22.04-16core

steps:
- uses: actions/[email protected]
Expand All @@ -56,7 +56,7 @@ jobs:
build-ios:
name: build-iOS
runs-on: macos-14
runs-on: macos-14-xlarge

steps:
- uses: actions/[email protected]
Expand All @@ -69,7 +69,7 @@ jobs:
build-web:
name: build-web
runs-on: macos-14
runs-on: ubuntu-22.04-16core

steps:
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Run build script
run: |
cd build/web && printf "y" | ./build.sh continuous
- uses: actions/upload-artifact@v1.0.0
- uses: actions/upload-artifact@v4
with:
name: filament-web
path: out/filament-release-web.tgz
4 changes: 2 additions & 2 deletions .github/workflows/windows-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:
jobs:
build-windows:
name: build-windows
runs-on: windows-2019
runs-on: windows-2019-32core

steps:
- uses: actions/[email protected]
- name: Run build script
run: |
build\windows\build-github.bat continuous
shell: cmd
- uses: actions/upload-artifact@v1.0.0
- uses: actions/upload-artifact@v4
with:
name: filament-windows
path: out/filament-windows.tgz
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.54.4'
implementation 'com.google.android.filament:filament-android:1.54.5'
}
```

Expand All @@ -51,7 +51,7 @@ 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.4'
pod 'Filament', '~> 1.54.5'
```

## Documentation
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.5


## v1.54.4

- Add support for multi-layered render target with array textures.
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.4
VERSION_NAME=1.54.5

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

Expand Down
6 changes: 1 addition & 5 deletions build/web/ci-common.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
if [ `uname` == "Linux" ];then
curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
unzip -q ninja-linux.zip
source `dirname $0`/../linux/ci-common.sh
elif [ `uname` == "Darwin" ];then
curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip
unzip -q ninja-mac.zip
Expand All @@ -13,9 +12,6 @@ fi
chmod +x ninja
export PATH="$PWD:$PATH"

# FIXME: kokoro machines have node and npm but currently they are symlinked to non-existent files
# npm install -g typescript

# Install emscripten.
curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.15.zip > emsdk.zip
unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk
Expand Down
2 changes: 1 addition & 1 deletion docs/remote/filament.js

Large diffs are not rendered by default.

Binary file modified docs/remote/filament.wasm
Binary file not shown.
11 changes: 7 additions & 4 deletions filament/backend/src/opengl/OpenGLDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
if (any(t->usage & TextureUsage::SAMPLEABLE)) {
switch (t->target) {
case SamplerType::SAMPLER_2D:
case SamplerType::SAMPLER_3D:
case SamplerType::SAMPLER_2D_ARRAY:
case SamplerType::SAMPLER_CUBEMAP_ARRAY:
// this could be GL_TEXTURE_2D_MULTISAMPLE or GL_TEXTURE_2D_ARRAY
Expand All @@ -1158,7 +1159,9 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
target = getCubemapTarget(binfo.layer);
// note: cubemaps can't be multi-sampled
break;
default:
case SamplerType::SAMPLER_EXTERNAL:
// This is an error. We have asserted in debug build.
target = t->gl.target;
break;
}
}
Expand All @@ -1176,7 +1179,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,

if (rt->gl.samples <= 1 ||
(rt->gl.samples > 1 && t->samples > 1 && gl.features.multisample_texture)) {
// on GL3.2 / GLES3.1 and above multisample is handled when creating the texture.
// On GL3.2 / GLES3.1 and above multisample is handled when creating the texture.
// If multisampled textures are not supported and we end-up here, things should
// still work, albeit without MSAA.
gl.bindFramebuffer(GL_FRAMEBUFFER, rt->gl.fbo);
Expand All @@ -1200,6 +1203,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
GL_RENDERBUFFER, t->gl.id);
}
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_CUBE_MAP_ARRAY:
#ifndef FILAMENT_SILENCE_NOT_SUPPORTED_BY_ES2
Expand Down Expand Up @@ -1313,6 +1317,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
GL_RENDERBUFFER, t->gl.id);
}
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_CUBE_MAP_ARRAY:
#ifndef FILAMENT_SILENCE_NOT_SUPPORTED_BY_ES2
Expand Down Expand Up @@ -2379,9 +2384,7 @@ void OpenGLDriver::updateSamplerGroup(Handle<HwSamplerGroup> sbh,
GLSamplerGroup* const sb = handle_cast<GLSamplerGroup *>(sbh);
assert_invariant(sb->textureUnitEntries.size() == data.size / sizeof(SamplerDescriptor));

#ifndef FILAMENT_SILENCE_NOT_SUPPORTED_BY_ES2
bool const es2 = context.isES2();
#endif

auto const* const pSamplers = (SamplerDescriptor const*)data.buffer;
for (size_t i = 0, c = sb->textureUnitEntries.size(); i < c; i++) {
Expand Down
16 changes: 15 additions & 1 deletion filament/src/details/RenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@

#include "FilamentAPI-impl.h"

#include <utils/Panic.h>
#include <filament/RenderTarget.h>

#include <utils/compiler.h>
#include <utils/BitmaskEnum.h>
#include <utils/Panic.h>

#include <algorithm>
#include <iterator>
#include <limits>

#include <stdint.h>
#include <stddef.h>


namespace filament {

Expand Down Expand Up @@ -73,11 +83,15 @@ RenderTarget* RenderTarget::Builder::build(Engine& engine) {
if (color.texture) {
FILAMENT_CHECK_PRECONDITION(color.texture->getUsage() & TextureUsage::COLOR_ATTACHMENT)
<< "Texture usage must contain COLOR_ATTACHMENT";
FILAMENT_CHECK_PRECONDITION(color.texture->getTarget() != Texture::Sampler::SAMPLER_EXTERNAL)
<< "Color attachment can't be an external texture";
}

if (depth.texture) {
FILAMENT_CHECK_PRECONDITION(depth.texture->getUsage() & TextureUsage::DEPTH_ATTACHMENT)
<< "Texture usage must contain DEPTH_ATTACHMENT";
FILAMENT_CHECK_PRECONDITION(depth.texture->getTarget() != Texture::Sampler::SAMPLER_EXTERNAL)
<< "Depth attachment can't be an external texture";
}

const size_t maxDrawBuffers = downcast(engine).getDriverApi().getMaxDrawBuffers();
Expand Down
6 changes: 6 additions & 0 deletions filament/src/details/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ void FRenderer::renderStandaloneView(FView const* view) {
renderInternal(view);

driver.endFrame(mFrameId);

// This is a workaround for internal bug b/361822355.
// TODO: properly address the bug and remove this workaround.
if (engine.getBackend() == backend::Backend::VULKAN) {
engine.flushAndWait();
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions ios/CocoaPods/Filament.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |spec|
spec.name = "Filament"
spec.version = "1.54.4"
spec.version = "1.54.5"
spec.license = { :type => "Apache 2.0", :file => "LICENSE" }
spec.homepage = "https://google.github.io/filament"
spec.authors = "Google LLC."
spec.summary = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WASM/WebGL."
spec.platform = :ios, "11.0"
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.54.4/filament-v1.54.4-ios.tgz" }
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.54.5/filament-v1.54.5-ios.tgz" }

# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
spec.pod_target_xcconfig = {
Expand Down
1 change: 1 addition & 0 deletions libs/filamentapp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ set(LIBS
geometry
getopt
image
imageio
imgui
ktxreader
math
Expand Down
1 change: 1 addition & 0 deletions libs/filamentapp/include/filamentapp/IBL.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <math/vec3.h>

#include <string>
#include <sstream>

namespace filament {
class Engine;
Expand Down
3 changes: 3 additions & 0 deletions libs/filamentapp/src/FilamentApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ void FilamentApp::loadIBL(std::string_view path) {
return;
}

// Note that IBL holds a skybox, and Scene also holds a reference. We cannot release IBL's
// skybox until after new skybox has been set in the scene.
std::unique_ptr<IBL> oldIBL = std::move(mIBL);
mIBL = std::make_unique<IBL>(*mEngine);

if (!iblPath.isDirectory()) {
Expand Down
53 changes: 41 additions & 12 deletions libs/filamentapp/src/IBL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <ktxreader/Ktx1Reader.h>

#include <imageio/ImageDecoder.h>

#include <filament-iblprefilter/IBLPrefilterContext.h>

#include <stb_image.h>
Expand All @@ -37,6 +39,8 @@

#include <string.h>

#include <utils/Log.h>

using namespace filament;
using namespace filament::math;
using namespace ktxreader;
Expand All @@ -60,26 +64,51 @@ bool IBL::loadFromEquirect(Path const& path) {
return false;
}

int w, h;
stbi_info(path.getAbsolutePath().c_str(), &w, &h, nullptr);
if (w != h * 2) {
std::cerr << "not an equirectangular image!" << std::endl;
return false;
int w = 0, h = 0;
int n = 0;
size_t size = 0;
void* data = nullptr;
void* user = nullptr;
Texture::PixelBufferDescriptor::Callback destroyer{};

if (path.getExtension() == "exr") {
std::ifstream in_stream(path.getAbsolutePath().c_str(), std::ios::binary);
image::LinearImage* image = new image::LinearImage(
image::ImageDecoder::decode(in_stream, path.getAbsolutePath().c_str()));
w = image->getWidth();
h = image->getHeight();
n = image->getChannels();
size = w * h * n * sizeof(float);
data = image->getPixelRef();
user = image;
destroyer = [](void*, size_t, void* user) {
delete reinterpret_cast<image::LinearImage*>(user);
};
} else {
stbi_info(path.getAbsolutePath().c_str(), &w, &h, nullptr);
// load image as float
size = w * h * sizeof(float3);
data = (float3*)stbi_loadf(path.getAbsolutePath().c_str(), &w, &h, &n, 3);
destroyer = [](void* data, size_t, void*) {
stbi_image_free(data);
};
}

// load image as float
int n;
const size_t size = w * h * sizeof(float3);
float3* const data = (float3*)stbi_loadf(path.getAbsolutePath().c_str(), &w, &h, &n, 3);
if (data == nullptr || n != 3) {
std::cerr << "Could not decode image " << std::endl;
destroyer(data, size, user);
return false;
}

if (w != h * 2) {
std::cerr << "not an equirectangular image!" << std::endl;
destroyer(data, size, user);
return false;
}

// now load texture
Texture::PixelBufferDescriptor buffer(
data, size,Texture::Format::RGB, Texture::Type::FLOAT,
[](void* buffer, size_t size, void* user) { stbi_image_free(buffer); });
data, size,Texture::Format::RGB, Texture::Type::FLOAT, destroyer, user);

Texture* const equirect = Texture::Builder()
.width((uint32_t)w)
Expand All @@ -102,7 +131,7 @@ bool IBL::loadFromEquirect(Path const& path) {

mTexture = specularFilter(mSkyboxTexture);

mFogTexture = irradianceFilter({ .generateMipmap=false }, mSkyboxTexture);
mFogTexture = irradianceFilter({ .generateMipmap = false }, mSkyboxTexture);
mFogTexture->generateMipmaps(mEngine);

mIndirectLight = IndirectLight::Builder()
Expand Down
Loading

0 comments on commit 0e4d35b

Please sign in to comment.