Cleanup and add performance logs.

Somehow not using const reference takes 30 fps away 😕
This commit is contained in:
DelinWorks 2022-06-12 03:40:13 +03:00
parent 2836420fb3
commit 61b3de52a3
1 changed files with 4 additions and 1 deletions

View File

@ -2357,6 +2357,9 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskName,
desc.points = std::move(points); desc.points = std::move(points);
iter->second = desc; iter->second = desc;
CCLOG("Particle emission mask '%s' baked (%dx%d), %d samples generated taking %.2fmb of memory.",
std::string(maskName).c_str(), w, h, desc.points.size(), desc.points.size() * 8 / 1e+6);
} }
const ParticleEmissionMaskDescriptor& ParticleEmissionMaskCache::getEmissionMask(std::string_view maskName) const ParticleEmissionMaskDescriptor& ParticleEmissionMaskCache::getEmissionMask(std::string_view maskName)
@ -2364,7 +2367,7 @@ const ParticleEmissionMaskDescriptor& ParticleEmissionMaskCache::getEmissionMask
auto iter = this->masks.find(maskName); auto iter = this->masks.find(maskName);
if (iter == this->masks.end()) if (iter == this->masks.end())
{ {
ParticleEmissionMaskDescriptor desc; ParticleEmissionMaskDescriptor desc{};
desc.size = {float(1), float(1)}; desc.size = {float(1), float(1)};
desc.points = {{0, 0}}; desc.points = {{0, 0}};
return desc; return desc;