Compare commits
1 Commits
v1.57.0
...
bjd/fix-gl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9f4433324 |
@@ -7,3 +7,6 @@ for next branch cut* header.
|
||||
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
|
||||
|
||||
## Release notes for next branch cut
|
||||
|
||||
- matdbg: Add support for debugging ESSL 1.0 shaders
|
||||
- backend: New platform API to better handle external textures [⚠️ **New Material Version**]
|
||||
|
||||
@@ -31,7 +31,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.android.filament:filament-android:1.57.0'
|
||||
implementation 'com.google.android.filament:filament-android:1.56.7'
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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.57.0'
|
||||
pod 'Filament', '~> 1.56.7'
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -7,11 +7,6 @@ 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.57.0
|
||||
|
||||
- matdbg: Add support for debugging ESSL 1.0 shaders
|
||||
- backend: New platform API to better handle external textures [⚠️ **New Material Version**]
|
||||
|
||||
## v1.56.8
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
GROUP=com.google.android.filament
|
||||
VERSION_NAME=1.57.0
|
||||
VERSION_NAME=1.56.7
|
||||
|
||||
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
|
||||
|
||||
|
||||
@@ -79,10 +79,6 @@ public:
|
||||
|
||||
void clear() noexcept;
|
||||
void reset(ExternalImage* UTILS_NULLABLE p) noexcept;
|
||||
|
||||
private:
|
||||
friend utils::io::ostream& operator<<(utils::io::ostream& out,
|
||||
ExternalImageHandle const& handle);
|
||||
};
|
||||
|
||||
using ExternalImageHandleRef = ExternalImageHandle const&;
|
||||
@@ -144,13 +140,6 @@ public:
|
||||
* - PlatformEGLAndroid
|
||||
*/
|
||||
bool assertNativeWindowIsValid = false;
|
||||
|
||||
/**
|
||||
* The action to take if a Drawable cannot be acquired. If true, the
|
||||
* frame is aborted instead of panic. This is only supported for:
|
||||
* - PlatformMetal
|
||||
*/
|
||||
bool metalDisablePanicOnDrawableFailure = false;
|
||||
};
|
||||
|
||||
Platform() noexcept;
|
||||
@@ -176,7 +165,7 @@ public:
|
||||
*
|
||||
* @return nullptr on failure, or a pointer to the newly created driver.
|
||||
*/
|
||||
virtual Driver* UTILS_NULLABLE createDriver(void* UTILS_NULLABLE sharedContext,
|
||||
virtual backend::Driver* UTILS_NULLABLE createDriver(void* UTILS_NULLABLE sharedContext,
|
||||
const DriverConfig& driverConfig) noexcept = 0;
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <utils/compiler.h>
|
||||
#include <utils/Invocable.h>
|
||||
#include <utils/CString.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -57,18 +56,6 @@ public:
|
||||
unsigned int id; // GLuint id
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the OpenGL vendor string of the specified Driver instance.
|
||||
* @return The GL_VENDOR string
|
||||
*/
|
||||
static utils::CString getVendorString(Driver const* UTILS_NONNULL driver);
|
||||
|
||||
/**
|
||||
* Return the OpenGL vendor string of the specified Driver instance
|
||||
* @return The GL_RENDERER string
|
||||
*/
|
||||
static utils::CString getRendererString(Driver const* UTILS_NONNULL driver);
|
||||
|
||||
/**
|
||||
* Called by the driver to destroy the OpenGL context. This should clean up any windows
|
||||
* or buffers from initialization. This is for instance where `eglDestroyContext` would be
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#ifndef TNT_FILAMENT_BACKEND_OPENGL_OPENGL_PLATFORM_COCOA_GL_H
|
||||
#define TNT_FILAMENT_BACKEND_OPENGL_OPENGL_PLATFORM_COCOA_GL_H
|
||||
|
||||
#include <backend/DriverEnums.h>
|
||||
#include <backend/platforms/OpenGLPlatform.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -80,7 +80,8 @@ protected:
|
||||
* Initializes EGL, creates the OpenGL context and returns a concrete Driver implementation
|
||||
* that supports OpenGL/OpenGL ES.
|
||||
*/
|
||||
Driver* createDriver(void* sharedContext, const DriverConfig& driverConfig) noexcept override;
|
||||
Driver* createDriver(void* sharedContext,
|
||||
const Platform::DriverConfig& driverConfig) noexcept override;
|
||||
|
||||
/**
|
||||
* This returns zero. This method can be overridden to return something more useful.
|
||||
|
||||
@@ -35,13 +35,12 @@ void Platform::ExternalImageHandle::incref(ExternalImage* p) noexcept {
|
||||
|
||||
void Platform::ExternalImageHandle::decref(ExternalImage* p) noexcept {
|
||||
if (p) {
|
||||
// When decrementing the ref-count, unless it reaches zero, there is no need to acquire
|
||||
// data; we need to release all previous writes though so they can be visible to the thread
|
||||
// that will actually delete the object.
|
||||
// When decrementing the ref-count, unless it reaches zero, there is no need to acquire data; we need to
|
||||
// release all previous writes though so they can be visible to the thread that will actually delete the
|
||||
// object.
|
||||
if (p->mRefCount.fetch_sub(1, std::memory_order_release) == 1) {
|
||||
// if we reach zero, we're about to delete the object, we need to acquire all previous
|
||||
// writes from other threads (i.e.: the memory from other threads prior to the decref()
|
||||
// need to be visible now.
|
||||
// if we reach zero, we're about to delete the object, we need to acquire all previous writes from other
|
||||
// threads (i.e.: the memory from other threads prior to the decref() need to be visible now.
|
||||
std::atomic_thread_fence(std::memory_order_acquire);
|
||||
delete p;
|
||||
}
|
||||
@@ -69,8 +68,7 @@ Platform::ExternalImageHandle::ExternalImageHandle(ExternalImageHandle&& rhs) no
|
||||
rhs.mTarget = nullptr;
|
||||
}
|
||||
|
||||
Platform::ExternalImageHandle& Platform::ExternalImageHandle::operator=(
|
||||
ExternalImageHandle const& rhs) noexcept {
|
||||
Platform::ExternalImageHandle& Platform::ExternalImageHandle::operator=(ExternalImageHandle const& rhs) noexcept {
|
||||
if (UTILS_LIKELY(this != &rhs)) {
|
||||
incref(rhs.mTarget);
|
||||
decref(mTarget);
|
||||
@@ -79,8 +77,7 @@ Platform::ExternalImageHandle& Platform::ExternalImageHandle::operator=(
|
||||
return *this;
|
||||
}
|
||||
|
||||
Platform::ExternalImageHandle& Platform::ExternalImageHandle::operator=(
|
||||
ExternalImageHandle&& rhs) noexcept {
|
||||
Platform::ExternalImageHandle& Platform::ExternalImageHandle::operator=(ExternalImageHandle&& rhs) noexcept {
|
||||
if (UTILS_LIKELY(this != &rhs)) {
|
||||
decref(mTarget);
|
||||
mTarget = rhs.mTarget;
|
||||
@@ -100,12 +97,6 @@ void Platform::ExternalImageHandle::reset(ExternalImage* p) noexcept {
|
||||
mTarget = p;
|
||||
}
|
||||
|
||||
utils::io::ostream& operator<<(utils::io::ostream& out,
|
||||
Platform::ExternalImageHandle const& handle) {
|
||||
out << "ExternalImageHandle{" << handle.mTarget << "}";
|
||||
return out;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Platform::ExternalImage::~ExternalImage() noexcept = default;
|
||||
|
||||
@@ -44,9 +44,6 @@ PlatformMetal::~PlatformMetal() noexcept {
|
||||
}
|
||||
|
||||
Driver* PlatformMetal::createDriver(void* /*sharedContext*/, const Platform::DriverConfig& driverConfig) noexcept {
|
||||
pImpl->mDrawableFailureBehavior = driverConfig.metalDisablePanicOnDrawableFailure
|
||||
? DrawableFailureBehavior::ABORT_FRAME
|
||||
: DrawableFailureBehavior::PANIC;
|
||||
return MetalDriverFactory::create(this, driverConfig);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <backend/DriverEnums.h>
|
||||
#include <backend/Handle.h>
|
||||
|
||||
#include "noop/NoopDriver.h"
|
||||
#include "CommandStreamDispatcher.h"
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ using namespace GLUtils;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
UTILS_NOINLINE
|
||||
OpenGLDriver* OpenGLDriver::create(OpenGLPlatform* const platform,
|
||||
Driver* OpenGLDriver::create(OpenGLPlatform* const platform,
|
||||
void* const sharedGLContext, const Platform::DriverConfig& driverConfig) noexcept {
|
||||
assert_invariant(platform);
|
||||
OpenGLPlatform* const ec = platform;
|
||||
@@ -894,17 +894,6 @@ void OpenGLDriver::createTextureR(Handle<HwTexture> th, SamplerType target, uint
|
||||
if (UTILS_UNLIKELY(t->target == SamplerType::SAMPLER_EXTERNAL)) {
|
||||
t->externalTexture = mPlatform.createExternalImageTexture();
|
||||
if (t->externalTexture) {
|
||||
if (target == SamplerType::SAMPLER_EXTERNAL) {
|
||||
if (UTILS_LIKELY(gl.ext.OES_EGL_image_external_essl3)) {
|
||||
t->externalTexture->target = GL_TEXTURE_EXTERNAL_OES;
|
||||
} else {
|
||||
// revert to texture 2D if external is not supported; what else can we do?
|
||||
t->externalTexture->target = GL_TEXTURE_2D;
|
||||
}
|
||||
} else {
|
||||
t->externalTexture->target = getTextureTargetNotExternal(target);
|
||||
}
|
||||
|
||||
t->gl.target = t->externalTexture->target;
|
||||
t->gl.id = t->externalTexture->id;
|
||||
// internalFormat actually depends on the external image, but it doesn't matter
|
||||
@@ -3500,6 +3489,14 @@ void OpenGLDriver::whenFrameComplete(const std::function<void()>& fn) noexcept {
|
||||
|
||||
void OpenGLDriver::whenGpuCommandsComplete(const std::function<void()>& fn) noexcept {
|
||||
GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
// glFenceSync can return 0 in certain situations. For example, we've seen this happen on Web
|
||||
// when the GL context has been lost.
|
||||
// Unfortunately, there's not much we can do here. The fn callback will never execute, which
|
||||
// could cause issues. If we've lost the WebGL context though, Filament is most likely shutting
|
||||
// down anyway, so in practice this might not be a big problem.
|
||||
if (!sync) {
|
||||
return;
|
||||
}
|
||||
mGpuCommandCompleteOps.emplace_back(sync, fn);
|
||||
CHECK_GL_ERROR(utils::slog.e)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "DriverBase.h"
|
||||
#include "OpenGLContext.h"
|
||||
#include "OpenGLDriverBase.h"
|
||||
#include "OpenGLTimerQuery.h"
|
||||
#include "GLBufferObject.h"
|
||||
#include "GLDescriptorSet.h"
|
||||
@@ -27,10 +26,11 @@
|
||||
#include "GLTexture.h"
|
||||
#include "ShaderCompilerService.h"
|
||||
|
||||
#include <backend/platforms/OpenGLPlatform.h>
|
||||
|
||||
#include <backend/AcquiredImage.h>
|
||||
#include <backend/DriverEnums.h>
|
||||
#include <backend/Handle.h>
|
||||
#include <backend/PipelineState.h>
|
||||
#include <backend/Platform.h>
|
||||
#include <backend/Program.h>
|
||||
#include <backend/TargetBufferInfo.h>
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <utils/bitset.h>
|
||||
#include <utils/FixedCapacityVector.h>
|
||||
#include <utils/compiler.h>
|
||||
#include <utils/CString.h>
|
||||
#include <utils/debug.h>
|
||||
|
||||
#include <math/vec4.h>
|
||||
@@ -75,14 +74,14 @@ class OpenGLProgram;
|
||||
class TimerQueryFactoryInterface;
|
||||
struct PushConstantBundle;
|
||||
|
||||
class OpenGLDriver final : public OpenGLDriverBase {
|
||||
class OpenGLDriver final : public DriverBase {
|
||||
inline explicit OpenGLDriver(OpenGLPlatform* platform,
|
||||
const Platform::DriverConfig& driverConfig) noexcept;
|
||||
~OpenGLDriver() noexcept override;
|
||||
Dispatcher getDispatcher() const noexcept override;
|
||||
~OpenGLDriver() noexcept final;
|
||||
Dispatcher getDispatcher() const noexcept final;
|
||||
|
||||
public:
|
||||
static OpenGLDriver* create(OpenGLPlatform* platform, void* sharedGLContext,
|
||||
static Driver* create(OpenGLPlatform* platform, void* sharedGLContext,
|
||||
const Platform::DriverConfig& driverConfig) noexcept;
|
||||
|
||||
class DebugMarker {
|
||||
@@ -185,7 +184,7 @@ public:
|
||||
std::condition_variable cond;
|
||||
FenceStatus status{ FenceStatus::TIMEOUT_EXPIRED };
|
||||
};
|
||||
std::shared_ptr<State> state{ std::make_shared<State>() };
|
||||
std::shared_ptr<State> state{ std::make_shared<GLFence::State>() };
|
||||
};
|
||||
|
||||
OpenGLDriver(OpenGLDriver const&) = delete;
|
||||
@@ -204,21 +203,13 @@ private:
|
||||
return mShaderCompilerService;
|
||||
}
|
||||
|
||||
ShaderModel getShaderModel() const noexcept override;
|
||||
ShaderLanguage getShaderLanguage() const noexcept override;
|
||||
ShaderModel getShaderModel() const noexcept final;
|
||||
ShaderLanguage getShaderLanguage() const noexcept final;
|
||||
|
||||
/*
|
||||
* OpenGLDriver interface
|
||||
* Driver interface
|
||||
*/
|
||||
|
||||
utils::CString getVendorString() const noexcept override {
|
||||
return utils::CString{ mContext.state.vendor };
|
||||
}
|
||||
|
||||
utils::CString getRendererString() const noexcept override {
|
||||
return utils::CString{ mContext.state.renderer };
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
friend class ConcreteDispatcher;
|
||||
|
||||
@@ -245,21 +236,21 @@ private:
|
||||
}
|
||||
|
||||
template<typename D, typename B, typename ... ARGS>
|
||||
std::enable_if_t<std::is_base_of_v<B, D>, D>*
|
||||
typename std::enable_if<std::is_base_of<B, D>::value, D>::type*
|
||||
construct(Handle<B> const& handle, ARGS&& ... args) {
|
||||
return mHandleAllocator.destroyAndConstruct<D, B>(handle, std::forward<ARGS>(args) ...);
|
||||
}
|
||||
|
||||
template<typename B, typename D,
|
||||
typename = std::enable_if_t<std::is_base_of_v<B, D>, D>>
|
||||
typename = typename std::enable_if<std::is_base_of<B, D>::value, D>::type>
|
||||
void destruct(Handle<B>& handle, D const* p) noexcept {
|
||||
return mHandleAllocator.deallocate(handle, p);
|
||||
}
|
||||
|
||||
template<typename Dp, typename B>
|
||||
std::enable_if_t<
|
||||
typename std::enable_if_t<
|
||||
std::is_pointer_v<Dp> &&
|
||||
std::is_base_of_v<B, std::remove_pointer_t<Dp>>, Dp>
|
||||
std::is_base_of_v<B, typename std::remove_pointer_t<Dp>>, Dp>
|
||||
handle_cast(Handle<B>& handle) {
|
||||
return mHandleAllocator.handle_cast<Dp, B>(handle);
|
||||
}
|
||||
@@ -270,9 +261,9 @@ private:
|
||||
}
|
||||
|
||||
template<typename Dp, typename B>
|
||||
std::enable_if_t<
|
||||
inline typename std::enable_if_t<
|
||||
std::is_pointer_v<Dp> &&
|
||||
std::is_base_of_v<B, std::remove_pointer_t<Dp>>, Dp>
|
||||
std::is_base_of_v<B, typename std::remove_pointer_t<Dp>>, Dp>
|
||||
handle_cast(Handle<B> const& handle) {
|
||||
return mHandleAllocator.handle_cast<Dp, B>(handle);
|
||||
}
|
||||
@@ -312,7 +303,7 @@ private:
|
||||
void renderBufferStorage(GLuint rbo, GLenum internalformat, uint32_t width,
|
||||
uint32_t height, uint8_t samples) const noexcept;
|
||||
|
||||
void textureStorage(GLTexture* t, uint32_t width, uint32_t height,
|
||||
void textureStorage(OpenGLDriver::GLTexture* t, uint32_t width, uint32_t height,
|
||||
uint32_t depth, bool useProtectedMemory) noexcept;
|
||||
|
||||
/* State tracking GL wrappers... */
|
||||
@@ -344,7 +335,7 @@ private:
|
||||
void updateDescriptors(utils::bitset8 invalidDescriptorSets) noexcept;
|
||||
|
||||
struct {
|
||||
DescriptorSetHandle dsh;
|
||||
backend::DescriptorSetHandle dsh;
|
||||
std::array<uint32_t, CONFIG_UNIFORM_BINDING_COUNT> offsets;
|
||||
} mBoundDescriptorSets[MAX_DESCRIPTOR_SET_COUNT];
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2025 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef TNT_FILAMENT_BACKEND_OPENGL_OPENGLDRIVERBASE_H
|
||||
#define TNT_FILAMENT_BACKEND_OPENGL_OPENGLDRIVERBASE_H
|
||||
|
||||
#include "DriverBase.h"
|
||||
|
||||
#include <utils/CString.h>
|
||||
|
||||
namespace filament::backend {
|
||||
|
||||
class OpenGLDriverBase : public DriverBase {
|
||||
protected:
|
||||
~OpenGLDriverBase() override;
|
||||
|
||||
public:
|
||||
virtual utils::CString getVendorString() const noexcept = 0;
|
||||
virtual utils::CString getRendererString() const noexcept = 0;
|
||||
};
|
||||
|
||||
} // filament::backend
|
||||
|
||||
#endif //TNT_FILAMENT_BACKEND_OPENGL_OPENGLDRIVERBASE_H
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include <backend/platforms/OpenGLPlatform.h>
|
||||
|
||||
#include "OpenGLDriverBase.h"
|
||||
#include "OpenGLDriverFactory.h"
|
||||
|
||||
#include <backend/AcquiredImage.h>
|
||||
@@ -24,45 +23,21 @@
|
||||
#include <backend/Platform.h>
|
||||
|
||||
#include <utils/compiler.h>
|
||||
#include <utils/Panic.h>
|
||||
#include <utils/CString.h>
|
||||
#include <utils/Invocable.h>
|
||||
|
||||
#include <utils/Invocable.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "OpenGLDriver.h"
|
||||
|
||||
namespace filament::backend {
|
||||
|
||||
OpenGLDriverBase::~OpenGLDriverBase() = default;
|
||||
|
||||
Driver* OpenGLPlatform::createDefaultDriver(OpenGLPlatform* platform,
|
||||
void* sharedContext, const DriverConfig& driverConfig) {
|
||||
void* sharedContext, const Platform::DriverConfig& driverConfig) {
|
||||
return OpenGLDriverFactory::create(platform, sharedContext, driverConfig);
|
||||
}
|
||||
|
||||
OpenGLPlatform::~OpenGLPlatform() noexcept = default;
|
||||
|
||||
utils::CString OpenGLPlatform::getVendorString(Driver const* driver) {
|
||||
auto const p = static_cast<OpenGLDriverBase const*>(driver);
|
||||
#if UTILS_HAS_RTTI
|
||||
FILAMENT_CHECK_POSTCONDITION(dynamic_cast<OpenGLDriverBase const*>(driver))
|
||||
<< "Driver* has not been allocated with OpenGLPlatform";
|
||||
#endif
|
||||
return p->getVendorString();
|
||||
}
|
||||
|
||||
utils::CString OpenGLPlatform::getRendererString(Driver const* driver) {
|
||||
auto const p = static_cast<OpenGLDriverBase const*>(driver);
|
||||
#if UTILS_HAS_RTTI
|
||||
FILAMENT_CHECK_POSTCONDITION(dynamic_cast<OpenGLDriverBase const*>(driver))
|
||||
<< "Driver* has not been allocated with OpenGLPlatform";
|
||||
#endif
|
||||
return p->getRendererString();
|
||||
}
|
||||
|
||||
void OpenGLPlatform::makeCurrent(SwapChain* drawSwapChain, SwapChain* readSwapChain,
|
||||
utils::Invocable<void()>, utils::Invocable<void(size_t)>) noexcept {
|
||||
makeCurrent(getCurrentContextType(), drawSwapChain, readSwapChain);
|
||||
|
||||
@@ -297,7 +297,7 @@ Driver* PlatformEGL::createDriver(void* sharedContext, const DriverConfig& drive
|
||||
clearGlError();
|
||||
|
||||
// success!!
|
||||
return createDefaultDriver(this, sharedContext, driverConfig);
|
||||
return OpenGLPlatform::createDefaultDriver(this, sharedContext, driverConfig);
|
||||
|
||||
error:
|
||||
// if we're here, we've failed
|
||||
@@ -551,7 +551,7 @@ Platform::SwapChain* PlatformEGL::createSwapChain(
|
||||
return sc;
|
||||
}
|
||||
|
||||
void PlatformEGL::destroySwapChain(SwapChain* swapChain) noexcept {
|
||||
void PlatformEGL::destroySwapChain(Platform::SwapChain* swapChain) noexcept {
|
||||
if (swapChain) {
|
||||
SwapChainEGL const* const sc = static_cast<SwapChainEGL const*>(swapChain);
|
||||
if (sc->sur != EGL_NO_SURFACE) {
|
||||
@@ -564,7 +564,7 @@ void PlatformEGL::destroySwapChain(SwapChain* swapChain) noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
bool PlatformEGL::isSwapChainProtected(SwapChain* swapChain) noexcept {
|
||||
bool PlatformEGL::isSwapChainProtected(Platform::SwapChain* swapChain) noexcept {
|
||||
if (swapChain) {
|
||||
SwapChainEGL const* const sc = static_cast<SwapChainEGL const*>(swapChain);
|
||||
return bool(sc->flags & SWAP_CHAIN_CONFIG_PROTECTED_CONTENT);
|
||||
@@ -585,10 +585,10 @@ bool PlatformEGL::makeCurrent(ContextType type,
|
||||
return success == EGL_TRUE ? true : false;
|
||||
}
|
||||
|
||||
void PlatformEGL::makeCurrent(SwapChain* drawSwapChain,
|
||||
SwapChain* readSwapChain,
|
||||
Invocable<void()> preContextChange,
|
||||
Invocable<void(size_t index)> postContextChange) noexcept {
|
||||
void PlatformEGL::makeCurrent(Platform::SwapChain* drawSwapChain,
|
||||
Platform::SwapChain* readSwapChain,
|
||||
utils::Invocable<void()> preContextChange,
|
||||
utils::Invocable<void(size_t index)> postContextChange) noexcept {
|
||||
|
||||
assert_invariant(drawSwapChain);
|
||||
assert_invariant(readSwapChain);
|
||||
@@ -647,7 +647,7 @@ void PlatformEGL::makeCurrent(SwapChain* drawSwapChain,
|
||||
}
|
||||
}
|
||||
|
||||
void PlatformEGL::commit(SwapChain* swapChain) noexcept {
|
||||
void PlatformEGL::commit(Platform::SwapChain* swapChain) noexcept {
|
||||
if (swapChain) {
|
||||
SwapChainEGL const* const sc = static_cast<SwapChainEGL const*>(swapChain);
|
||||
if (sc->sur != EGL_NO_SURFACE) {
|
||||
@@ -670,7 +670,7 @@ Platform::Fence* PlatformEGL::createFence() noexcept {
|
||||
return f;
|
||||
}
|
||||
|
||||
void PlatformEGL::destroyFence(Fence* fence) noexcept {
|
||||
void PlatformEGL::destroyFence(Platform::Fence* fence) noexcept {
|
||||
#ifdef EGL_KHR_reusable_sync
|
||||
EGLSyncKHR sync = (EGLSyncKHR) fence;
|
||||
if (sync != EGL_NO_SYNC_KHR) {
|
||||
@@ -680,7 +680,7 @@ void PlatformEGL::destroyFence(Fence* fence) noexcept {
|
||||
}
|
||||
|
||||
FenceStatus PlatformEGL::waitFence(
|
||||
Fence* fence, uint64_t timeout) noexcept {
|
||||
Platform::Fence* fence, uint64_t timeout) noexcept {
|
||||
#ifdef EGL_KHR_reusable_sync
|
||||
EGLSyncKHR sync = (EGLSyncKHR) fence;
|
||||
if (sync != EGL_NO_SYNC_KHR) {
|
||||
@@ -746,7 +746,7 @@ void PlatformEGL::initializeGlExtensions() noexcept {
|
||||
ext.gl.OES_EGL_image_external_essl3 = glExtensions.has("GL_OES_EGL_image_external_essl3");
|
||||
}
|
||||
|
||||
EGLContext PlatformEGL::getContextForType(ContextType type) const noexcept {
|
||||
EGLContext PlatformEGL::getContextForType(OpenGLPlatform::ContextType type) const noexcept {
|
||||
switch (type) {
|
||||
case ContextType::NONE:
|
||||
return EGL_NO_CONTEXT;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#ifndef TNT_FILAMENT_ENGINE_H
|
||||
#define TNT_FILAMENT_ENGINE_H
|
||||
|
||||
|
||||
#include <filament/FilamentAPI.h>
|
||||
|
||||
#include <backend/DriverEnums.h>
|
||||
@@ -33,7 +32,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
namespace utils {
|
||||
class Entity;
|
||||
class EntityManager;
|
||||
@@ -42,10 +40,6 @@ class JobSystem;
|
||||
|
||||
namespace filament {
|
||||
|
||||
namespace backend {
|
||||
class Driver;
|
||||
} // backend
|
||||
|
||||
class BufferObject;
|
||||
class Camera;
|
||||
class ColorGrading;
|
||||
@@ -189,7 +183,6 @@ public:
|
||||
using DriverConfig = backend::Platform::DriverConfig;
|
||||
using FeatureLevel = backend::FeatureLevel;
|
||||
using StereoscopicType = backend::StereoscopicType;
|
||||
using Driver = backend::Driver;
|
||||
|
||||
/**
|
||||
* Config is used to define the memory footprint used by the engine, such as the
|
||||
@@ -317,15 +310,6 @@ public:
|
||||
*/
|
||||
size_t metalUploadBufferSizeBytes = 512 * 1024;
|
||||
|
||||
/**
|
||||
* The action to take if a Drawable cannot be acquired.
|
||||
*
|
||||
* Each frame rendered requires a CAMetalDrawable texture, which is
|
||||
* presented on-screen at the completion of each frame. These are
|
||||
* limited and provided round-robin style by the system.
|
||||
*/
|
||||
bool metalDisablePanicOnDrawableFailure = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to forcibly disable parallel shader compilation in the backend.
|
||||
* Currently only honored by the GL and Metal backends.
|
||||
@@ -598,11 +582,6 @@ public:
|
||||
static Engine* UTILS_NULLABLE getEngine(void* UTILS_NONNULL token);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @return the Driver instance used by this Engine.
|
||||
* @see OpenGLPlatform
|
||||
*/
|
||||
backend::Driver const* UTILS_NONNULL getDriver() const noexcept;
|
||||
|
||||
/**
|
||||
* Destroy the Engine instance and all associated resources.
|
||||
|
||||
@@ -68,10 +68,6 @@ Engine* Engine::getEngine(void* token) {
|
||||
}
|
||||
#endif
|
||||
|
||||
Driver const* Engine::getDriver() const noexcept {
|
||||
return std::addressof(downcast(this)->getDriver());
|
||||
}
|
||||
|
||||
void Engine::destroy(Engine** pEngine) {
|
||||
if (pEngine) {
|
||||
Engine* engine = *pEngine;
|
||||
|
||||
@@ -123,7 +123,6 @@ Engine* FEngine::create(Builder const& builder) {
|
||||
.forceGLES2Context = instance->getConfig().forceGLES2Context,
|
||||
.stereoscopicType = instance->getConfig().stereoscopicType,
|
||||
.assertNativeWindowIsValid = instance->features.backend.opengl.assert_native_window_is_valid,
|
||||
.metalDisablePanicOnDrawableFailure = instance->getConfig().metalDisablePanicOnDrawableFailure,
|
||||
};
|
||||
instance->mDriver = platform->createDriver(sharedContext, driverConfig);
|
||||
|
||||
@@ -718,7 +717,6 @@ int FEngine::loop() {
|
||||
.forceGLES2Context = mConfig.forceGLES2Context,
|
||||
.stereoscopicType = mConfig.stereoscopicType,
|
||||
.assertNativeWindowIsValid = features.backend.opengl.assert_native_window_is_valid,
|
||||
.metalDisablePanicOnDrawableFailure = mConfig.metalDisablePanicOnDrawableFailure,
|
||||
};
|
||||
mDriver = mPlatform->createDriver(mSharedGLContext, driverConfig);
|
||||
|
||||
|
||||
@@ -61,8 +61,6 @@
|
||||
#include <filament/Texture.h>
|
||||
#include <filament/VertexBuffer.h>
|
||||
|
||||
#include <backend/DriverEnums.h>
|
||||
|
||||
#include <utils/Allocator.h>
|
||||
#include <utils/compiler.h>
|
||||
#include <utils/CountDownLatch.h>
|
||||
@@ -124,11 +122,12 @@ class ResourceAllocator;
|
||||
*/
|
||||
class FEngine : public Engine {
|
||||
public:
|
||||
void* operator new(std::size_t const size) noexcept {
|
||||
|
||||
inline void* operator new(std::size_t const size) noexcept {
|
||||
return utils::aligned_alloc(size, alignof(FEngine));
|
||||
}
|
||||
|
||||
void operator delete(void* p) noexcept {
|
||||
inline void operator delete(void* p) noexcept {
|
||||
utils::aligned_free(p);
|
||||
}
|
||||
|
||||
@@ -491,7 +490,7 @@ public:
|
||||
backend::Handle<backend::HwTexture> getOneTextureArray() const { return mDummyOneTextureArray; }
|
||||
backend::Handle<backend::HwTexture> getZeroTextureArray() const { return mDummyZeroTextureArray; }
|
||||
|
||||
static constexpr size_t MiB = 1024u * 1024u;
|
||||
static constexpr const size_t MiB = 1024u * 1024u;
|
||||
size_t getMinCommandBufferSize() const noexcept { return mConfig.minCommandBufferSizeMB * MiB; }
|
||||
size_t getCommandBufferSize() const noexcept { return mConfig.commandBufferSizeMB * MiB; }
|
||||
size_t getPerFrameCommandsSize() const noexcept { return mConfig.perFrameCommandsSizeMB * MiB; }
|
||||
@@ -511,8 +510,6 @@ public:
|
||||
void resetBackendState() noexcept;
|
||||
#endif
|
||||
|
||||
backend::Driver& getDriver() const noexcept { return *mDriver; }
|
||||
|
||||
private:
|
||||
explicit FEngine(Builder const& builder);
|
||||
void init();
|
||||
@@ -521,6 +518,8 @@ private:
|
||||
int loop();
|
||||
void flushCommandBuffer(backend::CommandBufferQueue& commandBufferQueue);
|
||||
|
||||
backend::Driver& getDriver() const noexcept { return *mDriver; }
|
||||
|
||||
template<typename T>
|
||||
bool isValid(const T* ptr, ResourceList<T> const& list) const;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = "Filament"
|
||||
spec.version = "1.57.0"
|
||||
spec.version = "1.56.7"
|
||||
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.57.0/filament-v1.57.0-ios.tgz" }
|
||||
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.56.7/filament-v1.56.7-ios.tgz" }
|
||||
|
||||
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
|
||||
spec.pod_target_xcconfig = {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
namespace filament {
|
||||
|
||||
// update this when a new version of filament wouldn't work with older materials
|
||||
static constexpr size_t MATERIAL_VERSION = 57;
|
||||
static constexpr size_t MATERIAL_VERSION = 56;
|
||||
|
||||
/**
|
||||
* Supported shading models
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "filament",
|
||||
"version": "1.57.0",
|
||||
"version": "1.56.7",
|
||||
"description": "Real-time physically based rendering engine",
|
||||
"main": "filament.js",
|
||||
"module": "filament.js",
|
||||
|
||||
Reference in New Issue
Block a user