Page Menu
Home
Search
Configure Global Search
Log In
Paste
P1531
Snippet for D8230
Active
Public
Actions
Authored by
Sergey Sharybin (sergey)
on Jul 14 2020, 11:34 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 3ea6892a349..48772b8ca08 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -32,6 +32,7 @@
#include "util/util_foreach.h"
#include "util/util_hash.h"
#include "util/util_logging.h"
+#include "util/util_task.h"
CCL_NAMESPACE_BEGIN
@@ -357,12 +358,24 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval();
BL::Depsgraph::object_instances_iterator b_instance_iter;
+
+ vector<BL::Object> b_accessible_objects;
+
for (b_depsgraph.object_instances.begin(b_instance_iter);
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
++b_instance_iter) {
BL::DepsgraphObjectInstance b_instance = *b_instance_iter;
BL::Object b_ob = b_instance.object();
+ BL::Object b_accessible_object(PointerRNA_NULL);
+ if (b_instance.is_instance()) {
+ b_accessible_object = b_instance.instance_object();
+ }
+ else {
+ b_accessible_object = b_instance.object();
+ }
+ b_accessible_objects.push_back(b_accessible_object);
+
/* Viewport visibility. */
const bool show_in_viewport = !b_v3d || b_ob.visible_in_viewport_get(b_v3d);
if (show_in_viewport == false) {
@@ -399,6 +412,19 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
cancel = progress.get_cancel();
}
+ parallel_for(blocked_range<size_t>(0, b_accessible_objects.size(), 1),
+ [&](const blocked_range<size_t> &r) {
+ for (size_t i = r.begin(); i != r.end(); ++i) {
+ BL::Object &b_object = b_accessible_objects[i];
+ const void *data_ptr = b_object.ptr.data;
+ printf("%p\n", data_ptr);
+ if (data_ptr == nullptr) {
+ printf("PANIC: DATA IS NULLPTR\n");
+ abort();
+ }
+ }
+ });
+
progress.set_sync_status("");
if (!cancel && !motion) {
Event Timeline
Sergey Sharybin (sergey)
created this paste.
Jul 14 2020, 11:34 AM
Sergey Sharybin (sergey)
created this object with edit policy "Administrators".
Sergey Sharybin (sergey)
mentioned this in
D8230: Multithreading sync portion of Cycles Render
.
Jul 14 2020, 11:50 AM
Log In to Comment