[Bf-blender-cvs] [18330592417] temp-cycles-source-reorganize: Fixes for Cycles source reorganize

Brecht Van Lommel noreply at git.blender.org
Tue Oct 26 00:49:38 CEST 2021


Commit: 18330592417e4a5a7ffb805945b2aec8c4dd41bd
Author: Brecht Van Lommel
Date:   Mon Oct 25 23:54:58 2021 +0200
Branches: temp-cycles-source-reorganize
https://developer.blender.org/rB18330592417e4a5a7ffb805945b2aec8c4dd41bd

Fixes for Cycles source reorganize

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

M	intern/cycles/CMakeLists.txt
M	intern/cycles/blender/curves.cpp
M	intern/cycles/blender/mesh.cpp
M	intern/cycles/blender/object.cpp
M	intern/cycles/blender/session.h
M	intern/cycles/device/CMakeLists.txt
M	intern/cycles/device/device.cpp
M	intern/cycles/scene/scene.cpp
M	intern/cycles/session/tile.cpp
M	source/blender/makesrna/intern/rna_attribute.c

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

diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index b6f3926f329..1500743763b 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -295,13 +295,6 @@ if(WITH_OPENIMAGEDENOISE)
   )
 endif()
 
-if(WITH_CYCLES_STANDALONE)
-  set(WITH_CYCLES_DEVICE_CUDA TRUE)
-  set(WITH_CYCLES_DEVICE_HIP TRUE)
-endif()
-# TODO(sergey): Consider removing it, only causes confusion in interface.
-set(WITH_CYCLES_DEVICE_MULTI TRUE)
-
 # Logging capabilities using GLog library.
 if(WITH_CYCLES_LOGGING)
   add_definitions(-DWITH_CYCLES_LOGGING)
diff --git a/intern/cycles/blender/curves.cpp b/intern/cycles/blender/curves.cpp
index 816b296519b..fb2b329e61d 100644
--- a/intern/cycles/blender/curves.cpp
+++ b/intern/cycles/blender/curves.cpp
@@ -14,16 +14,16 @@
  * limitations under the License.
  */
 
-#include "scene/curves.h"
+#include "blender/sync.h"
+#include "blender/util.h"
+
 #include "scene/attribute.h"
 #include "scene/camera.h"
+#include "scene/curves.h"
 #include "scene/hair.h"
 #include "scene/object.h"
 #include "scene/scene.h"
 
-#include "blender/sync.h"
-#include "blender/util.h"
-
 #include "util/color.h"
 #include "util/foreach.h"
 #include "util/hash.h"
diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp
index 93af36ed5be..b69bf88c213 100644
--- a/intern/cycles/blender/mesh.cpp
+++ b/intern/cycles/blender/mesh.cpp
@@ -14,16 +14,16 @@
  * limitations under the License.
  */
 
-#include "scene/mesh.h"
+#include "blender/session.h"
+#include "blender/sync.h"
+#include "blender/util.h"
+
 #include "scene/camera.h"
 #include "scene/colorspace.h"
+#include "scene/mesh.h"
 #include "scene/object.h"
 #include "scene/scene.h"
 
-#include "blender/session.h"
-#include "blender/sync.h"
-#include "blender/util.h"
-
 #include "subd/patch.h"
 #include "subd/split.h"
 
diff --git a/intern/cycles/blender/object.cpp b/intern/cycles/blender/object.cpp
index 1c638d0e18c..9919b9d1836 100644
--- a/intern/cycles/blender/object.cpp
+++ b/intern/cycles/blender/object.cpp
@@ -14,22 +14,22 @@
  * limitations under the License.
  */
 
-#include "scene/object.h"
+#include "blender/object_cull.h"
+#include "blender/sync.h"
+#include "blender/util.h"
+
 #include "scene/alembic.h"
 #include "scene/camera.h"
 #include "scene/integrator.h"
 #include "scene/light.h"
 #include "scene/mesh.h"
+#include "scene/object.h"
 #include "scene/particles.h"
 #include "scene/scene.h"
 #include "scene/shader.h"
 #include "scene/shader_graph.h"
 #include "scene/shader_nodes.h"
 
-#include "blender/object_cull.h"
-#include "blender/sync.h"
-#include "blender/util.h"
-
 #include "util/foreach.h"
 #include "util/hash.h"
 #include "util/log.h"
diff --git a/intern/cycles/blender/session.h b/intern/cycles/blender/session.h
index 516cd86ac6d..fa24b5f7467 100644
--- a/intern/cycles/blender/session.h
+++ b/intern/cycles/blender/session.h
@@ -17,6 +17,8 @@
 #ifndef __BLENDER_SESSION_H__
 #define __BLENDER_SESSION_H__
 
+#include "MEM_guardedalloc.h"
+
 #include "RNA_blender_cpp.h"
 
 #include "device/device.h"
diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt
index 39de4bec799..99b1fc8135d 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -158,9 +158,6 @@ endif()
 if(WITH_CYCLES_DEVICE_OPTIX)
   add_definitions(-DWITH_OPTIX)
 endif()
-if(WITH_CYCLES_DEVICE_MULTI)
-  add_definitions(-DWITH_MULTI)
-endif()
 
 if(WITH_OPENIMAGEDENOISE)
   list(APPEND LIB
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp
index 5179f3bacdb..69e959b6f7b 100644
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@ -71,14 +71,12 @@ void Device::build_bvh(BVH *bvh, Progress &progress, bool refit)
 
 Device *Device::create(const DeviceInfo &info, Stats &stats, Profiler &profiler)
 {
-#ifdef WITH_MULTI
   if (!info.multi_devices.empty()) {
     /* Always create a multi device when info contains multiple devices.
      * This is done so that the type can still be e.g. DEVICE_CPU to indicate
      * that it is a homogeneous collection of devices, which simplifies checks. */
     return device_multi_create(info, stats, profiler);
   }
-#endif
 
   Device *device = NULL;
 
diff --git a/intern/cycles/scene/scene.cpp b/intern/cycles/scene/scene.cpp
index 1fd63ad7f7c..586f63346b3 100644
--- a/intern/cycles/scene/scene.cpp
+++ b/intern/cycles/scene/scene.cpp
@@ -505,8 +505,8 @@ void Scene::update_kernel_features()
       kernel_features |= KERNEL_FEATURE_SHADOW_CATCHER;
     }
     if (geom->is_mesh()) {
-      Mesh *mesh = static_cast<Mesh *>(geom);
 #ifdef WITH_OPENSUBDIV
+      Mesh *mesh = static_cast<Mesh *>(geom);
       if (mesh->get_subdivision_type() != Mesh::SUBDIVISION_NONE) {
         kernel_features |= KERNEL_FEATURE_PATCH_EVALUATION;
       }
diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp
index 816bf4d5fa0..56bc519378f 100644
--- a/intern/cycles/session/tile.cpp
+++ b/intern/cycles/session/tile.cpp
@@ -367,20 +367,26 @@ void TileManager::update(const BufferParams &params, const Scene *scene)
 
   buffer_params_ = params;
 
-  /* TODO(sergey): Proper Error handling, so that if configuration has failed we don't attempt to
-   * write to a partially configured file. */
-  configure_image_spec_from_buffer(&write_state_.image_spec, buffer_params_, tile_size_);
+  if (has_multiple_tiles()) {
+    /* TODO(sergey): Proper Error handling, so that if configuration has failed we don't attempt to
+     * write to a partially configured file. */
+    configure_image_spec_from_buffer(&write_state_.image_spec, buffer_params_, tile_size_);
 
-  const DenoiseParams denoise_params = scene->integrator->get_denoise_params();
-  const AdaptiveSampling adaptive_sampling = scene->integrator->get_adaptive_sampling();
+    const DenoiseParams denoise_params = scene->integrator->get_denoise_params();
+    const AdaptiveSampling adaptive_sampling = scene->integrator->get_adaptive_sampling();
 
-  node_to_image_spec_atttributes(
-      &write_state_.image_spec, &denoise_params, ATTR_DENOISE_SOCKET_PREFIX);
+    node_to_image_spec_atttributes(
+        &write_state_.image_spec, &denoise_params, ATTR_DENOISE_SOCKET_PREFIX);
 
-  if (adaptive_sampling.use) {
-    overscan_ = 4;
+    if (adaptive_sampling.use) {
+      overscan_ = 4;
+    }
+    else {
+      overscan_ = 0;
+    }
   }
   else {
+    write_state_.image_spec = ImageSpec();
     overscan_ = 0;
   }
 }
diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c
index f1831bca0fe..dbf20896463 100644
--- a/source/blender/makesrna/intern/rna_attribute.c
+++ b/source/blender/makesrna/intern/rna_attribute.c
@@ -323,8 +323,10 @@ static void rna_AttributeGroup_next_domain(ID *id,
                                            int(skip)(CollectionPropertyIterator *iter, void *data))
 {
   do {
-    CustomDataLayer *prev_layers = (CustomDataLayer *)iter->internal.array.endptr -
-                                   iter->internal.array.length;
+    CustomDataLayer *prev_layers = (iter->internal.array.endptr == NULL) ?
+                                       NULL :
+                                       (CustomDataLayer *)iter->internal.array.endptr -
+                                           iter->internal.array.length;
     CustomData *customdata = BKE_id_attributes_iterator_next_domain(id, prev_layers);
     if (customdata == NULL) {
       return;



More information about the Bf-blender-cvs mailing list