Skip to content

Commit

Permalink
v1.50.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefterv committed Mar 12, 2024
1 parent 0a5b060 commit 7002730
Show file tree
Hide file tree
Showing 35 changed files with 136 additions and 32 deletions.
Binary file modified lib/libbackend.xcframework/ios-arm64/libbackend.a
Binary file not shown.
Binary file not shown.
Binary file modified lib/libcamutils.xcframework/ios-arm64/libcamutils.a
Binary file not shown.
Binary file modified lib/libcivetweb.xcframework/ios-arm64/libcivetweb.a
Binary file not shown.
Binary file modified lib/libdracodec.xcframework/ios-arm64/libdracodec.a
Binary file not shown.
Binary file modified lib/libfilabridge.xcframework/ios-arm64/libfilabridge.a
Binary file not shown.
Binary file modified lib/libfilaflat.xcframework/ios-arm64/libfilaflat.a
Binary file not shown.
Binary file modified lib/libfilamat.xcframework/ios-arm64/libfilamat.a
Binary file not shown.
Binary file not shown.
36 changes: 25 additions & 11 deletions lib/libfilament.xcframework/ios-arm64/Headers/backend/DriverEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ static constexpr uint64_t SWAP_CHAIN_CONFIG_SRGB_COLORSPACE = 0x10;
/**
* Indicates that the SwapChain should also contain a stencil component.
*/
static constexpr uint64_t SWAP_CHAIN_HAS_STENCIL_BUFFER = 0x20;
static constexpr uint64_t SWAP_CHAIN_CONFIG_HAS_STENCIL_BUFFER = 0x20;
static constexpr uint64_t SWAP_CHAIN_HAS_STENCIL_BUFFER = SWAP_CHAIN_CONFIG_HAS_STENCIL_BUFFER;

/**
* The SwapChain contains protected content. Currently only supported by OpenGLPlatform and
* only when OpenGLPlatform::isProtectedContextSupported() is true.
*/
static constexpr uint64_t SWAP_CHAIN_CONFIG_PROTECTED_CONTENT = 0x40;


static constexpr size_t MAX_VERTEX_ATTRIBUTE_COUNT = 16; // This is guaranteed by OpenGL ES.
Expand Down Expand Up @@ -129,6 +136,12 @@ enum class Backend : uint8_t {
NOOP = 4, //!< Selects the no-op driver for testing purposes.
};

enum class TimerQueryResult : int8_t {
ERROR = -1, // an error occurred, result won't be available
NOT_READY = 0, // result to ready yet
AVAILABLE = 1, // result is available
};

static constexpr const char* backendToString(Backend backend) {
switch (backend) {
case Backend::NOOP:
Expand Down Expand Up @@ -659,16 +672,17 @@ enum class TextureFormat : uint16_t {
};

//! Bitmask describing the intended Texture Usage
enum class TextureUsage : uint8_t {
NONE = 0x00,
COLOR_ATTACHMENT = 0x01, //!< Texture can be used as a color attachment
DEPTH_ATTACHMENT = 0x02, //!< Texture can be used as a depth attachment
STENCIL_ATTACHMENT = 0x04, //!< Texture can be used as a stencil attachment
UPLOADABLE = 0x08, //!< Data can be uploaded into this texture (default)
SAMPLEABLE = 0x10, //!< Texture can be sampled (default)
SUBPASS_INPUT = 0x20, //!< Texture can be used as a subpass input
BLIT_SRC = 0x40, //!< Texture can be used the source of a blit()
BLIT_DST = 0x80, //!< Texture can be used the destination of a blit()
enum class TextureUsage : uint16_t {
NONE = 0x0000,
COLOR_ATTACHMENT = 0x0001, //!< Texture can be used as a color attachment
DEPTH_ATTACHMENT = 0x0002, //!< Texture can be used as a depth attachment
STENCIL_ATTACHMENT = 0x0004, //!< Texture can be used as a stencil attachment
UPLOADABLE = 0x0008, //!< Data can be uploaded into this texture (default)
SAMPLEABLE = 0x0010, //!< Texture can be sampled (default)
SUBPASS_INPUT = 0x0020, //!< Texture can be used as a subpass input
BLIT_SRC = 0x0040, //!< Texture can be used the source of a blit()
BLIT_DST = 0x0080, //!< Texture can be used the destination of a blit()
PROTECTED = 0x0100, //!< Texture can be used the destination of a blit()
DEFAULT = UPLOADABLE | SAMPLEABLE //!< Default texture usage
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include <backend/Platform.h>

#include <utils/compiler.h>
#include <utils/Invocable.h>

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

namespace filament::backend {
Expand Down Expand Up @@ -62,6 +64,22 @@ class OpenGLPlatform : public Platform {
*/
virtual void terminate() noexcept = 0;

/**
* Return whether createSwapChain supports the SWAP_CHAIN_CONFIG_SRGB_COLORSPACE flag.
* The default implementation returns false.
*
* @return true if SWAP_CHAIN_CONFIG_SRGB_COLORSPACE is supported, false otherwise.
*/
virtual bool isSRGBSwapChainSupported() const noexcept;

/**
* Return whether protected contexts are supported by this backend.
* If protected context are supported, the SWAP_CHAIN_CONFIG_PROTECTED_CONTENT flag can be
* used when creating a SwapChain.
* The default implementation returns false.
*/
virtual bool isProtectedContextSupported() const noexcept;

/**
* Called by the driver to create a SwapChain for this driver.
*
Expand All @@ -74,14 +92,6 @@ class OpenGLPlatform : public Platform {
virtual SwapChain* UTILS_NONNULL createSwapChain(
void* UTILS_NULLABLE nativeWindow, uint64_t flags) noexcept = 0;

/**
* Return whether createSwapChain supports the SWAP_CHAIN_CONFIG_SRGB_COLORSPACE flag.
* The default implementation returns false.
*
* @return true if SWAP_CHAIN_CONFIG_SRGB_COLORSPACE is supported, false otherwise.
*/
virtual bool isSRGBSwapChainSupported() const noexcept;

/**
* Called by the driver create a headless SwapChain.
*
Expand Down Expand Up @@ -131,6 +141,26 @@ class OpenGLPlatform : public Platform {
SwapChain* UTILS_NONNULL drawSwapChain,
SwapChain* UTILS_NONNULL readSwapChain) noexcept = 0;

/**
* Called by the driver to make the OpenGL context active on the calling thread and bind
* the drawSwapChain to the default render target (FBO) created with createDefaultRenderTarget.
* The context used is either the default context or the protected context. When a context
* change is necessary, the preContextChange and postContextChange callbacks are called,
* before and after the context change respectively. postContextChange is given the index
* of the new context (0 for default and 1 for protected).
* The default implementation just calls makeCurrent(SwapChain*, SwapChain*).
*
* @param drawSwapChain SwapChain to draw to. It must be bound to the default FBO.
* @param readSwapChain SwapChain to read from (for operation like `glBlitFramebuffer`)
* @param preContextChange called before the context changes
* @param postContextChange called after the context changes
*/
virtual void makeCurrent(
SwapChain* UTILS_NONNULL drawSwapChain,
SwapChain* UTILS_NONNULL readSwapChain,
utils::Invocable<void()> preContextChange,
utils::Invocable<void(size_t index)> postContextChange) noexcept;

/**
* Called by the driver once the current frame finishes drawing. Typically, this should present
* the drawSwapChain. This is for example where `eglMakeCurrent()` would be called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <EGL/eglext.h>
#include <EGL/eglplatform.h>

#include <utils/Invocable.h>

#include <initializer_list>
#include <utility>
#include <vector>
Expand All @@ -41,15 +43,11 @@ class PlatformEGL : public OpenGLPlatform {
public:

PlatformEGL() noexcept;
bool isExtraContextSupported() const noexcept override;
void createContext(bool shared) override;
void releaseContext() noexcept override;

// Return true if we're on an OpenGL platform (as opposed to OpenGL ES). false by default.
virtual bool isOpenGL() const noexcept;

protected:

// --------------------------------------------------------------------------------------------
// Helper for EGL configs and attributes parameters

Expand Down Expand Up @@ -89,13 +87,23 @@ class PlatformEGL : public OpenGLPlatform {
// --------------------------------------------------------------------------------------------
// OpenGLPlatform Interface

bool isExtraContextSupported() const noexcept override;
void createContext(bool shared) override;
void releaseContext() noexcept override;

void terminate() noexcept override;

bool isProtectedContextSupported() const noexcept override;

bool isSRGBSwapChainSupported() const noexcept override;
SwapChain* createSwapChain(void* nativewindow, uint64_t flags) noexcept override;
SwapChain* createSwapChain(uint32_t width, uint32_t height, uint64_t flags) noexcept override;
void destroySwapChain(SwapChain* swapChain) noexcept override;

void makeCurrent(SwapChain* drawSwapChain, SwapChain* readSwapChain) noexcept override;
void makeCurrent(SwapChain* drawSwapChain, SwapChain* readSwapChain,
utils::Invocable<void()> preContextChange,
utils::Invocable<void(size_t index)> postContextChange) noexcept override;
void commit(SwapChain* swapChain) noexcept override;

bool canCreateFence() noexcept override;
Expand All @@ -122,15 +130,22 @@ class PlatformEGL : public OpenGLPlatform {
static void clearGlError() noexcept;

/**
* Always use this instead of eglMakeCurrent().
* Always use this instead of eglMakeCurrent(), as it tracks some state.
*/
EGLBoolean makeCurrent(EGLSurface drawSurface, EGLSurface readSurface) noexcept;

/**
* Returns true if the swapchain is protected
*/
static bool isSwapChainProtected(Platform::SwapChain const* swapChain) noexcept;

// TODO: this should probably use getters instead.
EGLDisplay mEGLDisplay = EGL_NO_DISPLAY;
EGLContext mEGLContext = EGL_NO_CONTEXT;
EGLContext mEGLContextProtected = EGL_NO_CONTEXT;
EGLSurface mCurrentDrawSurface = EGL_NO_SURFACE;
EGLSurface mCurrentReadSurface = EGL_NO_SURFACE;
EGLContext mCurrentContext = EGL_NO_CONTEXT;
EGLSurface mEGLDummySurface = EGL_NO_SURFACE;
// mEGLConfig is valid only if ext.egl.KHR_no_config_context is false
EGLConfig mEGLConfig = EGL_NO_CONFIG_KHR;
Expand All @@ -148,6 +163,7 @@ class PlatformEGL : public OpenGLPlatform {
bool KHR_gl_colorspace = false;
bool KHR_no_config_context = false;
bool KHR_surfaceless_context = false;
bool EXT_protected_content = false;
} egl;
} ext;

Expand All @@ -156,12 +172,17 @@ class PlatformEGL : public OpenGLPlatform {
Config attribs{};
EGLNativeWindowType nativeWindow{};
EGLConfig config{};
uint64_t flags{};
};

void initializeGlExtensions() noexcept;

protected:
EGLConfig findSwapChainConfig(uint64_t flags, bool window, bool pbuffer) const;

private:
EGLBoolean makeCurrent(EGLContext context,
EGLSurface drawSurface, EGLSurface readSurface) noexcept;
};

} // namespace filament::backend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class UTILS_PUBLIC MaterialBuilder : public MaterialBuilderBase {
using Precision = filament::backend::Precision;
using CullingMode = filament::backend::CullingMode;
using FeatureLevel = filament::backend::FeatureLevel;
using StereoscopicType = filament::backend::StereoscopicType;

enum class VariableQualifier : uint8_t {
OUT
Expand Down Expand Up @@ -521,6 +522,12 @@ class UTILS_PUBLIC MaterialBuilder : public MaterialBuilderBase {
//! Specifies how transparent objects should be rendered (default is DEFAULT).
MaterialBuilder& transparencyMode(TransparencyMode mode) noexcept;

//! Specify the stereoscopic type (default is INSTANCED)
MaterialBuilder& stereoscopicType(StereoscopicType stereoscopicType) noexcept;

//! Specify the number of eyes for stereoscopic rendering
MaterialBuilder& stereoscopicEyeCount(uint8_t eyeCount) noexcept;

/**
* Enable / disable custom surface shading. Custom surface shading requires the LIT
* shading model. In addition, the following function must be defined in the fragment
Expand Down Expand Up @@ -829,6 +836,8 @@ class UTILS_PUBLIC MaterialBuilder : public MaterialBuilderBase {
Interpolation mInterpolation = Interpolation::SMOOTH;
VertexDomain mVertexDomain = VertexDomain::OBJECT;
TransparencyMode mTransparencyMode = TransparencyMode::DEFAULT;
StereoscopicType mStereoscopicType = StereoscopicType::INSTANCED;
uint8_t mStereoscopicEyeCount = 2;

filament::AttributeBitset mRequiredAttributes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,14 @@ class UTILS_PUBLIC Engine {
uint8_t stereoscopicEyeCount = 2;

/*
* Size in MiB of the frame graph texture cache. This should be adjusted based on the
* size of used render targets (typically the screen).
* @deprecated This value is no longer used.
*/
uint32_t resourceAllocatorCacheSizeMB = 64;

/*
* This value determines for how many frames are texture entries kept in the cache.
* The default value of 30 corresponds to about half a second at 60 fps.
*/
uint32_t resourceAllocatorCacheMaxAge = 30;
uint32_t resourceAllocatorCacheMaxAge = 2;
};


Expand Down
35 changes: 32 additions & 3 deletions lib/libfilament.xcframework/ios-arm64/Headers/filament/SwapChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,29 @@ class UTILS_PUBLIC SwapChain : public FilamentAPI {
* @see View.setStencilBufferEnabled
* @see View.setPostProcessingEnabled
*/
static constexpr uint64_t CONFIG_HAS_STENCIL_BUFFER = backend::SWAP_CHAIN_HAS_STENCIL_BUFFER;
static constexpr uint64_t CONFIG_HAS_STENCIL_BUFFER = backend::SWAP_CHAIN_CONFIG_HAS_STENCIL_BUFFER;

/**
* Return whether createSwapChain supports the SWAP_CHAIN_CONFIG_SRGB_COLORSPACE flag.
* The SwapChain contains protected content. Only supported when isProtectedContentSupported()
* is true.
*/
static constexpr uint64_t CONFIG_PROTECTED_CONTENT = backend::SWAP_CHAIN_CONFIG_PROTECTED_CONTENT;

/**
* Return whether createSwapChain supports the CONFIG_PROTECTED_CONTENT flag.
* The default implementation returns false.
*
* @param engine A pointer to the filament Engine
* @return true if SWAP_CHAIN_CONFIG_SRGB_COLORSPACE is supported, false otherwise.
* @return true if CONFIG_PROTECTED_CONTENT is supported, false otherwise.
*/
static bool isProtectedContentSupported(Engine& engine) noexcept;

/**
* Return whether createSwapChain supports the CONFIG_SRGB_COLORSPACE flag.
* The default implementation returns false.
*
* @param engine A pointer to the filament Engine
* @return true if CONFIG_SRGB_COLORSPACE is supported, false otherwise.
*/
static bool isSRGBSwapChainSupported(Engine& engine) noexcept;

Expand All @@ -253,6 +268,10 @@ class UTILS_PUBLIC SwapChain : public FilamentAPI {
* automatically schedule itself for presentation. Instead, the application must call the
* PresentCallable passed to the FrameScheduledCallback.
*
* There may be only one FrameScheduledCallback set per SwapChain. A call to
* SwapChain::setFrameScheduledCallback will overwrite any previous FrameScheduledCallbacks set
* on the same SwapChain.
*
* If your application delays the call to the PresentCallable by, for example, calling it on a
* separate thread, you must ensure all PresentCallables have been called before shutting down
* the Filament Engine. You can do this by issuing an Engine::flushAndWait before calling
Expand All @@ -272,6 +291,16 @@ class UTILS_PUBLIC SwapChain : public FilamentAPI {
void setFrameScheduledCallback(FrameScheduledCallback UTILS_NULLABLE callback,
void* UTILS_NULLABLE user = nullptr);

/**
* Returns the SwapChain::FrameScheduledCallback that was previously set with
* SwapChain::setFrameScheduledCallback, or nullptr if one is not set.
*
* @return the previously-set FrameScheduledCallback, or nullptr
*
* @see SwapChain::setFrameCompletedCallback
*/
UTILS_NULLABLE FrameScheduledCallback getFrameScheduledCallback() const noexcept;

/**
* FrameCompletedCallback is a callback function that notifies an application when a frame's
* contents have completed rendering on the GPU.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ class UTILS_PUBLIC Texture : public FilamentAPI {
/** @return whether a backend supports a particular format. */
static bool isTextureFormatSupported(Engine& engine, InternalFormat format) noexcept;

/** @return whether this backend supports protected textures. */
static bool isProtectedTexturesSupported(Engine& engine) noexcept;

/** @return whether a backend supports texture swizzling. */
static bool isTextureSwizzleSupported(Engine& engine) noexcept;

Expand Down
Binary file modified lib/libfilament.xcframework/ios-arm64/libfilament.a
Binary file not shown.
Binary file modified lib/libfilameshio.xcframework/ios-arm64/libfilameshio.a
Binary file not shown.
Binary file modified lib/libgltfio_core.xcframework/ios-arm64/libgltfio_core.a
Binary file not shown.
Binary file modified lib/libibl-lite.xcframework/ios-arm64/libibl-lite.a
Binary file not shown.
Binary file modified lib/libibl.xcframework/ios-arm64/libibl.a
Binary file not shown.
Binary file modified lib/libimage.xcframework/ios-arm64/libimage.a
Binary file not shown.
Binary file modified lib/libktxreader.xcframework/ios-arm64/libktxreader.a
Binary file not shown.
Binary file modified lib/libmeshoptimizer.xcframework/ios-arm64/libmeshoptimizer.a
Binary file not shown.
Binary file modified lib/libmikktspace.xcframework/ios-arm64/libmikktspace.a
Binary file not shown.
Binary file modified lib/libshaders.xcframework/ios-arm64/libshaders.a
Binary file not shown.
Binary file modified lib/libsmol-v.xcframework/ios-arm64/libsmol-v.a
Binary file not shown.
Binary file modified lib/libstb.xcframework/ios-arm64/libstb.a
Binary file not shown.
Binary file modified lib/libuberarchive.xcframework/ios-arm64/libuberarchive.a
Binary file not shown.
Binary file modified lib/libuberzlib.xcframework/ios-arm64/libuberzlib.a
Binary file not shown.
Binary file modified lib/libutils.xcframework/ios-arm64/libutils.a
Binary file not shown.
Binary file modified lib/libviewer.xcframework/ios-arm64/libviewer.a
Binary file not shown.
Binary file modified lib/libvkshaders.xcframework/ios-arm64/libvkshaders.a
Binary file not shown.
Binary file modified lib/libzstd.xcframework/ios-arm64/libzstd.a
Binary file not shown.
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

VERSION="1.50.5"
VERSION="1.50.6"
TYPE=${1:-"release"}

if [ ! -d "filament" ]
Expand Down

0 comments on commit 7002730

Please sign in to comment.