Merge branch 'rc/1.40.2' into release

This commit is contained in:
Benjamin Doherty
2023-07-17 15:49:28 -06:00
18 changed files with 68 additions and 38 deletions

View File

@@ -78,7 +78,7 @@ To turn an option on or off:
```
$ cd <cmake-build-directory>
$ cmake . -DOPTION=ON # Relace OPTION with the option name, set to ON / OFF
$ cmake . -DOPTION=ON # Replace OPTION with the option name, set to ON / OFF
```
Options can also be set with the CMake GUI.
@@ -181,7 +181,7 @@ Install the following components:
- [Python 3.7](https://www.python.org/ftp/python/3.7.0/python-3.7.0.exe)
- [CMake 3.14 or later](https://github.com/Kitware/CMake/releases/download/v3.14.7/cmake-3.14.7-win64-x64.msi)
The latest Windows SDK can also by installed by opening Visual Studio and selecting _Get Tools and
The latest Windows SDK can also be installed by opening Visual Studio and selecting _Get Tools and
Features..._ under the _Tools_ menu.
By default, Windows treats the file system as case insensitive. Please do not enable case

View File

@@ -7,4 +7,3 @@ for next branch cut* header.
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
## Release notes for next branch cut

View File

@@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.40.1'
implementation 'com.google.android.filament:filament-android:1.40.2'
}
```
@@ -50,7 +50,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
iOS projects can use CocoaPods to install the latest release:
```
pod 'Filament', '~> 1.40.1'
pod 'Filament', '~> 1.40.2'
```
### Snapshots

View File

@@ -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.40.2
- rendering: dynamic resolution would not work with a translucent render target and quality > low
- Java/Kotlin: user callbacks were not invoked on successful texture upload
## v1.40.1
## v1.40.0

View File

@@ -511,9 +511,7 @@ public:
private:
void* mData = nullptr;
jobject mBitmap = nullptr;
jobject mHandler = nullptr;
jobject mCallback = nullptr;
jobject mBitmap{};
AndroidBitmapInfo mInfo{};
};

View File

@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
VERSION_NAME=1.40.1
VERSION_NAME=1.40.2
POM_DESCRIPTION=Real-time physically based rendering engine for Android.

View File

@@ -231,7 +231,7 @@ class MainActivity : Activity() {
animator.repeatCount = ValueAnimator.INFINITE
animator.addUpdateListener { a ->
val v = (a.animatedValue as Float)
camera.lookAt(cos(v) * 4.5, 1.5, sin(v) * 4.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
camera.lookAt(cos(v) * 5.5, 1.5, sin(v) * 5.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
}
animator.start()
}
@@ -253,7 +253,7 @@ class MainActivity : Activity() {
// Stop the animation and any pending frame
choreographer.removeFrameCallback(frameScheduler)
animator.cancel();
animator.cancel()
// Always detach the surface before destroying the engine
uiHelper.detach()

View File

@@ -140,9 +140,9 @@ class MainActivity : Activity() {
camera = engine.createCamera(engine.entityManager.create())
// clear the swapchain with transparent pixels
val options = renderer.clearOptions
options.clear = true
renderer.clearOptions = options
renderer.clearOptions = renderer.clearOptions.apply {
clear = true
}
}
private fun setupView() {

View File

@@ -90,8 +90,8 @@ function print_help {
echo " Desktop matc target, release build:"
echo " \$ ./$self_name release matc"
echo ""
echo " Build gltf_viewer then immediately run it with no arguments:"
echo " \$ ./$self_name release run_gltf_viewer"
echo " Build gltf_viewer:"
echo " \$ ./$self_name release gltf_viewer"
echo ""
}

View File

@@ -85,10 +85,10 @@ VkImageSubresourceRange VulkanAttachment::getSubresourceRange(VkImageAspectFlags
VulkanTimestamps::VulkanTimestamps(VkDevice device) : mDevice(device) {
// Create a timestamp pool large enough to hold a pair of queries for each timer.
VkQueryPoolCreateInfo tqpCreateInfo = {
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
.queryType = VK_QUERY_TYPE_TIMESTAMP,
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
.queryType = VK_QUERY_TYPE_TIMESTAMP,
};
std::unique_lock<utils::Mutex> timestamps_lock(mMutex);
std::unique_lock<utils::Mutex> lock(mMutex);
tqpCreateInfo.queryCount = mUsed.size() * 2;
VkResult result = vkCreateQueryPool(mDevice, &tqpCreateInfo, VKALLOC, &mPool);
ASSERT_POSTCONDITION(result == VK_SUCCESS, "vkCreateQueryPool error.");
@@ -115,23 +115,23 @@ void VulkanTimestamps::clearQuery(uint32_t queryIndex) {
void VulkanTimestamps::beginQuery(VulkanCommandBuffer const* commands,
VulkanTimerQuery* query) {
uint32_t const index = query->startingQueryIndex;
uint32_t const index = query->getStartingQueryIndex();
vkCmdResetQueryPool(commands->cmdbuffer, mPool, index, 2);
vkCmdWriteTimestamp(commands->cmdbuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, mPool, index);
// We stash this because getResult might come before the query is actually processed.
query->fence = commands->fence;
query->setFence(commands->fence);
}
void VulkanTimestamps::endQuery(VulkanCommandBuffer const* commands,
VulkanTimerQuery const* query) {
uint32_t const index = query->stoppingQueryIndex;
uint32_t const index = query->getStoppingQueryIndex();
vkCmdWriteTimestamp(commands->cmdbuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, mPool, index);
}
VulkanTimestamps::QueryResult VulkanTimestamps::getResult(VulkanTimerQuery const* query) {
uint32_t const index = query->startingQueryIndex;
uint32_t const index = query->getStartingQueryIndex();
QueryResult result;
size_t const dataSize = result.size() * sizeof(uint64_t);
VkDeviceSize const stride = sizeof(uint64_t) * 2;

View File

@@ -297,20 +297,25 @@ void VulkanRenderPrimitive::setBuffers(VulkanVertexBuffer* vertexBuffer,
}
VulkanTimerQuery::VulkanTimerQuery(std::tuple<uint32_t, uint32_t> indices)
: startingQueryIndex(std::get<0>(indices)), stoppingQueryIndex(std::get<1>(indices)) {}
: mStartingQueryIndex(std::get<0>(indices)), mStoppingQueryIndex(std::get<1>(indices)) {}
bool VulkanTimerQuery::isCompleted() const noexcept {
void VulkanTimerQuery::setFence(std::shared_ptr<VulkanCmdFence> fence) noexcept {
std::unique_lock<utils::Mutex> lock(mFenceMutex);
mFence = fence;
}
bool VulkanTimerQuery::isCompleted() noexcept {
std::unique_lock<utils::Mutex> lock(mFenceMutex);
// QueryValue is a synchronous call and might occur before beginTimerQuery has written anything
// into the command buffer, which is an error according to the validation layer that ships in
// the Android NDK. Even when AVAILABILITY_BIT is set, validation seems to require that the
// timestamp has at least been written into a processed command buffer.
// This fence indicates that the corresponding buffer has been completed.
if (!fence) {
if (!mFence) {
return false;
}
VkResult status = fence->status.load(std::memory_order_relaxed);
VkResult status = mFence->status.load(std::memory_order_relaxed);
if (status != VK_SUCCESS) {
return false;
}

View File

@@ -26,6 +26,8 @@
#include "private/backend/SamplerGroup.h"
#include "utils/Mutex.h"
namespace filament::backend {
class VulkanTimestamps;
@@ -106,7 +108,7 @@ struct VulkanBufferObject : public HwBufferObject {
VulkanStagePool& stagePool, uint32_t byteCount, BufferObjectBinding bindingType,
BufferUsage usage);
void terminate() {
buffer.terminate();
buffer.terminate();
}
VulkanBuffer buffer;
const BufferObjectBinding bindingType;
@@ -141,14 +143,24 @@ struct VulkanTimerQuery : public HwTimerQuery {
explicit VulkanTimerQuery(std::tuple<uint32_t, uint32_t> indices);
~VulkanTimerQuery();
bool isCompleted() const noexcept;
void setFence(std::shared_ptr<VulkanCmdFence> fence) noexcept;
bool isCompleted() noexcept;
uint32_t getStartingQueryIndex() const {
return mStartingQueryIndex;
}
uint32_t getStoppingQueryIndex() const {
return mStoppingQueryIndex;
}
private:
uint32_t startingQueryIndex;
uint32_t stoppingQueryIndex;
uint32_t mStartingQueryIndex;
uint32_t mStoppingQueryIndex;
std::shared_ptr<VulkanCmdFence> fence;
friend class VulkanTimestamps;
std::shared_ptr<VulkanCmdFence> mFence;
utils::Mutex mFenceMutex;
};
inline constexpr VkBufferUsageFlagBits getBufferObjectUsage(

View File

@@ -1050,7 +1050,7 @@ void FRenderer::renderJob(ArenaScope& arena, FView& view) {
if (scaled) {
mightNeedFinalBlit = false;
auto viewport = DEBUG_DYNAMIC_SCALING ? xvp : vp;
input = ppm.upscale(fg, blendModeTranslucent, dsrOptions, input, xvp, {
input = ppm.upscale(fg, needsAlphaChannel, dsrOptions, input, xvp, {
.width = viewport.width, .height = viewport.height,
.format = colorGradingConfig.ldrFormat });
xvp.left = xvp.bottom = 0;

View File

@@ -1,12 +1,12 @@
Pod::Spec.new do |spec|
spec.name = "Filament"
spec.version = "1.40.1"
spec.version = "1.40.2"
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.40.1/filament-v1.40.1-ios.tgz" }
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.40.2/filament-v1.40.2-ios.tgz" }
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
spec.pod_target_xcconfig = {

View File

@@ -120,6 +120,11 @@ Material* ArchiveCache::getMaterial(const ArchiveRequirements& reqs) {
.build(mEngine);
}
// Don't attempt to precompile shaders on WebGL.
// Chrome already suffers from slow shader compilation:
// https://github.com/google/filament/issues/6615
// Precompiling shaders exacerbates the problem.
#if !defined(__EMSCRIPTEN__)
// compile everything at low priority
mMaterials[i]->compile(Material::CompilerPriorityQueue::LOW);
@@ -128,6 +133,7 @@ Material* ArchiveCache::getMaterial(const ArchiveRequirements& reqs) {
UserVariantFilterBit::DIRECTIONAL_LIGHTING |
UserVariantFilterBit::DYNAMIC_LIGHTING |
UserVariantFilterBit::SHADOW_RECEIVER);
#endif
return mMaterials[i];
}

View File

@@ -50,8 +50,13 @@ Path::Path(const std::string& path)
}
bool Path::exists() const {
#if defined(_WIN64) || defined(_M_X64)
struct _stat64 file;
return _stat64(c_str(), &file) == 0;
#else
struct stat file;
return stat(c_str(), &file) == 0;
#endif
}
bool Path::isFile() const {

View File

@@ -1,6 +1,6 @@
{
"name": "filament",
"version": "1.40.1",
"version": "1.40.2",
"description": "Real-time physically based rendering engine",
"main": "filament.js",
"module": "filament.js",