Use Span<uint8_t> in RenderingDevice allocation APIs to avoid intermediary arrays on calls.

This commit is contained in:
Lukas Tenbrink 2025-06-17 17:33:00 +02:00
parent 46c495ca21
commit 2b36c79f7b
10 changed files with 71 additions and 81 deletions

View file

@ -91,6 +91,11 @@ public:
_FORCE_INLINE_ constexpr const T *begin() const { return _ptr; }
_FORCE_INLINE_ constexpr const T *end() const { return _ptr + _len; }
template <typename T1>
_FORCE_INLINE_ constexpr Span<T1> reinterpret() const {
return Span<T1>(reinterpret_cast<const T1 *>(_ptr), _len * sizeof(T) / sizeof(T1));
}
// Algorithms.
constexpr int64_t find(const T &p_val, uint64_t p_from = 0) const;
constexpr int64_t rfind(const T &p_val, uint64_t p_from) const;