From 8cb38344ae41fbb21bc1787cb4e052bfc1dab3cb Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 11 Jun 2019 14:43:17 -0700 Subject: [PATCH] remove float3 specialization --- filament/src/UniformBuffer.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/filament/src/UniformBuffer.h b/filament/src/UniformBuffer.h index 6664175537..f3e68bce90 100644 --- a/filament/src/UniformBuffer.h +++ b/filament/src/UniformBuffer.h @@ -128,10 +128,8 @@ public: constexpr size_t stride = (sizeof(T) + 0xF) & ~0xF; T* UTILS_RESTRICT p = static_cast(invalidateUniforms(offset, stride * count)); for (size_t i = 0; i < count; i++) { - *p++ = begin[i]; - if (sizeof(T) & 0xF) { - p = utils::pointermath::align(p, 0x10); - } + *p = begin[i]; + p = utils::pointermath::add(p, stride); } } @@ -192,19 +190,6 @@ private: mutable bool mSomethingDirty = false; }; -// specialization for float3 (which has a different alignment) -template<> -inline void -UniformBuffer::setUniformArray(size_t offset, math::float3 const* begin, size_t count) noexcept { - math::float4* p = static_cast(invalidateUniforms(offset, - sizeof(math::float4) * count)); - math::float3 const* const end = begin + count; - while (begin != end) { - p->xyz = *begin++; - ++p; - } -} - // specialization for mat3f (which has a different alignment, see std140 layout rules) template<> inline void UniformBuffer::setUniform(void* addr, size_t offset, const math::mat3f& v) noexcept {