message: Fold computations inside the branch
diff: @@ -171,6 +171,7 @@ void CubemapIBL::roughnessFilter(Cubemap& dst,
  const double LoH = dot(L, H);
  #endif
  + if (NoL > 0) {
  // pre-filtered importance sampling
  // see: "Real-time Shading with Filtered Importance Sampling", Jaroslav Krivanek
  // see: "GPU-Based Importance Sampling, GPU Gems 3", Mark Colbert
  @@ -188,15 +189,18 @@ void CubemapIBL::roughnessFilter(Cubemap& dst,
  const double l = float(log4(omegaS) - log4(omegaP) + log4(K));
  const float mipLevel = clamp(float(l), 0.0f, maxLevelf);
  - if (NoL > 0) {
  const double V = Visibility(NoV, NoL, linearRoughness);
  const double F = Fresnel(1, 0, LoH);
  const float brdf_NoL = float(F * V * NoL);
  +
  weight += brdf_NoL;
  +
  uint8_t l0 = uint8_t(mipLevel);
  uint8_t l1 = uint8_t(std::min(maxLevel, size_t(l0 + 1)));
  float lerp = mipLevel - l0;
  +
  cache.push_back({ L, brdf_NoL, lerp, l0, l1 });
  +
  sample++;
  }
  }
  