Skip to content

Commit a109a52

Browse files
committed
Merge branch 'rc/1.53.5' into release
2 parents a7b4b9d + e253051 commit a109a52

File tree

11 files changed

+49
-16
lines changed

11 files changed

+49
-16
lines changed

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.53.4'
34+
implementation 'com.google.android.filament:filament-android:1.53.5'
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.53.4'
54+
pod 'Filament', '~> 1.53.5'
5555
```
5656

5757
### Snapshots

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ 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.53.5
11+
12+
- engine: Fix bug causing certain sampler parameters to not be applied correctly in GLES 2.0 and on
13+
certain GLES 3.0 drivers.
14+
1015
## v1.53.4
1116

1217

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

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

filament/backend/src/CommandBufferQueue.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ void CommandBufferQueue::flush() noexcept {
101101
size_t const used = std::distance(
102102
static_cast<char const*>(begin), static_cast<char const*>(end));
103103

104+
104105
std::unique_lock<utils::Mutex> lock(mLock);
105-
mCommandBuffersToExecute.push_back({ begin, end });
106-
mCondition.notify_one();
107106

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

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

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

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

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

filament/backend/src/opengl/OpenGLDriver.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,6 +2341,15 @@ void OpenGLDriver::updateSamplerGroup(Handle<HwSamplerGroup> sbh,
23412341
GLTexture const* const t = handle_cast<const GLTexture*>(th);
23422342
assert_invariant(t);
23432343

2344+
if (UTILS_UNLIKELY(es2)
2345+
#if defined(GL_EXT_texture_filter_anisotropic)
2346+
|| UTILS_UNLIKELY(anisotropyWorkaround)
2347+
#endif
2348+
) {
2349+
// We must set texture parameters on the texture itself.
2350+
bindTexture(OpenGLContext::DUMMY_TEXTURE_BINDING, t);
2351+
}
2352+
23442353
SamplerParams params = pSamplers[i].s;
23452354
if (UTILS_UNLIKELY(t->target == SamplerType::SAMPLER_EXTERNAL)) {
23462355
// From OES_EGL_image_external spec:
@@ -3881,6 +3890,7 @@ void OpenGLDriver::bindRenderPrimitive(Handle<HwRenderPrimitive> rph) {
38813890
}
38823891

38833892
void OpenGLDriver::draw2(uint32_t indexOffset, uint32_t indexCount, uint32_t instanceCount) {
3893+
DEBUG_MARKER()
38843894
GLRenderPrimitive const* const rp = mBoundRenderPrimitive;
38853895
if (UTILS_UNLIKELY(!rp || !mValidProgram)) {
38863896
return;
@@ -3902,6 +3912,7 @@ void OpenGLDriver::draw2(uint32_t indexOffset, uint32_t indexCount, uint32_t ins
39023912
}
39033913

39043914
void OpenGLDriver::draw2GLES2(uint32_t indexOffset, uint32_t indexCount, uint32_t instanceCount) {
3915+
DEBUG_MARKER()
39053916
GLRenderPrimitive const* const rp = mBoundRenderPrimitive;
39063917
if (UTILS_UNLIKELY(!rp || !mValidProgram)) {
39073918
return;
@@ -3922,6 +3933,7 @@ void OpenGLDriver::draw2GLES2(uint32_t indexOffset, uint32_t indexCount, uint32_
39223933
}
39233934

39243935
void OpenGLDriver::scissor(Viewport scissor) {
3936+
DEBUG_MARKER()
39253937
setScissor(scissor);
39263938
}
39273939

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

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

39463959
OpenGLProgram* const p = handle_cast<OpenGLProgram*>(program);

filament/src/Engine.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "details/Engine.h"
1818

19+
#include "ResourceAllocator.h"
20+
1921
#include "details/BufferObject.h"
2022
#include "details/Camera.h"
2123
#include "details/Fence.h"

filament/src/Renderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616

1717
#include <filament/Renderer.h>
1818

19-
#include "details/Renderer.h"
19+
#include "ResourceAllocator.h"
2020

2121
#include "details/Engine.h"
22+
#include "details/Renderer.h"
2223
#include "details/View.h"
2324

2425
#include <utils/FixedCapacityVector.h>

ios/CocoaPods/Filament.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |spec|
22
spec.name = "Filament"
3-
spec.version = "1.53.4"
3+
spec.version = "1.53.5"
44
spec.license = { :type => "Apache 2.0", :file => "LICENSE" }
55
spec.homepage = "https://google.github.io/filament"
66
spec.authors = "Google LLC."
77
spec.summary = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WASM/WebGL."
88
spec.platform = :ios, "11.0"
9-
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.53.4/filament-v1.53.4-ios.tgz" }
9+
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.53.5/filament-v1.53.5-ios.tgz" }
1010

1111
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
1212
spec.pod_target_xcconfig = {

libs/utils/include/utils/WorkStealingDequeue.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ void WorkStealingDequeue<TYPE, COUNT>::push(TYPE item) noexcept {
9393
index_t bottom = mBottom.load(std::memory_order_relaxed);
9494
setItemAt(bottom, item);
9595

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

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

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

shaders/src/fog.fs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ vec4 fog(vec4 color, highp vec3 view) {
77
// note: d can be +inf with the skybox
88
highp float d = length(view);
99

10+
// early exit for object "in front" of the fog
11+
if (d < frameUniforms.fogStart) {
12+
return color;
13+
}
14+
1015
// fogCutOffDistance is set to +inf to disable the cutoff distance
1116
if (d > frameUniforms.fogCutOffDistance) {
1217
return color;

web/filament-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "filament",
3-
"version": "1.53.4",
3+
"version": "1.53.5",
44
"description": "Real-time physically based rendering engine",
55
"main": "filament.js",
66
"module": "filament.js",

0 commit comments

Comments
 (0)