[Bf-blender-cvs] [ed300ec3ee3] soc-2022-many-lights-sampling: Fix: use floats explicitly in light tree
Jeffrey Liu
noreply at git.blender.org
Mon Jul 18 15:41:43 CEST 2022
Commit: ed300ec3ee3ecf937e97211b4f8481f078a8b459
Author: Jeffrey Liu
Date: Mon Jul 18 09:29:01 2022 -0400
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBed300ec3ee3ecf937e97211b4f8481f078a8b459
Fix: use floats explicitly in light tree
===================================================================
M intern/cycles/kernel/light/light_tree.h
===================================================================
diff --git a/intern/cycles/kernel/light/light_tree.h b/intern/cycles/kernel/light/light_tree.h
index 5d9dd069b73..0de3cbf9d8b 100644
--- a/intern/cycles/kernel/light/light_tree.h
+++ b/intern/cycles/kernel/light/light_tree.h
@@ -45,7 +45,7 @@ ccl_device float light_tree_node_importance(const float3 P,
/* Since we're not using the splitting heuristic, we clamp
* the distance to half the radius of the cluster. */
- const float distance_squared = fmaxf(0.25 * len_squared(centroid - bbox_max),
+ const float distance_squared = fmaxf(0.25f * len_squared(centroid - bbox_max),
len_squared(centroid - P));
const float theta = fast_acosf(dot(bcone_axis, -point_to_centroid));
@@ -56,7 +56,7 @@ ccl_device float light_tree_node_importance(const float3 P,
/* Avoid using cosine until needed. */
const float theta_prime = fmaxf(theta - theta_o - theta_u, 0.0f);
if (theta_prime >= theta_e) {
- return 0;
+ return 0.0f;
}
const float cos_theta_prime = fast_cosf(theta_prime);
More information about the Bf-blender-cvs
mailing list