Files
test/source/blender/nodes/NOD_geometry_nodes_closure_eval.hh
Jacques Lucke 6d9b9dd2c3 Refactor: Functions: extract user data to separate header
Previously, the `UserData` and `LocalUserData` classes were only supposed to be
used by the lazy-function system. However, they are generic enough so that they
can also be used by the multi-function system. Therefore, this patch extracts
them into a separate header that can be used in both evaluation systems.

I'm doing this in preparation for being able to pass the geometry nodes logger
to multi-functions, to be able to report errors from there.

Pull Request: https://projects.blender.org/blender/blender/pulls/138861
2025-05-14 10:54:28 +02:00

39 lines
955 B
C++

/* SPDX-FileCopyrightText: 2025 Blender Foundation
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "NOD_geometry_nodes_closure.hh"
#include "NOD_geometry_nodes_lazy_function.hh"
namespace blender::nodes {
struct ClosureEagerEvalParams {
struct InputItem {
SocketInterfaceKey key;
const bke::bNodeSocketType *type = nullptr;
/**
* The actual socket value of type bNodeSocketType::geometry_nodes_cpp_type.
* This is not const, because it may be moved from.
*/
void *value = nullptr;
};
struct OutputItem {
SocketInterfaceKey key;
const bke::bNodeSocketType *type = nullptr;
/** Where the output value should be stored. */
void *value = nullptr;
};
Vector<InputItem> inputs;
Vector<OutputItem> outputs;
GeoNodesUserData *user_data = nullptr;
};
void evaluate_closure_eagerly(const Closure &closure, ClosureEagerEvalParams &params);
} // namespace blender::nodes