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:
Diffstat (limited to 'source/blender/compositor/realtime_compositor/COM_realize_on_domain_operation.hh')
-rw-r--r--source/blender/compositor/realtime_compositor/COM_realize_on_domain_operation.hh49
1 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/compositor/realtime_compositor/COM_realize_on_domain_operation.hh b/source/blender/compositor/realtime_compositor/COM_realize_on_domain_operation.hh
new file mode 100644
index 00000000000..5a842e16008
--- /dev/null
+++ b/source/blender/compositor/realtime_compositor/COM_realize_on_domain_operation.hh
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#pragma once
+
+#include "GPU_shader.h"
+
+#include "COM_context.hh"
+#include "COM_domain.hh"
+#include "COM_input_descriptor.hh"
+#include "COM_result.hh"
+#include "COM_simple_operation.hh"
+
+namespace blender::realtime_compositor {
+
+/* ------------------------------------------------------------------------------------------------
+ * Realize On Domain Operation
+ *
+ * A simple operation that projects the input on a certain target domain, copies the area of the
+ * input that intersects the target domain, and fill the rest with zeros or repetitions of the
+ * input depending on the realization options of the target domain. See the discussion in
+ * COM_domain.hh for more information. */
+class RealizeOnDomainOperation : public SimpleOperation {
+ private:
+ /* The target domain to realize the input on. */
+ Domain domain_;
+
+ public:
+ RealizeOnDomainOperation(Context &context, Domain domain, ResultType type);
+
+ void execute() override;
+
+ /* Determine if a realize on domain operation is needed for the input with the given result and
+ * descriptor in an operation with the given operation domain. If it is not needed, return a null
+ * pointer. If it is needed, return an instance of the operation. */
+ static SimpleOperation *construct_if_needed(Context &context,
+ const Result &input_result,
+ const InputDescriptor &input_descriptor,
+ const Domain &operation_domain);
+
+ protected:
+ /* The operation domain is just the target domain. */
+ Domain compute_domain() override;
+
+ private:
+ /* Get the realization shader of the appropriate type. */
+ GPUShader *get_realization_shader();
+};
+
+} // namespace blender::realtime_compositor