46 result.allocate_single_value();
47 this->execute_single(input,
result);
52 if (this->
context().use_gpu()) {
53 const std::string shader_name = fmt::format(
"compositor_convert_{}_to_{}",
62 float luminance_coefficients[3];
77 this->execute_cpu(input,
result);
82 const Result &input_result,
91 if (result_type != expected_type) {
105void ConversionOperation::execute_cpu(
const Result &input, Result &
output)
const CPPType * type() const
void convert_to_initialized_n(GSpan from_span, GMutableSpan to_span) const
bool is_convertible(const CPPType &from_type, const CPPType &to_type) const
gpu::Shader * get_shader(const char *info_name, ResultPrecision precision)
static SimpleOperation * construct_if_needed(Context &context, const Result &input_result, const InputDescriptor &input_descriptor)
ConversionOperation(Context &context, const ResultType input_type, const ResultType expected_type)
void allocate_default_remaining_outputs()
Context & context() const
bool is_single_value() const
const CPPType & get_cpp_type() const
void unbind_as_texture() const
static const char * type_name(const ResultType type)
GPointer single_value() const
static ResultType type(gpu::TextureFormat format)
void bind_as_texture(gpu::Shader *shader, const char *texture_name) const
void declare_input_descriptor(InputDescriptor descriptor)
void populate_result(ResultType type)
const DataTypeConversions & get_implicit_type_conversions()
void compute_dispatch_threads_at_least(gpu::Shader *shader, int2 threads_range, int2 local_size=int2(16))
BLI_INLINE void IMB_colormanagement_get_luminance_coefficients(float r_rgb[3])
void GPU_shader_uniform_3fv(gpu::Shader *sh, const char *name, const float data[3])
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)