Welcome to mirror list, hosted at ThFree Co, Russian Federation.

COM_realize_on_domain_operation.hh « realtime_compositor « compositor « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5a842e1600851018622b595f30fc0cf5fd4cbae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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