diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h index b47558d86fb..0377e31eaf7 100644 --- a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h +++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h @@ -187,7 +187,7 @@ ccl_device int bsdf_ashikhmin_shirley_sample(ccl_private const ShaderClosure *sc /* get half vector in tangent space */ float sin_theta = sqrtf(fmaxf(0.0f, 1.0f - cos_theta * cos_theta)); float cos_phi = cosf(phi); - float sin_phi = sinf(phi); /* no sqrt(1-cos^2) here b/c it causes artifacts */ + float sin_phi = sinf(phi); /* No `sqrt(1-cos^2)` here because it causes artifacts. */ float3 h = make_float3(sin_theta * cos_phi, sin_theta * sin_phi, cos_theta); /* half vector to world space */ diff --git a/intern/cycles/kernel/integrator/path_state.h b/intern/cycles/kernel/integrator/path_state.h index 639501db736..9ea26baf309 100644 --- a/intern/cycles/kernel/integrator/path_state.h +++ b/intern/cycles/kernel/integrator/path_state.h @@ -275,7 +275,7 @@ ccl_device_inline float path_state_continuation_probability(KernelGlobals kg, } } - /* Probabilistic termination: use sqrt() to roughly match typical view + /* Probabilistic termination: use `sqrt()` to roughly match typical view * transform and do path termination a bit later on average. */ Spectrum throughput = INTEGRATOR_STATE(state, path, throughput); #if defined(__PATH_GUIDING__) && PATH_GUIDING_LEVEL >= 4 diff --git a/intern/cycles/kernel/integrator/surface_shader.h b/intern/cycles/kernel/integrator/surface_shader.h index f94adf4822e..6625ff4b922 100644 --- a/intern/cycles/kernel/integrator/surface_shader.h +++ b/intern/cycles/kernel/integrator/surface_shader.h @@ -934,7 +934,7 @@ ccl_device float surface_shader_average_roughness(ccl_private const ShaderData * ccl_private const ShaderClosure *sc = &sd->closure[i]; if (CLOSURE_IS_BSDF(sc->type)) { - /* sqrt once to undo the squaring from multiplying roughness on the + /* `sqrt()` once to undo the squaring from multiplying roughness on the * two axes, and once for the squared roughness convention. */ float value = bsdf_get_roughness_pass_squared(sc); if (value >= 0.0f) { diff --git a/intern/cycles/kernel/sample/mapping.h b/intern/cycles/kernel/sample/mapping.h index 07cf77992c2..cf33eee34c5 100644 --- a/intern/cycles/kernel/sample/mapping.h +++ b/intern/cycles/kernel/sample/mapping.h @@ -131,10 +131,10 @@ ccl_device_inline float3 sample_uniform_cone(const float3 N, * directly to the radius. * * To find this mapping, we consider the simplest sampling strategies for cosine-weighted - * hemispheres and uniform cones. In both, phi is chosen as 2pi * random(). For the former, - * r_disk(rand) = sqrt(rand). This is just naive disk sampling, since the projection to the - * hemisphere doesn't change the radius. For the latter, r_cone(rand) = - * sin_from_cos(mix(cos_angle, 1, rand)). + * hemispheres and uniform cones. In both, phi is chosen as `2pi * random()`. For the former, + * `r_disk(rand) = sqrt(rand)`. This is just naive disk sampling, since the projection to the + * hemisphere doesn't change the radius. + * For the latter, `r_cone(rand) = sin_from_cos(mix(cos_angle, 1, rand))`. * * So, to remap, we just invert r_disk `(-> rand(r_disk) = r_disk^2)` and insert it into * r_cone: `r_cone(r_disk) = r_cone(rand(r_disk)) = sin_from_cos(mix(cos_angle, 1, r_disk^2))`. diff --git a/intern/cycles/test/integrator_adaptive_sampling_test.cpp b/intern/cycles/test/integrator_adaptive_sampling_test.cpp index 87c32b5c374..107b882e0f0 100644 --- a/intern/cycles/test/integrator_adaptive_sampling_test.cpp +++ b/intern/cycles/test/integrator_adaptive_sampling_test.cpp @@ -30,7 +30,7 @@ TEST(AdaptiveSampling, align_samples) { AdaptiveSampling adaptive_sampling; adaptive_sampling.use = true; - adaptive_sampling.min_samples = 11 /* rounded of sqrt(128) */; + adaptive_sampling.min_samples = 11 /* Rounded result of `sqrt(128)`. */; adaptive_sampling.adaptive_step = 4; /* Filtering will happen at the following samples: @@ -85,7 +85,7 @@ TEST(AdaptiveSampling, need_filter) { AdaptiveSampling adaptive_sampling; adaptive_sampling.use = true; - adaptive_sampling.min_samples = 11 /* rounded of sqrt(128) */; + adaptive_sampling.min_samples = 11 /* Rounded result of `sqrt(128)`. */; adaptive_sampling.adaptive_step = 4; const vector expected_samples_to_filter = { diff --git a/source/blender/blenkernel/intern/action.cc b/source/blender/blenkernel/intern/action.cc index 6875852b013..23132a32171 100644 --- a/source/blender/blenkernel/intern/action.cc +++ b/source/blender/blenkernel/intern/action.cc @@ -452,7 +452,7 @@ static void action_blend_write(BlendWriter *writer, ID *id, const void *id_addre * Note that the FCurves themselves have been written as part of the layered * animation writing code called above. Writing them again as part of the * handling of the legacy `action.fcurves` ListBase would corrupt the - * blendfile by generating two `BHead` `DATA` blocks with the same old + * blend-file by generating two `BHead` `DATA` blocks with the same old * address for the same ID. */ action_blend_write_clear_legacy_fcurves_listbase(action.curves); diff --git a/source/blender/blenkernel/intern/curve_bezier.cc b/source/blender/blenkernel/intern/curve_bezier.cc index 1e7f7e276a8..0efc76d08db 100644 --- a/source/blender/blenkernel/intern/curve_bezier.cc +++ b/source/blender/blenkernel/intern/curve_bezier.cc @@ -115,14 +115,17 @@ static void calculate_point_handles(const HandleType type_left, } const float3 dir = next_diff / next_len + prev_diff / prev_len; - /* The magic number 2.5614 is derived from approximating a circular arc at the control - * point. Given the constraints - * - P0=(0,1),P1=(c,1),P2=(1,c),P3=(1,0). - * - The first derivative of the curve must agree with the circular arc derivative at the - * endpoints. - * - Minimize the maximum radial drift. - * one can compute c ≈ 0.5519150244935105707435627. The distance from P0 to P3 is sqrt(2). - * The magic factor for `len` is (sqrt(2) / 0.5519150244935105707435627) ≈ 2.562375546255352. + /* The magic number 2.5614 is derived from approximating a circular arc at the control point. + * Given the constraints: + * + * - `P0=(0,1),P1=(c,1),P2=(1,c),P3=(1,0)`. + * - The first derivative of the curve must agree with the circular arc derivative at the + * endpoints. + * - Minimize the maximum radial drift. + * one can compute `c ≈ 0.5519150244935105707435627`. + * The distance from P0 to P3 is `sqrt(2)`. + * + * The magic factor for `len` is `(sqrt(2) / 0.5519150244935105707435627) ≈ 2.562375546255352`. * In older code of blender a slightly worse approximation of 2.5614 is used. It's kept * for compatibility. * diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc index d06d7744825..fefbb896319 100644 --- a/source/blender/blenloader/intern/readfile.cc +++ b/source/blender/blenloader/intern/readfile.cc @@ -1731,7 +1731,7 @@ static const char *get_alloc_name(FileData *fd, constexpr std::string_view STORAGE_ID = "readfile"; /* NOTE: This is thread_local storage, so as long as the handling of a same FileData is not - * spread accross threads (which is not supported at all currently), this is thread-safe. */ + * spread across threads (which is not supported at all currently), this is thread-safe. */ if (!fd->storage_handle) { fd->storage_handle = &intern::memutil::alloc_string_storage_get( std::string(STORAGE_ID)); diff --git a/source/blender/blenloader/intern/readfile.hh b/source/blender/blenloader/intern/readfile.hh index 0b85e42be6b..51704cb0ce7 100644 --- a/source/blender/blenloader/intern/readfile.hh +++ b/source/blender/blenloader/intern/readfile.hh @@ -52,7 +52,7 @@ ENUM_OPERATORS(eFileDataFlag, FD_FLAGS_IS_MEMFILE) #endif /** - * General data used during a blendfile reading. + * General data used during a blend-file reading. * * Note that this data (and its accesses) are absolutely not thread-safe currently. It should never * be accessed concurrently. diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc index e7aa10c5dc7..6ea74411ed7 100644 --- a/source/blender/blenloader/intern/writefile.cc +++ b/source/blender/blenloader/intern/writefile.cc @@ -430,7 +430,7 @@ struct WriteData { */ bool critical_error; /** - * A set of all 'old' adresses used as uid of written blocks for the current ID. Allows + * A set of all 'old' addresses used as UID of written blocks for the current ID. Allows * detecting invalid re-uses of the same address multiple times. */ blender::Set per_id_addresses_set; diff --git a/source/blender/editors/curves/intern/curves_edit.cc b/source/blender/editors/curves/intern/curves_edit.cc index 12eccd42338..469709e64bf 100644 --- a/source/blender/editors/curves/intern/curves_edit.cc +++ b/source/blender/editors/curves/intern/curves_edit.cc @@ -262,7 +262,7 @@ void resize_curves(bke::CurvesGeometry &curves, IndexMaskMemory memory; IndexMask curves_to_copy; std::optional range = curves_to_resize.to_range(); - /* Check if we need to copy some curves over. Write the new sizes into the offests. */ + /* Check if we need to copy some curves over. Write the new sizes into the offsets. */ if (range && curves.curves_range() == *range) { curves_to_copy = curves_to_resize.complement(curves.curves_range(), memory); offset_indices::copy_group_sizes( diff --git a/source/blender/editors/sculpt_paint/grease_pencil_trace_util.cc b/source/blender/editors/sculpt_paint/grease_pencil_trace_util.cc index 6ed511fa8f6..82857e74154 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_trace_util.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_trace_util.cc @@ -227,7 +227,7 @@ bke::CurvesGeometry trace_to_curves(const Trace &trace, holes.span[curve_i] = (path->sign == '-'); } - /* Potrace stores the last 3 points of a bezier segment. + /* POTRACE stores the last 3 points of a bezier segment. * The start point is the last segment's end point. */ int point_i = points.last(); auto next_point = [&]() { @@ -238,7 +238,7 @@ bke::CurvesGeometry trace_to_curves(const Trace &trace, const PathSegment &segment = path_segments[segment_i]; switch (path_tags[segment_i]) { case POTRACE_CORNER: - /* Potrace corners are formed by straight lines from the previous/next point. + /* POTRACE corners are formed by straight lines from the previous/next point. * segment[0] is unused, segment[1] is the corner position, segment[2] is the next point. */ handle_types_right[point_i] = BEZIER_HANDLE_VECTOR; diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.cc b/source/blender/editors/sculpt_paint/sculpt_boundary.cc index 64f03f150be..c4c4b582c06 100644 --- a/source/blender/editors/sculpt_paint/sculpt_boundary.cc +++ b/source/blender/editors/sculpt_paint/sculpt_boundary.cc @@ -1339,7 +1339,7 @@ std::unique_ptr data_init_mesh(Object &object, /* Starting from a vertex that is the limit of a boundary is ambiguous, so return nullptr instead * of forcing a random active boundary from a corner. */ /* TODO: Investigate whether initial_vert should actually be boundary_initial_vert. If - * initial_vert is correct, the above comment and the docstring for the relevant function should + * initial_vert is correct, the above comment and the doc-string for the relevant function should * be fixed. */ if (!is_vert_in_editable_boundary_mesh(faces, corner_verts, diff --git a/source/blender/io/usd/intern/usd_asset_utils.cc b/source/blender/io/usd/intern/usd_asset_utils.cc index f5beda86ec9..e4bfcbad510 100644 --- a/source/blender/io/usd/intern/usd_asset_utils.cc +++ b/source/blender/io/usd/intern/usd_asset_utils.cc @@ -368,7 +368,7 @@ std::string get_export_textures_dir(const pxr::UsdStageRefPtr stage) const pxr::ArResolver &ar = pxr::ArGetResolver(); - /* Resolove the './textures' relative path, with the stage path as an anchor. */ + /* Resolve the `./textures` relative path, with the stage path as an anchor. */ std::string textures_dir = ar.CreateIdentifierForNewAsset("./textures", stage_path); /* If parent of the stage path exists as a file system directory, try to create the @@ -572,7 +572,7 @@ std::string get_relative_path(const std::string &path, const std::string &anchor * file system. */ /* We don't have a library to compute relative paths for URIs - * so we use the standard fielsystem calls to do so. This + * so we use the standard file-system calls to do so. This * may not work for all URIs in theory, but is probably sufficient * for the subset of URIs we are likely to encounter in practice * currently. @@ -604,8 +604,7 @@ std::string get_relative_path(const std::string &path, const std::string &anchor /* Replace the common prefix up to the last slash with * a fake root directory to allow computing the relative path * excluding the URI. We omit the URI because it might not - * be handled correctly by the standard filesystem path - * computaions. */ + * be handled correctly by the standard file-system path computations. */ resolved_path = "/root" + resolved_path.substr(last_slash_pos); resolved_anchor = "/root" + resolved_anchor.substr(last_slash_pos); diff --git a/source/blender/io/usd/intern/usd_asset_utils.hh b/source/blender/io/usd/intern/usd_asset_utils.hh index 654435f2864..77665dad5ca 100644 --- a/source/blender/io/usd/intern/usd_asset_utils.hh +++ b/source/blender/io/usd/intern/usd_asset_utils.hh @@ -83,7 +83,7 @@ std::string get_export_textures_dir(const pxr::UsdStageRefPtr stage); * - Returns false if it's a Blender relative path. * - Returns true if the path is package-relative. * - Returns true is the path doesn't exist on the file system but can - * nonetheles be resolved by the USD asset resolver. + * nonetheless be resolved by the USD asset resolver. * - Returns false otherwise. * * TODO(makowalski): the test currently requires a file-system stat. @@ -134,7 +134,7 @@ bool write_to_path(const void *data, size_t size, const char *path, ReportList * * already exists, this function does nothing. * * \param path: path to record as a custom property - * \param id: id for which to create the custom propery + * \param id: id for which to create the custom property */ void ensure_usd_source_path_prop(const std::string &path, ID *id); diff --git a/source/blender/io/usd/intern/usd_reader_material.cc b/source/blender/io/usd/intern/usd_reader_material.cc index 6b6ef34382e..bb519d13f58 100644 --- a/source/blender/io/usd/intern/usd_reader_material.cc +++ b/source/blender/io/usd/intern/usd_reader_material.cc @@ -1172,7 +1172,7 @@ void USDMaterialReader::load_tex_image(const pxr::UsdShadeShader &usd_shader, } /* File input may have a connected source, e.g., if it's been overridden by - * an input on the mateial. */ + * an input on the material. */ if (file_input.HasConnectedSource()) { pxr::UsdShadeConnectableAPI source; pxr::TfToken source_name; diff --git a/tools/check_source/check_cmake_consistency_config.py b/tools/check_source/check_cmake_consistency_config.py index 44f89d173cb..19d09a3bce4 100644 --- a/tools/check_source/check_cmake_consistency_config.py +++ b/tools/check_source/check_cmake_consistency_config.py @@ -100,16 +100,21 @@ IGNORE_SOURCE = ( # Ignore cmake file, path pairs, # NOTE: keep commented block to show the intended format. +""" IGNORE_SOURCE_MISSING: Tuple[Tuple[str, Tuple[str, ...]], ...] = ( - # ( # Use for `WITH_NANOVDB`. - # "intern/cycles/kernel/CMakeLists.txt", ( - # "nanovdb/util/CSampleFromVoxels.h", - # "nanovdb/util/SampleFromVoxels.h", - # "nanovdb/NanoVDB.h", - # "nanovdb/CNanoVDB.h", - # ), - # ), + ( # Use for `WITH_NANOVDB`. + "intern/cycles/kernel/CMakeLists.txt", ( + "nanovdb/util/CSampleFromVoxels.h", + "nanovdb/util/SampleFromVoxels.h", + "nanovdb/NanoVDB.h", + "nanovdb/CNanoVDB.h", + ), + ), ) +""" +IGNORE_SOURCE_MISSING: Tuple[Tuple[str, Tuple[str, ...]], ...] = ( +) + IGNORE_CMAKE = ( "extern/audaspace/CMakeLists.txt",