diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-10-27 13:40:42 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-10-27 13:40:42 +0300 |
commit | 30f626fe4cd62f406468ef0ff2169694424b1a29 (patch) | |
tree | d428586cd3a6e689ab1e2f5a4222d1e0eb77ada7 /intern/cycles/bvh/bvh_build.cpp | |
parent | 17381c7b90eb3acde53eca013ae5a5a55699f17d (diff) |
Revert "Cycles API: encapsulate Node socket members"
This reverts commit 527f8b32b32187f754e5b176db6377736f9cb8ff. It is causing
motion blur test failures and crashes in some renders, reverting until this is
fixed.
Diffstat (limited to 'intern/cycles/bvh/bvh_build.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index 1727082b7ec..360cac59e9b 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -169,12 +169,12 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair const size_t num_curves = hair->num_curves(); for (uint j = 0; j < num_curves; j++) { const Hair::Curve curve = hair->get_curve(j); - const float *curve_radius = &hair->get_curve_radius()[0]; + const float *curve_radius = &hair->curve_radius[0]; for (int k = 0; k < curve.num_keys - 1; k++) { if (curve_attr_mP == NULL) { /* Really simple logic for static hair. */ BoundBox bounds = BoundBox::empty; - curve.bounds_grow(k, &hair->get_curve_keys()[0], curve_radius, bounds); + curve.bounds_grow(k, &hair->curve_keys[0], curve_radius, bounds); if (bounds.valid()) { int packed_type = PRIMITIVE_PACK_SEGMENT(primitive_type, k); references.push_back(BVHReference(bounds, j, i, packed_type)); @@ -189,9 +189,9 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair */ /* TODO(sergey): Support motion steps for spatially split BVH. */ BoundBox bounds = BoundBox::empty; - curve.bounds_grow(k, &hair->get_curve_keys()[0], curve_radius, bounds); - const size_t num_keys = hair->get_curve_keys().size(); - const size_t num_steps = hair->get_motion_steps(); + curve.bounds_grow(k, &hair->curve_keys[0], curve_radius, bounds); + const size_t num_keys = hair->curve_keys.size(); + const size_t num_steps = hair->motion_steps; const float3 *key_steps = curve_attr_mP->data_float3(); for (size_t step = 0; step < num_steps - 1; step++) { curve.bounds_grow(k, key_steps + step * num_keys, curve_radius, bounds); @@ -210,10 +210,10 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair */ const int num_bvh_steps = params.num_motion_curve_steps * 2 + 1; const float num_bvh_steps_inv_1 = 1.0f / (num_bvh_steps - 1); - const size_t num_steps = hair->get_motion_steps(); - const float3 *curve_keys = &hair->get_curve_keys()[0]; + const size_t num_steps = hair->motion_steps; + const float3 *curve_keys = &hair->curve_keys[0]; const float3 *key_steps = curve_attr_mP->data_float3(); - const size_t num_keys = hair->get_curve_keys().size(); + const size_t num_keys = hair->curve_keys.size(); /* Calculate bounding box of the previous time step. * Will be reused later to avoid duplicated work on * calculating BVH time step boundbox. @@ -270,11 +270,11 @@ void BVHBuild::add_reference_curves(BoundBox &root, BoundBox ¢er, Hair *hair void BVHBuild::add_reference_geometry(BoundBox &root, BoundBox ¢er, Geometry *geom, int i) { - if (geom->geometry_type == Geometry::MESH || geom->geometry_type == Geometry::VOLUME) { + if (geom->type == Geometry::MESH || geom->type == Geometry::VOLUME) { Mesh *mesh = static_cast<Mesh *>(geom); add_reference_triangles(root, center, mesh, i); } - else if (geom->geometry_type == Geometry::HAIR) { + else if (geom->type == Geometry::HAIR) { Hair *hair = static_cast<Hair *>(geom); add_reference_curves(root, center, hair, i); } @@ -299,11 +299,11 @@ static size_t count_curve_segments(Hair *hair) static size_t count_primitives(Geometry *geom) { - if (geom->geometry_type == Geometry::MESH || geom->geometry_type == Geometry::VOLUME) { + if (geom->type == Geometry::MESH || geom->type == Geometry::VOLUME) { Mesh *mesh = static_cast<Mesh *>(geom); return mesh->num_triangles(); } - else if (geom->geometry_type == Geometry::HAIR) { + else if (geom->type == Geometry::HAIR) { Hair *hair = static_cast<Hair *>(geom); return count_curve_segments(hair); } @@ -321,14 +321,14 @@ void BVHBuild::add_references(BVHRange &root) if (!ob->is_traceable()) { continue; } - if (!ob->get_geometry()->is_instanced()) { - num_alloc_references += count_primitives(ob->get_geometry()); + if (!ob->geometry->is_instanced()) { + num_alloc_references += count_primitives(ob->geometry); } else num_alloc_references++; } else { - num_alloc_references += count_primitives(ob->get_geometry()); + num_alloc_references += count_primitives(ob->geometry); } } @@ -344,13 +344,13 @@ void BVHBuild::add_references(BVHRange &root) ++i; continue; } - if (!ob->get_geometry()->is_instanced()) - add_reference_geometry(bounds, center, ob->get_geometry(), i); + if (!ob->geometry->is_instanced()) + add_reference_geometry(bounds, center, ob->geometry, i); else add_reference_object(bounds, center, ob, i); } else - add_reference_geometry(bounds, center, ob->get_geometry(), i); + add_reference_geometry(bounds, center, ob->geometry, i); i++; |