update Filament headers to v1.58.0

This commit is contained in:
Nick Fisher
2025-03-17 16:38:52 +08:00
parent 20ea43a809
commit f923b94b84
56 changed files with 3234 additions and 215 deletions

View File

@@ -56,35 +56,35 @@ class UTILS_PUBLIC MaterialInstance : public FilamentAPI {
};
public:
using CullingMode = filament::backend::CullingMode;
using TransparencyMode = filament::TransparencyMode;
using DepthFunc = filament::backend::SamplerCompareFunc;
using StencilCompareFunc = filament::backend::SamplerCompareFunc;
using StencilOperation = filament::backend::StencilOperation;
using StencilFace = filament::backend::StencilFace;
using CullingMode = backend::CullingMode;
using TransparencyMode = TransparencyMode;
using DepthFunc = backend::SamplerCompareFunc;
using StencilCompareFunc = backend::SamplerCompareFunc;
using StencilOperation = backend::StencilOperation;
using StencilFace = backend::StencilFace;
template<typename T>
using is_supported_parameter_t = typename std::enable_if<
std::is_same<float, T>::value ||
std::is_same<int32_t, T>::value ||
std::is_same<uint32_t, T>::value ||
std::is_same<math::int2, T>::value ||
std::is_same<math::int3, T>::value ||
std::is_same<math::int4, T>::value ||
std::is_same<math::uint2, T>::value ||
std::is_same<math::uint3, T>::value ||
std::is_same<math::uint4, T>::value ||
std::is_same<math::float2, T>::value ||
std::is_same<math::float3, T>::value ||
std::is_same<math::float4, T>::value ||
std::is_same<math::mat4f, T>::value ||
using is_supported_parameter_t = std::enable_if_t<
std::is_same_v<float, T> ||
std::is_same_v<int32_t, T> ||
std::is_same_v<uint32_t, T> ||
std::is_same_v<math::int2, T> ||
std::is_same_v<math::int3, T> ||
std::is_same_v<math::int4, T> ||
std::is_same_v<math::uint2, T> ||
std::is_same_v<math::uint3, T> ||
std::is_same_v<math::uint4, T> ||
std::is_same_v<math::float2, T> ||
std::is_same_v<math::float3, T> ||
std::is_same_v<math::float4, T> ||
std::is_same_v<math::mat4f, T> ||
// these types are slower as they need a layout conversion
std::is_same<bool, T>::value ||
std::is_same<math::bool2, T>::value ||
std::is_same<math::bool3, T>::value ||
std::is_same<math::bool4, T>::value ||
std::is_same<math::mat3f, T>::value
>::type;
std::is_same_v<bool, T> ||
std::is_same_v<math::bool2, T> ||
std::is_same_v<math::bool3, T> ||
std::is_same_v<math::bool4, T> ||
std::is_same_v<math::mat3f, T>
>;
/**
* Creates a new MaterialInstance using another MaterialInstance as a template for initialization.
@@ -121,13 +121,13 @@ public:
/** inline helper to provide the name as a null-terminated string literal */
template<typename T, typename = is_supported_parameter_t<T>>
inline void setParameter(StringLiteral name, T const& value) {
void setParameter(StringLiteral const name, T const& value) {
setParameter<T>(name.data, name.size, value);
}
/** inline helper to provide the name as a null-terminated C string */
template<typename T, typename = is_supported_parameter_t<T>>
inline void setParameter(const char* UTILS_NONNULL name, T const& value) {
void setParameter(const char* UTILS_NONNULL name, T const& value) {
setParameter<T>(name, strlen(name), value);
}
@@ -148,14 +148,14 @@ public:
/** inline helper to provide the name as a null-terminated string literal */
template<typename T, typename = is_supported_parameter_t<T>>
inline void setParameter(StringLiteral name, const T* UTILS_NONNULL values, size_t count) {
void setParameter(StringLiteral const name, const T* UTILS_NONNULL values, size_t const count) {
setParameter<T>(name.data, name.size, values, count);
}
/** inline helper to provide the name as a null-terminated C string */
template<typename T, typename = is_supported_parameter_t<T>>
inline void setParameter(const char* UTILS_NONNULL name,
const T* UTILS_NONNULL values, size_t count) {
void setParameter(const char* UTILS_NONNULL name,
const T* UTILS_NONNULL values, size_t const count) {
setParameter<T>(name, strlen(name), values, count);
}
@@ -176,14 +176,14 @@ public:
Texture const* UTILS_NULLABLE texture, TextureSampler const& sampler);
/** inline helper to provide the name as a null-terminated string literal */
inline void setParameter(StringLiteral name,
Texture const* UTILS_NULLABLE texture, TextureSampler const& sampler) {
void setParameter(StringLiteral const name,
Texture const* UTILS_NULLABLE texture, TextureSampler const& sampler) {
setParameter(name.data, name.size, texture, sampler);
}
/** inline helper to provide the name as a null-terminated C string */
inline void setParameter(const char* UTILS_NONNULL name,
Texture const* UTILS_NULLABLE texture, TextureSampler const& sampler) {
void setParameter(const char* UTILS_NONNULL name,
Texture const* UTILS_NULLABLE texture, TextureSampler const& sampler) {
setParameter(name, strlen(name), texture, sampler);
}
@@ -202,12 +202,12 @@ public:
RgbType type, math::float3 color);
/** inline helper to provide the name as a null-terminated string literal */
inline void setParameter(StringLiteral name, RgbType type, math::float3 color) {
void setParameter(StringLiteral const name, RgbType const type, math::float3 const color) {
setParameter(name.data, name.size, type, color);
}
/** inline helper to provide the name as a null-terminated C string */
inline void setParameter(const char* UTILS_NONNULL name, RgbType type, math::float3 color) {
void setParameter(const char* UTILS_NONNULL name, RgbType const type, math::float3 const color) {
setParameter(name, strlen(name), type, color);
}
@@ -226,12 +226,12 @@ public:
RgbaType type, math::float4 color);
/** inline helper to provide the name as a null-terminated string literal */
inline void setParameter(StringLiteral name, RgbaType type, math::float4 color) {
void setParameter(StringLiteral const name, RgbaType const type, math::float4 const color) {
setParameter(name.data, name.size, type, color);
}
/** inline helper to provide the name as a null-terminated C string */
inline void setParameter(const char* UTILS_NONNULL name, RgbaType type, math::float4 color) {
void setParameter(const char* UTILS_NONNULL name, RgbaType const type, math::float4 const color) {
setParameter(name, strlen(name), type, color);
}
@@ -251,13 +251,13 @@ public:
/** inline helper to provide the name as a null-terminated C string */
template<typename T, typename = is_supported_parameter_t<T>>
inline T getParameter(StringLiteral name) const {
T getParameter(StringLiteral const name) const {
return getParameter<T>(name.data, name.size);
}
/** inline helper to provide the name as a null-terminated C string */
template<typename T, typename = is_supported_parameter_t<T>>
inline T getParameter(const char* UTILS_NONNULL name) const {
T getParameter(const char* UTILS_NONNULL name) const {
return getParameter<T>(name, strlen(name));
}
@@ -376,11 +376,22 @@ public:
*/
void setCullingMode(CullingMode culling) noexcept;
/**
* Overrides the default triangle culling state that was set on the material separately for the
* color and shadow passes
*/
void setCullingMode(CullingMode colorPassCullingMode, CullingMode shadowPassCullingMode) noexcept;
/**
* Returns the face culling mode.
*/
CullingMode getCullingMode() const noexcept;
/**
* Returns the face culling mode for the shadow passes.
*/
CullingMode getShadowCullingMode() const noexcept;
/**
* Overrides the default color-buffer write state that was set on the material.
*/