diff --git a/filament/src/VertexBuffer.cpp b/filament/src/VertexBuffer.cpp index c731587d17..390eb0531b 100644 --- a/filament/src/VertexBuffer.cpp +++ b/filament/src/VertexBuffer.cpp @@ -134,6 +134,7 @@ FVertexBuffer::FVertexBuffer(FEngine& engine, const VertexBuffer::Builder& build auto const& declaredAttributes = mDeclaredAttributes; auto const& attributes = mAttributes; + #pragma nounroll for (size_t i = 0, n = attributeArray.size(); i < n; ++i) { if (declaredAttributes[i]) { attributeArray[i].offset = attributes[i].offset; diff --git a/filament/src/driver/opengl/OpenGLDriver.cpp b/filament/src/driver/opengl/OpenGLDriver.cpp index 5938cd7bdb..2e8ca10da6 100644 --- a/filament/src/driver/opengl/OpenGLDriver.cpp +++ b/filament/src/driver/opengl/OpenGLDriver.cpp @@ -401,6 +401,7 @@ void OpenGLDriver::unbindTexture(GLenum target, GLuint texture_id) noexcept { void OpenGLDriver::unbindSampler(GLuint sampler) noexcept { // unbind this sampler from all the units it might be bound to + #pragma nounroll // clang generates >800B of code!!! for (GLuint unit = 0; unit < MAX_TEXTURE_UNITS; unit++) { if (state.textures.units[unit].sampler == sampler) { bindSampler(unit, 0); @@ -1260,6 +1261,7 @@ void OpenGLDriver::destroyVertexBuffer(Driver::VertexBufferHandle vbh) { // bindings of bound buffers are reset to 0 const size_t targetIndex = getIndexForBufferTarget(GL_ARRAY_BUFFER); auto& target = state.buffers.genericBinding[targetIndex]; + #pragma nounroll for (GLuint b : eb->gl.buffers) { if (target == b) { target = 0; @@ -1326,6 +1328,8 @@ void OpenGLDriver::destroyUniformBuffer(Driver::UniformBufferHandle ubh) { // bindings of bound buffers are reset to 0 const size_t targetIndex = getIndexForBufferTarget(GL_UNIFORM_BUFFER); auto& target = state.buffers.targets[targetIndex]; + + #pragma nounroll // clang generates >1 KiB of code!! for (auto& buffer : target.buffers) { if (buffer.name == ub->gl.ubo.id) { buffer.name = 0; diff --git a/libs/filabridge/include/filament/SamplerBindingMap.h b/libs/filabridge/include/filament/SamplerBindingMap.h index 14096e11dc..30d59a90d7 100644 --- a/libs/filabridge/include/filament/SamplerBindingMap.h +++ b/libs/filabridge/include/filament/SamplerBindingMap.h @@ -19,8 +19,8 @@ #include +#include #include -#include namespace filament { @@ -89,7 +89,7 @@ private: return ((uint32_t) blockIndex << 8) + localOffset; } std::vector mBindingList; - std::unordered_map mBindingMap; + tsl::robin_map mBindingMap; uint8_t mSamplerBlockOffsets[filament::BindingPoints::COUNT] = { UNKNOWN_OFFSET }; }; diff --git a/libs/utils/src/Profiler.cpp b/libs/utils/src/Profiler.cpp index cae8bceda8..53259b7abe 100644 --- a/libs/utils/src/Profiler.cpp +++ b/libs/utils/src/Profiler.cpp @@ -63,6 +63,7 @@ Profiler::Profiler() noexcept { } Profiler::~Profiler() noexcept { + #pragma nounroll for (int fd : mCountersFd) { if (fd >= 0) { close(fd); @@ -72,6 +73,7 @@ Profiler::~Profiler() noexcept { uint32_t Profiler::resetEvents(uint32_t eventMask) noexcept { // close all counters + #pragma nounroll for (int& fd : mCountersFd) { if (fd >= 0) { close(fd); @@ -133,7 +135,7 @@ uint32_t Profiler::resetEvents(uint32_t eventMask) noexcept { mEnabledEvents |= EV_L1D_MISSES; } } - + if (eventMask & EV_BPU_REFS) { pe.type = PERF_TYPE_HARDWARE; pe.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS; @@ -143,7 +145,7 @@ uint32_t Profiler::resetEvents(uint32_t eventMask) noexcept { mEnabledEvents |= EV_BPU_REFS; } } - + if (eventMask & EV_BPU_MISSES) { pe.type = PERF_TYPE_HARDWARE; pe.config = PERF_COUNT_HW_BRANCH_MISSES; @@ -153,7 +155,7 @@ uint32_t Profiler::resetEvents(uint32_t eventMask) noexcept { mEnabledEvents |= EV_BPU_MISSES; } } - + #ifdef __ARM_ARCH if (eventMask & EV_L1I_REFS) { pe.type = PERF_TYPE_RAW;