diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-04 16:23:47 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-04 18:06:01 +0300 |
commit | d84c79a218e63d0d752d918e2c1cbcc2f90fd35e (patch) | |
tree | 13d078db89900ffa8401bc0b8a9d075ad8e5dab3 /source/blender/compositor/operations/COM_DotproductOperation.cc | |
parent | 9d7cb5c4a1158266d2f8caa1fc19be2a00fdf101 (diff) |
Compositor: Full frame vector nodes
Adds full frame implementation to Map Range, Map Value, Normal and
Normalize nodes. The other nodes in "Vector" sub-menu are submitted
separately.
Part of T88150.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D12233
Diffstat (limited to 'source/blender/compositor/operations/COM_DotproductOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_DotproductOperation.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_DotproductOperation.cc b/source/blender/compositor/operations/COM_DotproductOperation.cc index 07075ae1d9d..875b161e208 100644 --- a/source/blender/compositor/operations/COM_DotproductOperation.cc +++ b/source/blender/compositor/operations/COM_DotproductOperation.cc @@ -28,6 +28,7 @@ DotproductOperation::DotproductOperation() this->setResolutionInputSocketIndex(0); this->m_input1Operation = nullptr; this->m_input2Operation = nullptr; + flags.can_be_constant = true; } void DotproductOperation::initExecution() { @@ -55,4 +56,15 @@ void DotproductOperation::executePixelSampled(float output[4], output[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]); } +void DotproductOperation::update_memory_buffer_partial(MemoryBuffer *output, + const rcti &area, + Span<MemoryBuffer *> inputs) +{ + for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) { + const float *input1 = it.in(0); + const float *input2 = it.in(1); + *it.out = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]); + } +} + } // namespace blender::compositor |