[Bf-blender-cvs] [4f110ac7399] virtual-array-attributes: fix some compilation issues

Jacques Lucke noreply at git.blender.org
Tue Apr 13 13:25:48 CEST 2021


Commit: 4f110ac7399c1783bedb0b2c6b13c12d8d472f9b
Author: Jacques Lucke
Date:   Tue Apr 13 13:25:36 2021 +0200
Branches: virtual-array-attributes
https://developer.blender.org/rB4f110ac7399c1783bedb0b2c6b13c12d8d472f9b

fix some compilation issues

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

M	source/blender/blenkernel/BKE_geometry_set.hh
M	source/blender/blenlib/BLI_virtual_array.hh
M	source/blender/functions/FN_generic_virtual_array.hh
M	source/blender/nodes/NOD_geometry_exec.hh

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

diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index 2981945654d..b5e1fa3d518 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -169,7 +169,7 @@ class GeometryComponent {
     const CustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type);
     std::unique_ptr varray = this->attribute_get_for_read(
         attribute_name, domain, type, &default_value);
-    return varray;
+    return blender::fn::GVArray_Typed<T>(std::move(varray));
   }
 
   /**
diff --git a/source/blender/blenlib/BLI_virtual_array.hh b/source/blender/blenlib/BLI_virtual_array.hh
index 20827bfd030..2c31bd99700 100644
--- a/source/blender/blenlib/BLI_virtual_array.hh
+++ b/source/blender/blenlib/BLI_virtual_array.hh
@@ -277,7 +277,7 @@ template<typename T> class VArray_For_Span : public VArray<T> {
   }
 };
 
-template<typename T> class VMutableArray_For_MutableSpan final : public VMutableArray<T> {
+template<typename T> class VMutableArray_For_MutableSpan : public VMutableArray<T> {
  protected:
   T *data_ = nullptr;
 
@@ -292,12 +292,12 @@ template<typename T> class VMutableArray_For_MutableSpan final : public VMutable
   {
   }
 
-  T get_impl(const int64_t index) const override
+  T get_impl(const int64_t index) const final
   {
     return data_[index];
   }
 
-  void set_impl(const int64_t index, T value) override
+  void set_impl(const int64_t index, T value) final
   {
     data_[index] = value;
   }
diff --git a/source/blender/functions/FN_generic_virtual_array.hh b/source/blender/functions/FN_generic_virtual_array.hh
index afe7f6302b3..1fa5419e0cb 100644
--- a/source/blender/functions/FN_generic_virtual_array.hh
+++ b/source/blender/functions/FN_generic_virtual_array.hh
@@ -424,7 +424,7 @@ template<typename T> class VMutableArray_For_GVMutableArray : public VMutableArr
     return value;
   }
 
-  void set_impl(const int64_t index, T value) const override
+  void set_impl(const int64_t index, T value) override
   {
     varray_->set_by_relocate(index, &value);
   }
@@ -722,7 +722,7 @@ template<typename T> class GVArray_Typed {
       varray_single_.emplace(single_value, gvarray.size());
       varray_ = &*varray_single_;
     }
-    else if (VArray<T> *internal_varray = gvarray.try_get_internal_varray<T>()) {
+    else if (const VArray<T> *internal_varray = gvarray.try_get_internal_varray<T>()) {
       varray_ = internal_varray;
     }
     else {
diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh
index 5ba2281b3a7..15201553f16 100644
--- a/source/blender/nodes/NOD_geometry_exec.hh
+++ b/source/blender/nodes/NOD_geometry_exec.hh
@@ -222,7 +222,9 @@ class GeoNodeExecParams {
                                            const T &default_value) const
   {
     const CustomDataType type = bke::cpp_type_to_custom_data_type(CPPType::get<T>());
-    return this->get_input_attribute(name, component, domain, type, &default_value);
+    std::unique_ptr<GVArray> varray = this->get_input_attribute(
+        name, component, domain, type, &default_value);
+    return fn::GVArray_Typed<T>(std::move(varray));
   }
 
   /**



More information about the Bf-blender-cvs mailing list