[Bf-blender-cvs] [af00a73971e] soc-2022-many-lights-sampling: Cleanup: suppress some warnings

Weizhen Huang noreply at git.blender.org
Wed Nov 30 13:36:14 CET 2022


Commit: af00a73971ef6329b4b679f15915beb04f11b36c
Author: Weizhen Huang
Date:   Wed Nov 30 13:35:29 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBaf00a73971ef6329b4b679f15915beb04f11b36c

Cleanup: suppress some warnings

===================================================================

M	intern/cycles/kernel/light/tree.h
M	intern/cycles/scene/light_tree.cpp

===================================================================

diff --git a/intern/cycles/kernel/light/tree.h b/intern/cycles/kernel/light/tree.h
index b35f76286b9..b68b7f2a32a 100644
--- a/intern/cycles/kernel/light/tree.h
+++ b/intern/cycles/kernel/light/tree.h
@@ -446,7 +446,7 @@ ccl_device int light_tree_cluster_select_emitter(KernelGlobals kg,
   kernel_assert(knode->num_prims <= sizeof(uint) * 8);
   uint has_importance = 0;
 
-  bool sample_max = (rand > 0.5f); /* sampling using the maximum importance */
+  const bool sample_max = (rand > 0.5f); /* sampling using the maximum importance */
   rand = rand * 2.0f - float(sample_max);
 
   for (int i = 0; i < knode->num_prims; i++) {
diff --git a/intern/cycles/scene/light_tree.cpp b/intern/cycles/scene/light_tree.cpp
index 6db2b29c4fd..121b5593bde 100644
--- a/intern/cycles/scene/light_tree.cpp
+++ b/intern/cycles/scene/light_tree.cpp
@@ -131,8 +131,8 @@ LightTreePrimitive::LightTreePrimitive(Scene *scene, int prim_id, int object_id)
       /* For an area light, sizeu and sizev determine the 2 dimensions of the area light,
        * while axisu and axisv determine the orientation of the 2 dimensions.
        * We want to add all 4 corners to our bounding box. */
-      const float3 half_extentu = 0.5 * lamp->get_sizeu() * lamp->get_axisu() * size;
-      const float3 half_extentv = 0.5 * lamp->get_sizev() * lamp->get_axisv() * size;
+      const float3 half_extentu = 0.5f * lamp->get_sizeu() * lamp->get_axisu() * size;
+      const float3 half_extentv = 0.5f * lamp->get_sizev() * lamp->get_axisv() * size;
       bbox.grow(centroid + half_extentu + half_extentv);
       bbox.grow(centroid + half_extentu - half_extentv);
       bbox.grow(centroid - half_extentu + half_extentv);
@@ -272,7 +272,7 @@ int LightTree::recursive_build(
       middle = (start + end) / 2;
     }
 
-    int left_index = recursive_build(start, middle, prims, bit_trail, depth + 1);
+    [[maybe_unused]] int left_index = recursive_build(start, middle, prims, bit_trail, depth + 1);
     int right_index = recursive_build(middle, end, prims, bit_trail | (1u << depth), depth + 1);
     assert(left_index == current_index + 1);
     nodes_[current_index].make_interior(right_index);



More information about the Bf-blender-cvs mailing list