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:
authorOmar Emara <mail@OmarEmara.dev>2022-08-10 10:14:22 +0300
committerOmar Emara <mail@OmarEmara.dev>2022-08-10 10:14:22 +0300
commit624b0ac656e4876c8518adb479be94e581c46bb8 (patch)
treecd5cd314498cab0ca367d33ce41f768de1af378e /source/blender/nodes/NOD_node_declaration.hh
parent169216684a7dd9fff065bad2c0bad60578f9412f (diff)
Realtime Compositor: Add evaluator and engine
This patch adds the core realtime compositor evaluator as well as a compositor draw engine powered by the evaluator that operates in the viewport. The realtime compositor is a new GPU accelerated compositor that will be used to power the viewport compositor imminently as well as the existing compositor in the future. This patch only adds the evaluator and engine as an experimental feature, the implementation of the nodes themselves will be committed separately. See T99210. Differential Revision: https://developer.blender.org/D15206 Reviewed By: Clement Foucault
Diffstat (limited to 'source/blender/nodes/NOD_node_declaration.hh')
-rw-r--r--source/blender/nodes/NOD_node_declaration.hh37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh
index 4e78f6c1142..d8b8c354230 100644
--- a/source/blender/nodes/NOD_node_declaration.hh
+++ b/source/blender/nodes/NOD_node_declaration.hh
@@ -88,6 +88,14 @@ class SocketDeclaration {
InputSocketFieldType input_field_type_ = InputSocketFieldType::None;
OutputFieldDependency output_field_dependency_;
+ /** The priority of the input for determining the domain of the node. See
+ * realtime_compositor::InputDescriptor for more information. */
+ int compositor_domain_priority_ = 0;
+
+ /** This input expects a single value and can't operate on non-single values. See
+ * realtime_compositor::InputDescriptor for more information. */
+ bool compositor_expects_single_value_ = false;
+
/** Utility method to make the socket available if there is a straightforward way to do so. */
std::function<void(bNode &)> make_available_fn_;
@@ -124,6 +132,9 @@ class SocketDeclaration {
InputSocketFieldType input_field_type() const;
const OutputFieldDependency &output_field_dependency() const;
+ int compositor_domain_priority() const;
+ bool compositor_expects_single_value() const;
+
protected:
void set_common_flags(bNodeSocket &socket) const;
bool matches_common_data(const bNodeSocket &socket) const;
@@ -238,6 +249,22 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder {
return *(Self *)this;
}
+ /** The priority of the input for determining the domain of the node. See
+ * realtime_compositor::InputDescriptor for more information. */
+ Self &compositor_domain_priority(int priority)
+ {
+ decl_->compositor_domain_priority_ = priority;
+ return *(Self *)this;
+ }
+
+ /** This input expects a single value and can't operate on non-single values. See
+ * realtime_compositor::InputDescriptor for more information. */
+ Self &compositor_expects_single_value(bool value = true)
+ {
+ decl_->compositor_expects_single_value_ = value;
+ return *(Self *)this;
+ }
+
/**
* Pass a function that sets properties on the node required to make the corresponding socket
* available, if it is not available on the default state of the node. The function is allowed to
@@ -428,6 +455,16 @@ inline const OutputFieldDependency &SocketDeclaration::output_field_dependency()
return output_field_dependency_;
}
+inline int SocketDeclaration::compositor_domain_priority() const
+{
+ return compositor_domain_priority_;
+}
+
+inline bool SocketDeclaration::compositor_expects_single_value() const
+{
+ return compositor_expects_single_value_;
+}
+
inline void SocketDeclaration::make_available(bNode &node) const
{
if (make_available_fn_) {