42 result.allocate_single_value();
48 if (this->
context().use_gpu()) {
49 const std::string shader_name = fmt::format(
"compositor_convert_{}_to_{}",
58 float luminance_coefficients[3];
63 input.bind_as_texture(shader,
"input_tx");
64 result.bind_as_image(shader,
"output_img");
68 input.unbind_as_texture();
78 const Result &input_result,
87 if (result_type != expected_type) {
117void ConversionOperation::execute_single(
const Result &
input, Result &
output)
122 output.update_single_value_data();
133 result.cpu_data().size());
145 result.cpu_data().size());
151void ConversionOperation::execute_cpu(
const Result &
input, Result &
output)
void GPU_shader_bind(GPUShader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3])
BLI_INLINE void IMB_colormanagement_get_luminance_coefficients(float r_rgb[3])
static const CPPType & get()
void convert_to_initialized_n(GSpan from_span, GMutableSpan to_span) const
Result create_result(ResultType type, ResultPrecision precision)
GPUShader * 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)
Context & context() const
static ResultType type(eGPUTextureFormat format)
static const char * type_name(const ResultType type)
bool is_single_value() const
void declare_input_descriptor(InputDescriptor descriptor)
void populate_result(Result result)
const DataTypeConversions & get_implicit_type_conversions()
static GSpan get_result_data(const Result &result)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
static GSpan get_result_single_value(const Result &result)