From 6c6a53fad357ad63d8128c33da7a84f172ef0b63 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 6 Sep 2022 16:25:20 +1000 Subject: Cleanup: spelling in comments, formatting, move comments into headers --- .../realtime_compositor/COM_compile_state.hh | 2 +- .../realtime_compositor/COM_shader_operation.hh | 2 +- .../realtime_compositor/COM_simple_operation.hh | 2 +- .../realtime_compositor/COM_utilities.hh | 38 ++++++++++++++-------- .../realtime_compositor/intern/operation.cc | 2 +- .../intern/realize_on_domain_operation.cc | 2 +- 6 files changed, 29 insertions(+), 19 deletions(-) (limited to 'source/blender/compositor') diff --git a/source/blender/compositor/realtime_compositor/COM_compile_state.hh b/source/blender/compositor/realtime_compositor/COM_compile_state.hh index ed6ad414e3b..924919bbef6 100644 --- a/source/blender/compositor/realtime_compositor/COM_compile_state.hh +++ b/source/blender/compositor/realtime_compositor/COM_compile_state.hh @@ -143,7 +143,7 @@ class CompileState { * the give node. */ void add_node_to_shader_compile_unit(DNode node); - /* Get a reference to the shader compile unit. */ + /* Get a reference to the shader compile unit. */ ShaderCompileUnit &get_shader_compile_unit(); /* Clear the compile unit. This should be called once the compile unit is compiled to ready it to diff --git a/source/blender/compositor/realtime_compositor/COM_shader_operation.hh b/source/blender/compositor/realtime_compositor/COM_shader_operation.hh index a33dcbf25be..d03e52ac8f2 100644 --- a/source/blender/compositor/realtime_compositor/COM_shader_operation.hh +++ b/source/blender/compositor/realtime_compositor/COM_shader_operation.hh @@ -224,7 +224,7 @@ class ShaderOperation : public Operation { * * This method first generates the necessary code to load the inputs and store the outputs. Then, * it creates a compute shader from the generated sources. Finally, it adds the necessary GPU - * resources to the shader. */ + * resources to the shader. */ static void generate_code(void *thunk, GPUMaterial *material, GPUCodegenOutput *code_generator); /* Add an image in the shader for each of the declared outputs. Additionally, emit code to define diff --git a/source/blender/compositor/realtime_compositor/COM_simple_operation.hh b/source/blender/compositor/realtime_compositor/COM_simple_operation.hh index 1655e52ac9a..0061986ce42 100644 --- a/source/blender/compositor/realtime_compositor/COM_simple_operation.hh +++ b/source/blender/compositor/realtime_compositor/COM_simple_operation.hh @@ -15,7 +15,7 @@ namespace blender::realtime_compositor { * A simple operation is an operation that takes exactly one input and computes exactly one output. * Moreover, the output is guaranteed to only have a single user, that is, its reference count will * be one. Such operations can be attached to the inputs of operations to pre-process the inputs to - * prepare them before the operation is executed.*/ + * prepare them before the operation is executed. */ class SimpleOperation : public Operation { private: /* The identifier of the output. This is constant for all operations. */ diff --git a/source/blender/compositor/realtime_compositor/COM_utilities.hh b/source/blender/compositor/realtime_compositor/COM_utilities.hh index 614384bd573..25f9fd0c1b6 100644 --- a/source/blender/compositor/realtime_compositor/COM_utilities.hh +++ b/source/blender/compositor/realtime_compositor/COM_utilities.hh @@ -16,44 +16,54 @@ namespace blender::realtime_compositor { using namespace nodes::derived_node_tree_types; -/* Get the origin socket of the given node input. If the input is not linked, the socket itself is +/** + Get the origin socket of the given node input. If the input is not linked, the socket itself is * returned. If the input is linked, the socket that is linked to it is returned, which could * either be an input or an output. An input socket is returned when the given input is connected - * to an unlinked input of a group input node. */ + * to an unlinked input of a group input node. + */ DSocket get_input_origin_socket(DInputSocket input); -/* Get the output socket linked to the given node input. If the input is not linked to an output, a - * null output is returned. */ +/** + * Get the output socket linked to the given node input. If the input is not linked to an output, + * a null output is returned. + */ DOutputSocket get_output_linked_to_input(DInputSocket input); -/* Get the result type that corresponds to the type of the given socket. */ +/** Get the result type that corresponds to the type of the given socket. */ ResultType get_node_socket_result_type(const bNodeSocket *socket); -/* Returns true if any of the nodes linked to the given output satisfies the given condition, and - * false otherwise. */ +/** + * Returns true if any of the nodes linked to the given output satisfies the given condition, + * and false otherwise. + */ bool is_output_linked_to_node_conditioned(DOutputSocket output, FunctionRef condition); -/* Returns the number of inputs linked to the given output that satisfy the given condition. */ +/** Returns the number of inputs linked to the given output that satisfy the given condition. */ int number_of_inputs_linked_to_output_conditioned(DOutputSocket output, FunctionRef condition); -/* A node is a shader node if it defines a method to get a shader node operation. */ +/** A node is a shader node if it defines a method to get a shader node operation. */ bool is_shader_node(DNode node); -/* Returns true if the given node is supported, that is, have an implementation. Returns false - * otherwise. */ +/** + * Returns true if the given node is supported, that is, have an implementation. + * Returns false otherwise. + */ bool is_node_supported(DNode node); -/* Get the input descriptor of the given input socket. */ +/** Get the input descriptor of the given input socket. */ InputDescriptor input_descriptor_from_input_socket(const bNodeSocket *socket); -/* Dispatch the given compute shader in a 2D compute space such that the number of threads in both +/** + * Dispatch the given compute shader in a 2D compute space such that the number of threads in both * dimensions is as small as possible but at least covers the entirety of threads_range assuming * the shader has a local group size given by local_size. That means that the number of threads * might be a bit larger than threads_range, so shaders has to put that into consideration. A * default local size of 16x16 is assumed, which is the optimal local size for many image - * processing shaders. */ + * processing shaders. + */ void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size = int2(16)); diff --git a/source/blender/compositor/realtime_compositor/intern/operation.cc b/source/blender/compositor/realtime_compositor/intern/operation.cc index 42dd5aeebe8..fb02807d729 100644 --- a/source/blender/compositor/realtime_compositor/intern/operation.cc +++ b/source/blender/compositor/realtime_compositor/intern/operation.cc @@ -83,7 +83,7 @@ void Operation::add_and_evaluate_input_processors() * because the construction of the input processors may depend on the result of previous input * processors for all inputs. For instance, the realize on domain input processor considers the * value of all inputs, so previous input processors for all inputs needs to be added and - * evaluated first. */ + * evaluated first. */ for (const StringRef &identifier : results_mapped_to_inputs_.keys()) { SimpleOperation *single_value = ReduceToSingleValueOperation::construct_if_needed( diff --git a/source/blender/compositor/realtime_compositor/intern/realize_on_domain_operation.cc b/source/blender/compositor/realtime_compositor/intern/realize_on_domain_operation.cc index 47993060a74..817293c0fa6 100644 --- a/source/blender/compositor/realtime_compositor/intern/realize_on_domain_operation.cc +++ b/source/blender/compositor/realtime_compositor/intern/realize_on_domain_operation.cc @@ -41,7 +41,7 @@ void RealizeOnDomainOperation::execute() const float3x3 local_transformation = input.domain().transformation * domain_.transformation.inverted(); - /* Set the origin of the transformation to be the center of the domain. */ + /* Set the origin of the transformation to be the center of the domain. */ const float3x3 transformation = float3x3::from_origin_transformation( local_transformation, float2(domain_.size) / 2.0f); -- cgit v1.2.3