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
This commit is contained in:
2022-08-10 09:14:22 +02:00
parent 169216684a
commit 624b0ac656
61 changed files with 5269 additions and 2 deletions

View File

@@ -101,6 +101,7 @@ typedef struct bNodeSocketTemplate {
namespace blender {
class CPPType;
namespace nodes {
class DNode;
class NodeMultiFunctionBuilder;
class GeoNodeExecParams;
class NodeDeclarationBuilder;
@@ -109,6 +110,11 @@ class GatherLinkSearchOpParams;
namespace fn {
class MFDataType;
} // namespace fn
namespace realtime_compositor {
class Context;
class NodeOperation;
class ShaderNode;
} // namespace realtime_compositor
} // namespace blender
using CPPTypeHandle = blender::CPPType;
@@ -123,7 +129,14 @@ using SocketGetGeometryNodesCPPValueFunction = void (*)(const struct bNodeSocket
using NodeGatherSocketLinkOperationsFunction =
void (*)(blender::nodes::GatherLinkSearchOpParams &params);
using NodeGetCompositorOperationFunction = blender::realtime_compositor::NodeOperation
*(*)(blender::realtime_compositor::Context &context, blender::nodes::DNode node);
using NodeGetCompositorShaderNodeFunction =
blender::realtime_compositor::ShaderNode *(*)(blender::nodes::DNode node);
#else
typedef void *NodeGetCompositorOperationFunction;
typedef void *NodeGetCompositorShaderNodeFunction;
typedef void *NodeMultiFunctionBuildFunction;
typedef void *NodeGeometryExecFunction;
typedef void *NodeDeclareFunction;
@@ -309,6 +322,14 @@ typedef struct bNodeType {
/* gpu */
NodeGPUExecFunction gpu_fn;
/* Get an instance of this node's compositor operation. Freeing the instance is the
* responsibility of the caller. */
NodeGetCompositorOperationFunction get_compositor_operation;
/* Get an instance of this node's compositor shader node. Freeing the instance is the
* responsibility of the caller. */
NodeGetCompositorShaderNodeFunction get_compositor_shader_node;
/* Build a multi-function for this node. */
NodeMultiFunctionBuildFunction build_multi_function;