Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/bvh/bvh8.cpp')
-rw-r--r--intern/cycles/bvh/bvh8.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/intern/cycles/bvh/bvh8.cpp b/intern/cycles/bvh/bvh8.cpp
index 70d003d938a..b95fe572e27 100644
--- a/intern/cycles/bvh/bvh8.cpp
+++ b/intern/cycles/bvh/bvh8.cpp
@@ -124,6 +124,7 @@ void BVH8::pack_aligned_node(int idx,
data[0].a = __uint_as_float(visibility & ~PATH_RAY_NODE_UNALIGNED);
data[0].b = time_from;
data[0].c = time_to;
+
for(int i = 0; i < num; i++) {
float3 bb_min = bounds[i].min;
float3 bb_max = bounds[i].max;
@@ -140,8 +141,8 @@ void BVH8::pack_aligned_node(int idx,
for(int i = num; i < 8; i++) {
/* We store BB which would never be recorded as intersection
- * so kernel might safely assume there are always 4 child nodes.
- */
+ * so kernel might safely assume there are always 4 child nodes.
+ */
data[1][i] = FLT_MAX;
data[2][i] = -FLT_MAX;
@@ -153,6 +154,7 @@ void BVH8::pack_aligned_node(int idx,
data[7][i] = __int_as_float(0);
}
+
memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_ONODE_SIZE);
}
@@ -189,6 +191,7 @@ void BVH8::pack_unaligned_node(int idx,
{
float8 data[BVH_UNALIGNED_ONODE_SIZE];
memset(data, 0, sizeof(data));
+
data[0].a = __uint_as_float(visibility | PATH_RAY_NODE_UNALIGNED);
data[0].b = time_from;
data[0].c = time_to;
@@ -222,21 +225,21 @@ void BVH8::pack_unaligned_node(int idx,
* so kernel might safely assume there are always 4 child nodes.
*/
- data[1][i] = 1.0f;
- data[2][i] = 0.0f;
- data[3][i] = 0.0f;
+ data[1][i] = NAN;
+ data[2][i] = NAN;
+ data[3][i] = NAN;
- data[4][i] = 0.0f;
- data[5][i] = 0.0f;
- data[6][i] = 0.0f;
+ data[4][i] = NAN;
+ data[5][i] = NAN;
+ data[6][i] = NAN;
- data[7][i] = 0.0f;
- data[8][i] = 0.0f;
- data[9][i] = 0.0f;
+ data[7][i] = NAN;
+ data[8][i] = NAN;
+ data[9][i] = NAN;
- data[10][i] = -FLT_MAX;
- data[11][i] = -FLT_MAX;
- data[12][i] = -FLT_MAX;
+ data[10][i] = NAN;
+ data[11][i] = NAN;
+ data[12][i] = NAN;
data[13][i] = __int_as_float(0);
}