feat: update Filament to v1.56.4

This commit is contained in:
Nick Fisher
2025-01-07 08:27:19 +08:00
parent b1c0d4b2e8
commit 020bfbcbf6
60 changed files with 1772 additions and 21074 deletions

View File

@@ -60,6 +60,11 @@ public:
std::fill(std::begin(storage), std::end(storage), 0);
}
template<typename U, typename = typename std::enable_if_t<N == 1, U>>
explicit bitset(U value) noexcept {
storage[0] = value;
}
T getBitsAt(size_t n) const noexcept {
assert_invariant(n<N);
return storage[n];
@@ -94,6 +99,8 @@ public:
size_t size() const noexcept { return N * BITS_PER_WORD; }
bool empty() const noexcept { return none(); }
bool test(size_t bit) const noexcept { return operator[](bit); }
void set(size_t b) noexcept {
@@ -117,11 +124,14 @@ public:
storage[b / BITS_PER_WORD] ^= T(1) << (b % BITS_PER_WORD);
}
void reset() noexcept {
std::fill(std::begin(storage), std::end(storage), 0);
}
void clear() noexcept {
reset();
}
bool operator[](size_t b) const noexcept {
assert_invariant(b / BITS_PER_WORD < N);
return bool(storage[b / BITS_PER_WORD] & (T(1) << (b % BITS_PER_WORD)));