Skip to content

Commit

Permalink
Merge branch 'rc/1.53.5' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
poweifeng committed Aug 13, 2024
2 parents a7b4b9d + e253051 commit a109a52
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 16 deletions.
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.53.4'
implementation 'com.google.android.filament:filament-android:1.53.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.53.4'
pod 'Filament', '~> 1.53.5'
```

### Snapshots
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ 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.53.5

- engine: Fix bug causing certain sampler parameters to not be applied correctly in GLES 2.0 and on
certain GLES 3.0 drivers.

## v1.53.4


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.53.4
VERSION_NAME=1.53.5

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

Expand Down
13 changes: 8 additions & 5 deletions filament/backend/src/CommandBufferQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ void CommandBufferQueue::flush() noexcept {
size_t const used = std::distance(
static_cast<char const*>(begin), static_cast<char const*>(end));


std::unique_lock<utils::Mutex> lock(mLock);
mCommandBuffersToExecute.push_back({ begin, end });
mCondition.notify_one();

// circular buffer is too small, we corrupted the stream
FILAMENT_CHECK_POSTCONDITION(used <= mFreeSpace) <<
Expand All @@ -112,10 +111,12 @@ void CommandBufferQueue::flush() noexcept {
"Space used at this time: " << used <<
" bytes, overflow: " << used - mFreeSpace << " bytes";

// wait until there is enough space in the buffer
mFreeSpace -= used;
if (UTILS_UNLIKELY(mFreeSpace < requiredSize)) {
mCommandBuffersToExecute.push_back({ begin, end });
mCondition.notify_one();

// wait until there is enough space in the buffer
if (UTILS_UNLIKELY(mFreeSpace < requiredSize)) {

#ifndef NDEBUG
size_t const totalUsed = circularBuffer.size() - mFreeSpace;
Expand Down Expand Up @@ -153,8 +154,10 @@ std::vector<CommandBufferQueue::Range> CommandBufferQueue::waitForCommands() con
}

void CommandBufferQueue::releaseBuffer(CommandBufferQueue::Range const& buffer) {
size_t const used = std::distance(
static_cast<char const*>(buffer.begin), static_cast<char const*>(buffer.end));
std::lock_guard<utils::Mutex> const lock(mLock);
mFreeSpace += uintptr_t(buffer.end) - uintptr_t(buffer.begin);
mFreeSpace += used;
mCondition.notify_one();
}

Expand Down
13 changes: 13 additions & 0 deletions filament/backend/src/opengl/OpenGLDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,15 @@ void OpenGLDriver::updateSamplerGroup(Handle<HwSamplerGroup> sbh,
GLTexture const* const t = handle_cast<const GLTexture*>(th);
assert_invariant(t);

if (UTILS_UNLIKELY(es2)
#if defined(GL_EXT_texture_filter_anisotropic)
|| UTILS_UNLIKELY(anisotropyWorkaround)
#endif
) {
// We must set texture parameters on the texture itself.
bindTexture(OpenGLContext::DUMMY_TEXTURE_BINDING, t);
}

SamplerParams params = pSamplers[i].s;
if (UTILS_UNLIKELY(t->target == SamplerType::SAMPLER_EXTERNAL)) {
// From OES_EGL_image_external spec:
Expand Down Expand Up @@ -3881,6 +3890,7 @@ void OpenGLDriver::bindRenderPrimitive(Handle<HwRenderPrimitive> rph) {
}

void OpenGLDriver::draw2(uint32_t indexOffset, uint32_t indexCount, uint32_t instanceCount) {
DEBUG_MARKER()
GLRenderPrimitive const* const rp = mBoundRenderPrimitive;
if (UTILS_UNLIKELY(!rp || !mValidProgram)) {
return;
Expand All @@ -3902,6 +3912,7 @@ void OpenGLDriver::draw2(uint32_t indexOffset, uint32_t indexCount, uint32_t ins
}

void OpenGLDriver::draw2GLES2(uint32_t indexOffset, uint32_t indexCount, uint32_t instanceCount) {
DEBUG_MARKER()
GLRenderPrimitive const* const rp = mBoundRenderPrimitive;
if (UTILS_UNLIKELY(!rp || !mValidProgram)) {
return;
Expand All @@ -3922,6 +3933,7 @@ void OpenGLDriver::draw2GLES2(uint32_t indexOffset, uint32_t indexCount, uint32_
}

void OpenGLDriver::scissor(Viewport scissor) {
DEBUG_MARKER()
setScissor(scissor);
}

Expand All @@ -3941,6 +3953,7 @@ void OpenGLDriver::draw(PipelineState state, Handle<HwRenderPrimitive> rph,
}

void OpenGLDriver::dispatchCompute(Handle<HwProgram> program, math::uint3 workGroupCount) {
DEBUG_MARKER()
getShaderCompilerService().tick();

OpenGLProgram* const p = handle_cast<OpenGLProgram*>(program);
Expand Down
2 changes: 2 additions & 0 deletions filament/src/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include "details/Engine.h"

#include "ResourceAllocator.h"

#include "details/BufferObject.h"
#include "details/Camera.h"
#include "details/Fence.h"
Expand Down
3 changes: 2 additions & 1 deletion filament/src/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

#include <filament/Renderer.h>

#include "details/Renderer.h"
#include "ResourceAllocator.h"

#include "details/Engine.h"
#include "details/Renderer.h"
#include "details/View.h"

#include <utils/FixedCapacityVector.h>
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.53.4"
spec.version = "1.53.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.53.4/filament-v1.53.4-ios.tgz" }
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.53.5/filament-v1.53.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
12 changes: 8 additions & 4 deletions libs/utils/include/utils/WorkStealingDequeue.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ void WorkStealingDequeue<TYPE, COUNT>::push(TYPE item) noexcept {
index_t bottom = mBottom.load(std::memory_order_relaxed);
setItemAt(bottom, item);

// std::memory_order_release is used because we release the item we just pushed to other
// Here we need std::memory_order_release because we release, the item we just pushed, to other
// threads which are calling steal().
mBottom.store(bottom + 1, std::memory_order_release);
// However, generally seq_cst cannot be mixed with other memory orders. So we must use seq_cst.
// see: https://plv.mpi-sws.org/scfix/paper.pdf
mBottom.store(bottom + 1, std::memory_order_seq_cst);
}

/*
Expand Down Expand Up @@ -155,9 +157,11 @@ TYPE WorkStealingDequeue<TYPE, COUNT>::pop() noexcept {
assert(top - bottom == 1);
}

// std::memory_order_relaxed used because we're not publishing any data.
// Here, we only need std::memory_order_relaxed because we're not publishing any data.
// No concurrent writes to mBottom possible, it's always safe to write mBottom.
mBottom.store(top, std::memory_order_relaxed);
// However, generally seq_cst cannot be mixed with other memory orders. So we must use seq_cst.
// see: https://plv.mpi-sws.org/scfix/paper.pdf
mBottom.store(top, std::memory_order_seq_cst);
return item;
}

Expand Down
5 changes: 5 additions & 0 deletions shaders/src/fog.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ vec4 fog(vec4 color, highp vec3 view) {
// note: d can be +inf with the skybox
highp float d = length(view);

// early exit for object "in front" of the fog
if (d < frameUniforms.fogStart) {
return color;
}

// fogCutOffDistance is set to +inf to disable the cutoff distance
if (d > frameUniforms.fogCutOffDistance) {
return color;
Expand Down
2 changes: 1 addition & 1 deletion web/filament-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filament",
"version": "1.53.4",
"version": "1.53.5",
"description": "Real-time physically based rendering engine",
"main": "filament.js",
"module": "filament.js",
Expand Down

0 comments on commit a109a52

Please sign in to comment.