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:
authorJacques Lucke <jacques@blender.org>2021-04-27 14:03:40 +0300
committerJacques Lucke <jacques@blender.org>2021-04-27 14:03:40 +0300
commit908bb0363062168e16c608e13b9340724510e2cd (patch)
treec1215044d03af2f9cbdac32325582810666e5ebc /source/blender/functions/FN_generic_pointer.hh
parenta022cffb72f6f8b791c8f2ac9d7b689caa3e8839 (diff)
Geometry Nodes: improve geometry nodes evaluator internal api
This is a first step towards T87620. It should not have any functional changes. Goals of this refactor: * Move the evaluator out of `MOD_nodes.cc`. That makes it easier to improve it in isolation. * Extract core input/out parameter management out of `GeoNodeExecParams`. Managing this is the responsibility of the evaluator. This separation of concerns will be useful once we have lazy evaluation of certain inputs/outputs. Differential Revision: https://developer.blender.org/D11085
Diffstat (limited to 'source/blender/functions/FN_generic_pointer.hh')
-rw-r--r--source/blender/functions/FN_generic_pointer.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/functions/FN_generic_pointer.hh b/source/blender/functions/FN_generic_pointer.hh
index 2bd66daa7fe..f88ff09f916 100644
--- a/source/blender/functions/FN_generic_pointer.hh
+++ b/source/blender/functions/FN_generic_pointer.hh
@@ -66,6 +66,16 @@ class GMutablePointer {
return type_ != nullptr && type_->is<T>();
}
+ template<typename T> T relocate_out()
+ {
+ BLI_assert(this->is_type<T>());
+ T value;
+ type_->relocate_to_initialized(data_, &value);
+ data_ = nullptr;
+ type_ = nullptr;
+ return value;
+ }
+
void destruct()
{
BLI_assert(data_ != nullptr);