Files
test/source/blender/functions/intern/lazy_function_execute.cc
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00

73 lines
1.6 KiB
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup fn
*/
#include "FN_lazy_function_execute.hh"
namespace blender::fn::lazy_function {
BasicParams::BasicParams(const LazyFunction &fn,
const Span<GMutablePointer> inputs,
const Span<GMutablePointer> outputs,
MutableSpan<std::optional<ValueUsage>> input_usages,
Span<ValueUsage> output_usages,
MutableSpan<bool> set_outputs)
: Params(fn, true),
inputs_(inputs),
outputs_(outputs),
input_usages_(input_usages),
output_usages_(output_usages),
set_outputs_(set_outputs)
{
}
void *BasicParams::try_get_input_data_ptr_impl(const int index) const
{
return inputs_[index].get();
}
void *BasicParams::try_get_input_data_ptr_or_request_impl(const int index)
{
void *value = inputs_[index].get();
if (value == nullptr) {
input_usages_[index] = ValueUsage::Used;
}
return value;
}
void *BasicParams::get_output_data_ptr_impl(const int index)
{
return outputs_[index].get();
}
void BasicParams::output_set_impl(const int index)
{
set_outputs_[index] = true;
}
bool BasicParams::output_was_set_impl(const int index) const
{
return set_outputs_[index];
}
ValueUsage BasicParams::get_output_usage_impl(const int index) const
{
return output_usages_[index];
}
void BasicParams::set_input_unused_impl(const int index)
{
input_usages_[index] = ValueUsage::Unused;
}
bool BasicParams::try_enable_multi_threading_impl()
{
return true;
}
} // namespace blender::fn::lazy_function